Skip to content
Memory corruption Disclosed report CVE-2015-2722

Use After Free in CanonicalizeXPCOMParticipant

Looben Yang Follow

Originally disclosed on Mozilla

Critical View original
  • Fixed in 8 days
  • Paid in 12 days
  • Disclosed after 8 days
Text
Using XMLHttpRequest in shared workers can trigger Use After Free.

Firefox version: 41.0a1 (2015-05-19)

Run the test case with local built Firefox in Visual Studio, it crashes in CanonicalizeXPCOMParticipant():


First-chance exception at 0x0F1969CD (xul.dll) in firefox.exe: 0xC0000005: Access violation reading location 0x5A5A5A5A.
Unhandled exception at 0x0F1969CD (xul.dll) in firefox.exe: 0xC0000005: Access violation reading location 0x5A5A5A5A.

The 0x5A5A5A5A memory pattern indicates a use after free.

Variables:

-		&out	0x1acff7ec {0x00000000 <NULL>}	nsISupports * *
+			0x00000000 <NULL>	nsISupports *
-		aIn	0x09c02920 {...}	nsISupports *
+		__vfptr	0x5a5a5a5a {???, ???, ???}	void * *
+		out	0x00000000 <NULL>	nsISupports *



The call stack:

>	xul.dll!CanonicalizeXPCOMParticipant(nsISupports * aIn) Line 931	C++
 	xul.dll!CCGraphBuilder::NoteXPCOMChild(nsISupports * aChild) Line 2332	C++
 	xul.dll!mozilla::CycleCollectedJSRuntime::NoteGCThingXPCOMChildren(const js::Class * aClasp, JSObject * aObj, nsCycleCollectionTraversalCallback & aCb) Line 631	C++
 	xul.dll!mozilla::CycleCollectedJSRuntime::TraverseGCThing(mozilla::CycleCollectedJSRuntime::TraverseSelect aTs, JS::GCCellPtr aThing, nsCycleCollectionTraversalCallback & aCb) Line 666	C++
 	xul.dll!mozilla::JSGCThingParticipant::Traverse(void * aPtr, nsCycleCollectionTraversalCallback & aCb) Line 354	C++
 	xul.dll!CCGraphBuilder::BuildGraph(js::SliceBudget & aBudget) Line 2239	C++
 	xul.dll!nsCycleCollector::MarkRoots(js::SliceBudget & aBudget) Line 2839	C++
 	xul.dll!nsCycleCollector::Collect(ccType aCCType, js::SliceBudget & aBudget, nsICycleCollectorListener * aManualListener, bool aPreferShorterSlices) Line 3612	C++
 	xul.dll!nsCycleCollector_collect(nsICycleCollectorListener * aManualListener) Line 4099	C++
 	xul.dll!`anonymous namespace'::WorkerJSRuntime::CustomGCCallback(JSGCStatus aStatus) Line 1021	C++
 	xul.dll!mozilla::CycleCollectedJSRuntime::OnGC(JSGCStatus aStatus) Line 1263	C++
 	xul.dll!mozilla::CycleCollectedJSRuntime::GCCallback(JSRuntime * aRuntime, JSGCStatus aStatus, void * aData) Line 758	C++
 	xul.dll!js::gc::GCRuntime::collect(bool incremental, js::SliceBudget budget, JS::gcreason::Reason reason) Line 6189	C++
 	xul.dll!js::gc::GCRuntime::gc(JSGCInvocationKind gckind, JS::gcreason::Reason reason) Line 6246	C++
 	xul.dll!js::DestroyContext(JSContext * cx, js::DestroyContextMode mode) Line 187	C++
 	xul.dll!JS_DestroyContext(JSContext * cx) Line 730	C++
 	xul.dll!`anonymous namespace'::WorkerThreadPrimaryRunnable::Run() Line 2823	C++
 	xul.dll!nsThread::ProcessNextEvent(bool aMayWait, bool * aResult) Line 866	C++
 	xul.dll!NS_ProcessNextEvent(nsIThread * aThread, bool aMayWait) Line 265	C++
 	xul.dll!mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate * aDelegate) Line 355	C++
 	xul.dll!MessageLoop::RunInternal() Line 234	C++
 	xul.dll!MessageLoop::RunHandler() Line 227	C++
 	xul.dll!MessageLoop::Run() Line 201	C++
 	xul.dll!nsThread::ThreadFunc(void * aArg) Line 364	C++
 	nss3.dll!_PR_NativeRunThread(void * arg) Line 397	C
 	nss3.dll!pr_root(void * arg) Line 90	C
 	[External Code]	
 	[Frames below may be incorrect and/or missing, no symbols loaded for msvcr120.dll]

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 critical-severity memory corruption bug in DOM: Workers. Mozilla made it public on 28 May 2015 as CVE-2015-2722.

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.