Arbitrary memory access in ConsoleCallData::Trace
A server-side script causes Firefox to crash with an invalid pointer read in ChildFinder::NoteJSObject when the browser visits a local page. The crash occurs at an arbitrary address, indicating a memory safety issue that could potentially be exploited.
Originally disclosed on Mozilla
- Fixed in 35 days
- Paid in 5 days
- Disclosed after 35 days
Created attachment 8770453 ArbitraryMemAccess_NoteJSObject_Repro.js
Steps to reproduce:
- Run server side script ArbitraryMemAccess_NoteJSObject_Repro.js in Node.js (node ArbitraryMemAccess_NoteJSObject_Repro.js ).
- Enter http://localhost:12345 in Firefox browser.
- Firefox crashes at arbitrary address in ChildFinder::NoteJSObject():
Firefox version: 50.0a1 (2016-07-12)
(52350.545a0): Access violation - code c0000005 (!!! second chance !!!) eax=231ffff0 ebx=22d43a40 ecx=00fdeb48 edx=11988f6c esi=23103040 edi=00fdeb70 eip=0fb4ea12 esp=00fdeab8 ebp=00fdeabc iopl=0 nv up ei pl nz na pe nc cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010206 xul!js::gc::IsInsideNursery+0xa [inlined in xul!ChildFinder::NoteJSObject+0x15]: 0fb4ea12 8a00 mov al,byte ptr [eax] ds:002b:231ffff0=?? 0:000> !analzye -v No export analzye found 0:000> !analyze -v
-
* -
Exception Analysis * -
*
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\WINDOWS\SysWOW64\atidxx32.dll -
FAULTING_IP: xul!ChildFinder::NoteJSObject+15 [c:\builds\moz2_slave\m-cen-w32-ntly-000000000000000\build\src\xpcom\base\nscyclecollector.cpp @ 2562] 0fb4ea12 8a00 mov al,byte ptr [eax]
EXCEPTION_RECORD: ffffffff -- (.exr 0xffffffffffffffff) ExceptionAddress: 0fb4ea12 (xul!js::gc::IsInsideNursery+0x0000000a) ExceptionCode: c0000005 (Access violation) ExceptionFlags: 00000000 NumberParameters: 2 Parameter[0]: 00000000 Parameter[1]: 231ffff0 Attempt to read from address 231ffff0
CONTEXT: 00000000 -- (.cxr 0x0;r) eax=231ffff0 ebx=22d43a40 ecx=00fdeb48 edx=11988f6c esi=23103040 edi=00fdeb70 eip=0fb4ea12 esp=00fdeab8 ebp=00fdeabc iopl=0 nv up ei pl nz na pe nc cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010206 xul!js::gc::IsInsideNursery+0xa [inlined in xul!ChildFinder::NoteJSObject+0x15]: 0fb4ea12 8a00 mov al,byte ptr [eax] ds:002b:231ffff0=??
FAULTING_THREAD: 000545a0
DEFAULT_BUCKET_ID: INVALID_POINTER_READ
PROCESS_NAME: firefox.exe
ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%p referenced memory at 0x%p. The memory could not be %s.
EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%p referenced memory at 0x%p. The memory could not be %s.
EXCEPTION_PARAMETER1: 00000000
EXCEPTION_PARAMETER2: 231ffff0
READ_ADDRESS: 231ffff0
FOLLOWUP_IP: xul!ChildFinder::NoteJSObject+15 [c:\builds\moz2_slave\m-cen-w32-ntly-000000000000000\build\src\xpcom\base\nscyclecollector.cpp @ 2562] 0fb4ea12 8a00 mov al,byte ptr [eax]
NTGLOBALFLAG: 0
APPLICATION_VERIFIER_FLAGS: 0
APP: firefox.exe
ANALYSIS_VERSION: 6.3.9600.17029 (debuggers(dbg).140219-1702) x86fre
PRIMARY_PROBLEM_CLASS: INVALID_POINTER_READ
BUGCHECK_STR: APPLICATION_FAULT_INVALID_POINTER_READ
LAST_CONTROL_TRANSFER: from 0fb4f4ef to 0fb4ea12
STACK_TEXT:
00fdeabc 0fb4f4ef 00fdeb70 23103040 00000001 xul!ChildFinder::NoteJSObject+0x15
00fdead4 0fb50ced 23103040 119ae2c4 00fdeb70 xul!nsScriptObjectTracer::NoteJSChild+0x31
00fdeae8 1106aec9 22d43a44 119ae2c4 00fdeb70 xul!TraceCallbackFunc::Trace+0x16
00fdeb08 1106aef4 00fdeb48 00fdeb70 2235f900 xul!mozilla::dom::ConsoleCallData::Trace+0x45
00fdeb28 1106af8b 121665b4 2235f900 00fdeb48 xul!mozilla::dom::Console::cycleCollection::Trace+0x24
00fdeb50 0fc560f0 121665b4 2235f900 00fdeb70 xul!mozilla::dom::Console::cycleCollection::Traverse+0x5e
00fdeb90 0fe15468 0349009c 00fdebac 03447000 xul!nsPurpleBuffer::PurpleBlock::VisitEntries<RemoveSkippableVisitor>+0x2e0
00fdebc8 0fe15644 03490000 03447001 03447000 xul!nsPurpleBuffer::RemoveSkippable+0x47
00fdec04 0fe15715 03447001 03447000 8d37a8d0 xul!nsCycleCollector::ForgetSkippable+0x63
00fdec24 0fe15579 00000016 130e5301 000058a9 xul!nsCycleCollector_forgetSkippable+0x39
00fdec3c 0fe14c76 130e53e0 00fdec90 0fe14b9c xul!FireForgetSkippable+0x2d
00fdec58 0fe333bd 130e53e0 00000000 1cdc1190 xul!CCTimerFired+0xda
00fdece8 0fe332d9 1cdc1190 034066a4 034081d0 xul!nsTimerImpl::Fire+0xd0
00fded24 0fc4a5db 1cdc1190 034451d0 034451c0 xul!nsTimerEvent::Run+0x41
00fdedb4 0fc4896f 034081d0 00000000 00fdede7 xul!nsThread::ProcessNextEvent+0x254
00fdede8 0fdcc392 034730c0 4ff3aecb 034066a0 xul!mozilla::ipc::MessagePump::Run+0x70
00fdee20 0fdcc361 034081d0 00000001 0fc47500 xul!MessageLoop::RunHandler+0x20
00fdee40 0feeabaa 0f2d9d40 00000000 00fdee60 xul!MessageLoop::Run+0x19
00fdee50 0feea939 034066a0 0f2d9d40 00fdee74 xul!nsBaseAppShell::Run+0x34
00fdee60 0feea8ee 034066a0 00fdf1d5 1971a800 xul!nsAppShell::Run+0x26
00fdee74 0ff2a068 0f2d9d40 00fdf0ec 00fdf0d8 xul!nsAppStartup::Run+0x22
00fdf058 0fce67ba 03447110 00fdf204 03444150 xul!XREMain::XRE_mainRun+0x5e7
00fdf07c 0fce6291 00000000 03401050 00fdf204 xul!XREMain::XRE_main+0x16f
00fdf1e0 00e5197c 00000001 03401050 00fdf204 xul!XRE_main+0x39
00fdf47c 00e53be9 01385548 034061c0 00000001 firefox!do_main+0x3cc
00fdf80c 00e55005 00000001 fdf79160 01380358 firefox!wmain+0x449
00fdf858 749d38f4 00c05000 749d38d0 2991ff8d firefox!__scrt_common_main_seh+0xff
00fdf86c 77cb5de3 00c05000 2ae3712c 00000000 KERNEL32!BaseThreadInitThunk+0x24
00fdf8b4 77cb5dae ffffffff 77cdb7cb 00000000 ntdll!__RtlUserThreadStart+0x2f
00fdf8c4 00000000 00e55082 00c05000 00000000 ntdll!_RtlUserThreadStart+0x1b
STACK_COMMAND: .cxr 0x0 ; kb
FAULTING_SOURCE_LINE: c:\builds\moz2_slave\m-cen-w32-ntly-000000000000000\build\src\xpcom\base\nscyclecollector.cpp
FAULTING_SOURCE_FILE: c:\builds\moz2_slave\m-cen-w32-ntly-000000000000000\build\src\xpcom\base\nscyclecollector.cpp
FAULTING_SOURCE_LINE_NUMBER: 2562
SYMBOL_STACK_INDEX: 0
SYMBOL_NAME: xul!ChildFinder::NoteJSObject+15
FOLLOWUP_NAME: MachineOwner
MODULE_NAME: xul
IMAGE_NAME: xul.dll
DEBUG_FLR_IMAGE_TIMESTAMP: 5784e20c
FAILURE_BUCKET_ID: INVALID_POINTER_READ_c0000005_xul.dll!ChildFinder::NoteJSObject
BUCKET_ID: APPLICATION_FAULT_INVALID_POINTER_READ_xul!ChildFinder::NoteJSObject+15
ANALYSIS_SOURCE: UM
FAILURE_ID_HASH_STRING: um:invalid_pointer_read_c0000005_xul.dll!childfinder::notejsobject
FAILURE_ID_HASH: {59ea6cf6-54fb-ff4e-2053-d458d703b3b8}
Followup: MachineOwner
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
The crash could potentially be exploited to execute arbitrary code, though the report only demonstrates a denial of service.
What the attacker needed
Victim visits a malicious page; attacker runs a local server
How it was found
- Run the provided server-side script in Node.js.
- Open the local URL in Firefox.
- Firefox crashes at an arbitrary address.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
This report shows that a specially crafted web page can make Firefox crash by reading from a bad memory address. The crash happens deep inside Firefox's memory management code, which suggests a bug that might let an attacker run their own code.
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.