New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 169972 link

Starred by 1 user

Issue metadata

Status: Fixed
Closed: Jan 2013
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug-Security

Sign in to add a comment

Security: Heap-Buffer-Overflow in

Project Member Reported by, Jan 15 2013

Issue description

CreateBufferForTransfer in has the following code snippet:
  if (!
    return buffer;

  memcpy(buffer->data(),>data(), size);
  return buffer;

Both and size are controlled via JS. When is small enough, an invalid read happens at memcpy:

      chrome.usb.bulkTransfer(device, {
        "length":100, // size
        "data":new ArrayBuffer(1) //
        }, function() {}

The length of the invalid read can be controlled by changing |length| and the size of |data|.

chrome.usb API documentation implies that |length| and |data| are mutually exclusive for GenericTransfer type: If "direction"=="in", "data" is ignored; and if "direction"=="out", "length" is ignored. The logic in CreateBufferForTransfer still attempts to use "data" when "direction"=="in".
The same logic applies to other usb API that uses CreateBufferForTransfer, including chrome.usb.controlTransfer, interruptTransfer etc.

Attached app is the reproduction case.

Tested with ASAN on Mac and Linux but should also affect Windows .

Crash State:
==35711== ERROR: AddressSanitizer: heap-buffer-overflow on address 0x48871fb3 at pc 0x3884b41 bp 0xb4aa54b8 sp 0xb4aa54b4
READ of size 1 at 0x48871fb3 thread T17
    #0 0x3884b40 in scoped_refptr<net::IOBuffer> ::CreateBufferForTransfer<extensions::api::usb::GenericTransferInfo>
    #1 0x3883ddb in extensions::UsbBulkTransferFunction::AsyncWorkStart
    #2 0x35ee840 in extensions::AsyncApiFunction::WorkOnWorkThread

0x48871fb3 is located 13 bytes to the left of 32-byte region [0x48871fc0,0x48871fe0)
freed by thread T0 here:
    #0 0x109845 in __asan_unpoison_memory_region (in Chromium) + 117
    #1 0x97555327 in CFAllocatorDeallocate (in CoreFoundation) + 231
    #2 0x97555089 in CFRelease (in CoreFoundation) + 2041
7.3 KB Download
Status: Assigned

Comment 2 by, Jan 18 2013

I have a patch for this:
Status: Started
Project Member

Comment 4 by, Jan 20 2013

The following revision refers to this bug:

r177857 | | 2013-01-20T00:38:15.984588Z

Changed paths:

Fix transfer length validation in Usb Api.

This change limits the length parameter of Usb transfers to 0-100 MB.
It introduces a new error for invalid transfer lengths.
It also correctly ignores 'data' parameter if transfer 'direction'
equals 'in', and ignores transfer 'length' parameter if 'direction'
is 'out'.

BUG= 169972 ,  169981 
TEST=browser_tests: UsbApiTest.InvalidLengthTransfer

Review URL:
Labels: -Restrict-View-SecurityTeam Restrict-View-SecurityNotify Merge-Approved
Status: Fixed
Labels: -Mstone-24 -Merge-Approved Mstone-26 Release-0
M26 seems fine?
Project Member

Comment 7 by, Mar 10 2013

Labels: -Type-Security -Area-Internals -SecSeverity-Medium -SecImpacts-Stable -Mstone-26 -Feature-Apps-APIs Cr-Platform-Apps-API M-26 Security-Severity-Medium Cr-Internals Security-Impact-Stable Type-Bug-Security
Project Member

Comment 8 by, Mar 21 2013

Labels: -Security-Impact-Stable Security_Impact-Stable
Project Member

Comment 9 by, Mar 21 2013

Labels: -Security-Severity-Medium Security_Severity-Medium
Labels: CVE-2013-0923
Labels: -Restrict-View-SecurityNotify
Bulk release of old security bug reports.

Project Member

Comment 12 by, Oct 1 2016

This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit - Your friendly Sheriffbot
Project Member

Comment 13 by, Oct 2 2016

This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit - Your friendly Sheriffbot
Labels: allpublic
Labels: CVE_description-submitted

Sign in to add a comment