Yet another Use After Free in CanonicalizeXPCOMParticipant()
Originally disclosed on Mozilla
- Fixed in 8 days
- Paid in 13 days
- Disclosed after 8 days
Created attachment 8766143 YA_UAF_CanonicalizeXPCOMParticipant_Repro.js
Steps to reproduce:
- Run server side script YA_UAF_CanonicalizeXPCOMParticipant_Repro.js in Node.js (node YA_UAF_CanonicalizeXPCOMParticipant_Repro.js ).
- Enter http://localhost:12345 in Firefox browser.
- Firefox crashes at corrupted address because of a Use After Free:
Firefox version: 50.0a1 (2016-06-28)
(150.1258): Access violation - code c0000005 (first chance) First chance exceptions are reported before any exception handling. This exception may be expected and handled. eax=152fe148 ebx=00000000 ecx=1d1be1a0 edx=1f9ff5ac esi=658d82ec edi=1a280520 eip=63b4eafa esp=1f9ff570 ebp=1f9ff5a0 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!CanonicalizeXPCOMParticipant+0xf [inlined in xul!CCGraphBuilder::NoteXPCOMChild+0x57]: 63b4eafa ff10 call dword ptr [eax] ds:002b:152fe148=???????? 0:071> !analyze -v
-
* -
Exception Analysis * -
*
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\WINDOWS\SysWOW64\nvwgf2um.dll -
FAULTING_IP: xul!CCGraphBuilder::NoteXPCOMChild+57 [c:\builds\moz2_slave\m-cen-w32-ntly-000000000000000\build\src\xpcom\base\nscyclecollector.cpp @ 2377] 63b4eafa ff10 call dword ptr [eax]
EXCEPTION_RECORD: (.exr -1) ExceptionAddress: 63b4eafa (xul!CanonicalizeXPCOMParticipant+0x0000000f) ExceptionCode: c0000005 (Access violation) ExceptionFlags: 00000000 NumberParameters: 2 Parameter[0]: 00000000 Parameter[1]: 152fe148 Attempt to read from address 152fe148
FAULTING_THREAD: 00001258
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: 152fe148
READ_ADDRESS: 152fe148
FOLLOWUP_IP: xul!CCGraphBuilder::NoteXPCOMChild+57 [c:\builds\moz2_slave\m-cen-w32-ntly-000000000000000\build\src\xpcom\base\nscyclecollector.cpp @ 2377] 63b4eafa ff10 call dword ptr [eax]
NTGLOBALFLAG: 400
APPLICATION_VERIFIER_FLAGS: 0
APP: firefox.exe
ANALYSIS_VERSION: 10.0.10240.9 x86fre
BUGCHECK_STR: INVALID_POINTER_READ_IN_CALL
DEFAULT_BUCKET_ID: INVALID_POINTER_READ_IN_CALL
LAST_CONTROL_TRANSFER: from 63c7962c to 63b4eafa
STACK_TEXT:
1f9ff5a0 63c7962c 1a280520 00000000 1f9ff898 xul!CCGraphBuilder::NoteXPCOMChild+0x57
1f9ff5c4 63c79328 66080974 21b17100 1a280520 xul!mozilla::CycleCollectedJSRuntime::NoteGCThingXPCOMChildren+0x7f
1f9ff610 63c791ca 1f9ff5e8 21b17100 21b17100 xul!mozilla::CycleCollectedJSRuntime::TraverseGCThing+0x148
1f9ff624 63c790e7 1f9ff8d0 21b17100 1a280520 xul!mozilla::JSGCThingParticipant::Traverse+0x42
1f9ff644 63e0886c 1ec02af0 1138e000 00000000 xul!CCGraphBuilder::BuildGraph+0x53
1f9ff65c 63e08449 1f9ff6c0 1af45b40 00000000 xul!nsCycleCollector::MarkRoots+0x1d
1f9ff698 63c8e79f 00000001 1f9ff6c0 00000000 xul!nsCycleCollector::Collect+0xc8
1f9ff6e4 63c8e302 1f9ff6fc 63c8e2d0 00000001 xul!nsCycleCollector_collect+0x68
1f9ff6ec 63c8e2d0 00000001 1f9ff77c 1f9ff708 xul!anonymous namespace'::WorkerJSRuntime::CustomGCCallback+0x19 1f9ff6fc 63c8e279 00000001 1f9ff71c 63c8e264 xul!mozilla::CycleCollectedJSRuntime::OnGC+0x55 1f9ff708 63c8e264 1a3cd0e8 00000001 1f9ff898 xul!mozilla::CycleCollectedJSRuntime::GCCallback+0xe 1f9ff71c 63c8e008 00000001 1a3cd2f8 1a3cd428 xul!js::gc::GCRuntime::callGCCallback+0x1a 1f9ff738 63c8df7d 00000000 00000001 1a3cd2f8 xul!anonymous namespace'::AutoNotifyGCActivity::~AutoNotifyGCActivity+0x37
1f9ff784 63c712a1 00000001 1f9ff820 00000000 xul!js::gc::GCRuntime::gcCycle+0x17b
1f9ff810 63dbe101 00000001 00000000 ffffffff xul!js::gc::GCRuntime::collect+0xbd
1f9ff868 63dbe018 00000000 00000000 00000000 xul!js::gc::GCRuntime::gc+0x49
1f9ff878 63dbe884 1e920aa0 00000000 00000000 xul!JS_GC+0x17
1f9ffa44 63c7e2b1 1a2c5c20 1f133f00 8000ff01 xul!`anonymous namespace'::WorkerThreadPrimaryRunnable::Run+0x176
1f9ffab0 63c7f8c8 1e920aa0 8000ff01 1f9ffacb xul!nsThread::ProcessNextEvent+0x150
1f9ffacc 63dba72d 1f133f00 1f133f00 1f133f00 xul!NS_ProcessNextEvent+0x16
1f9ffaec 63dba625 00133f00 7e6dce61 1e920aa0 xul!mozilla::ipc::MessagePumpForNonMainThreads::Run+0xc0
1f9ffb24 63dba5f4 1e920aac 00000001 1d6c1b00 xul!MessageLoop::RunHandler+0x20
1f9ffb44 63dba891 0300e350 1d6c1b40 1d6c1b40 xul!MessageLoop::Run+0x19
1f9ffb6c 66d22b52 1e920aac 165518b8 66d226fb xul!nsThread::ThreadFunc+0xab
1f9ffb8c 66d22708 1d6c1b40 1f9ffbd4 6af762a4 nss3!_PR_NativeRunThread+0x9a
1f9ffb98 6af762a4 1d6c1b40 7210c316 6af76250 nss3!pr_root+0xd
1f9ffbd4 76b838f4 165518b8 76b838d0 6e2ef4c7 ucrtbase!_crt_at_quick_exit+0x104
1f9ffbe8 77265de3 165518b8 6fdc0efd 00000000 KERNEL32!BaseThreadInitThunk+0x24
1f9ffc30 77265dae ffffffff 7728b7b7 00000000 ntdll!__RtlUserThreadStart+0x2f
1f9ffc40 00000000 6af76250 165518b8 00000000 ntdll!_RtlUserThreadStart+0x1b
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: 2377
FAULTING_SOURCE_CODE:
947: static nsISupports*
948: CanonicalizeXPCOMParticipant(nsISupports* aIn)
949: {
950: nsISupports* out = nullptr;
951: aIn->QueryInterface(NS_GET_IID(nsCycleCollectionISupports), 952: reinterpret_cast<void**>(&out)); 953: return out; 954: } 955: 956: static inline void
SYMBOL_STACK_INDEX: 0
SYMBOL_NAME: xul!CCGraphBuilder::NoteXPCOMChild+57
FOLLOWUP_NAME: MachineOwner
MODULE_NAME: xul
IMAGE_NAME: xul.dll
DEBUG_FLR_IMAGE_TIMESTAMP: 57726fac
STACK_COMMAND: ~71s ; kb
BUCKET_ID: INVALID_POINTER_READ_IN_CALL_xul!CCGraphBuilder::NoteXPCOMChild+57
PRIMARY_PROBLEM_CLASS: INVALID_POINTER_READ_IN_CALL_xul!CCGraphBuilder::NoteXPCOMChild+57
FAILURE_PROBLEM_CLASS: INVALID_POINTER_READ_IN_CALL
FAILURE_EXCEPTION_CODE: c0000005
FAILURE_IMAGE_NAME: xul.dll
FAILURE_FUNCTION_NAME: CCGraphBuilder::NoteXPCOMChild
FAILURE_SYMBOL_NAME: xul.dll!CCGraphBuilder::NoteXPCOMChild
FAILURE_BUCKET_ID: INVALID_POINTER_READ_IN_CALL_c0000005_xul.dll!CCGraphBuilder::NoteXPCOMChild
ANALYSIS_SOURCE: UM
FAILURE_ID_HASH_STRING: um:invalid_pointer_read_in_call_c0000005_xul.dll!ccgraphbuilder::notexpcomchild
FAILURE_ID_HASH: {29422043-bdfa-afdd-324c-83eab1baa572}
Followup: MachineOwner
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 critical-severity memory corruption bug in DOM: Workers. Mozilla made it public on 7 July 2016 as CVE-2016-5259.
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.