Skip to content
Memory corruption Disclosed report CVE-2014-1543

Heap memory corruption by navigator.getGamepads()

Looben Yang Follow

Originally disclosed on Mozilla

  • Fixed in 5 days
  • Paid in 16 days
  • Disclosed after 5 days
Text
Created attachment 8424311
reproduction case

User Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36

Steps to reproduce:

Run the attached reproduction case (HeapCorrupt_getGamepads_Repro.html) with firefox debug build.

Reproduction case:

<script>
navigator.getGamepads(); 
</script>

Firefox version:  31.0a1 (2014-04-26), debug build
Operating System:  Windows 8, 64 bit




Actual results:

Windows debug heap reports heap corruptions:

Critical error detected c0000374
firefox.exe has triggered a breakpoint.

First-chance exception at 0x7771AA3C (ntdll.dll) in firefox.exe: 0xC0000374: A heap has been corrupted (parameters: 0x7772FE38).
Unhandled exception at 0x7771AA3C (ntdll.dll) in firefox.exe: 0xC0000374: A heap has been corrupted (parameters: 0x7772FE38).


Stack Trace:

 	ntdll.dll!_RtlReportCriticalFailure@8()	Unknown
 	ntdll.dll!_RtlpReportHeapFailure@4()	Unknown
 	ntdll.dll!_RtlpLogHeapFailure@24()	Unknown
 	ntdll.dll!@RtlpLowFragHeapAllocFromContext@16()	Unknown
 	ntdll.dll!_RtlAllocateHeap@12()	Unknown
 	msvcr120.dll!malloc(unsigned int size) Line 92	C
>	mozalloc.dll!moz_xmalloc(unsigned int size) Line 52	C++
 	xul.dll!nsTArray_base<nsTArrayInfallibleAllocator,nsTArray_CopyWithMemutils>::EnsureCapacity(unsigned int capacity, unsigned int elemSize) Line 119	C++
 	xul.dll!mozilla::dom::Gamepad::Gamepad(nsISupports * aParent, const nsAString_internal & aID, unsigned int aIndex, mozilla::dom::GamepadMappingType aMapping, unsigned int aNumButtons, unsigned int aNumAxes) Line 36	C++
 	xul.dll!mozilla::dom::Gamepad::Clone(nsISupports * aParent) Line 101	C++
 	xul.dll!mozilla::dom::GamepadService::SetWindowHasSeenGamepad(nsGlobalWindow * aWindow, unsigned int aIndex, bool aHasSeen) Line 457	C++
 	xul.dll!mozilla::dom::GamepadService::NewAxisMoveEvent(unsigned int aIndex, unsigned int aAxis, double aValue) Line 287	C++
 	xul.dll!`anonymous namespace'::GamepadEvent::Run() Line 278	C++
 	xul.dll!nsThread::ProcessNextEvent(bool mayWait, bool * result) Line 715	C++
 	xul.dll!NS_ProcessNextEvent(nsIThread * thread, bool mayWait) Line 263	C++
 	xul.dll!mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate * aDelegate) Line 136	C++
 	xul.dll!MessageLoop::RunHandler() Line 223	C++
 	xul.dll!MessageLoop::Run() Line 197	C++
 	xul.dll!nsBaseAppShell::Run() Line 166	C++
 	xul.dll!nsAppShell::Run() Line 188	C++
 	xul.dll!nsAppStartup::Run() Line 279	C++
 	xul.dll!XREMain::XRE_mainRun() Line 4019	C++
 	xul.dll!NS_TableDrivenQI(void * aThis, const nsID & aIID, void * * aInstancePtr, const QITableEntry * entries) Line 17	C++
 	xul.dll!nsComponentManagerImpl::QueryInterface(const nsID & aIID, void * * aInstancePtr) Line 823	C++
 	xul.dll!nsQueryInterface::operator()(const nsID & aIID, void * * answer) Line 19	C++
 	xul.dll!nsCOMPtr_base::assign_from_qi(const nsQueryInterface qi, const nsID & iid) Line 56	C++




Registers:

EAX = 001DF37C EBX = 157EAEB0 ECX = 00000001 EDX = 001DF211 ESI = 00000005 EDI = 11161484 EIP = 60BD1412 ESP = 001DF550 EBP = 00000008 EFL = 00000000 


Expected results:

No heap corruption should happen.

The original report as published on Mozilla's Bugzilla, by Looben Yang. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is known

A high-severity memory corruption bug in Hardware Abstraction Layer (HAL). Mozilla made it public on 22 May 2014 as CVE-2014-1543.

About Memory corruption

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More by Looben Yang

View all

50 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.