Skip to content
Memory corruption Disclosed report CVE-2012-1973

Heap-use-after-free in nsObjectLoadingContent::LoadObject

Abhishek Arya Follow

Originally disclosed on Mozilla

Critical View original
  • Fixed in 28 days
  • Paid in 12 months
  • Disclosed after 28 days

Reproduces on trunk, testcase coming.

================================================================= ==16419== ERROR: AddressSanitizer heap-use-after-free on address 0x7f51151628d0 at pc 0x7f5137378a53 bp 0x7fff7866bed0 sp 0x7fff7866bec8 READ of size 8 at 0x7f51151628d0 thread T0 #0 0x7f5137378a53 in nsObjectLoadingContent::LoadObject(nsIURI*, bool, nsCString const&, bool) firefox/src/content/base/src/nsObjectLoadingContent.cpp:1316 #1 0x7f5137373ece in nsObjectLoadingContent::LoadObject(nsAString_internal const&, bool, nsCString const&, bool) firefox/src/content/base/src/nsObjectLoadingContent.cpp:1250 #2 0x7f51385729db in nsHTMLSharedObjectElement::StartObjectLoad(bool) firefox/src/content/html/content/src/nsHTMLSharedObjectElement.cpp:482 #3 0x7f51385772e8 in nsHTMLSharedObjectElement::StartObjectLoad() firefox/src/content/html/content/src/nsHTMLSharedObjectElement.cpp:112 #4 0x7f5138594c59 in nsRunnableMethodImpl<void (nsHTMLSharedObjectElement::)(), true>::Run() firefox/src/../../../../dist/include/nsThreadUtils.h:349 #5 0x7f5136e13965 in nsContentUtils::RemoveScriptBlocker() firefox/src/content/base/src/nsContentUtils.cpp:4888 #6 0x7f5135c516bd in ~mozAutoDocUpdate firefox/src/../../../../dist/include/mozAutoDocUpdate.h:40 #7 0x7f5135c1c743 in ~mozAutoDocUpdate firefox/src/../../../../dist/include/mozAutoDocUpdate.h:40 #8 0x7f51372b2fe8 in nsINode::ReplaceOrInsertBefore(bool, nsINode, nsINode*) firefox/src/content/base/src/nsINode.cpp:1891 #9 0x7f51374978f7 in nsINode::ReplaceOrInsertBefore(bool, nsINode*, nsINode*, unsigned int*) firefox/src/../../../../dist/include/nsINode.h:1462 #10 0x7f51374959d9 in nsINode::InsertBefore(nsINode*, nsINode*, unsigned int*) firefox/src/../../../../dist/include/nsINode.h:494 #11 0x7f5138073ccb in nsINode::AppendChild(nsINode*, unsigned int*) firefox/src/../../../../dist/include/nsINode.h:504 #12 0x7f513c101907 in nsIDOMNode_AppendChild(JSContext*, unsigned int, JS::Value*) firefox/src/objdir-ff-asan-sym/js/xpconnect/src/dom_quickstubs.cpp:5400 #13 0x7f51471ac507 in js::CallJSNative(JSContext*, int ()(JSContext, unsigned int, JS::Value*), JS::CallArgs const&) firefox/src/js/src/jscntxtinlines.h:385 #14 0x7f5147123006 in js::Interpret(JSContext*, js::StackFrame*, js::InterpMode) firefox/src/js/src/jsinterp.cpp:2442 #15 0x7f51470aa276 in js::RunScript(JSContext*, JSScript*, js::StackFrame*) firefox/src/js/src/jsinterp.cpp:301 #16 0x7f51471b937d in js::ExecuteKernel(JSContext*, JSScript*, JSObject&, JS::Value const&, js::ExecuteType, js::StackFrame*, JS::Value*) firefox/src/js/src/jsinterp.cpp:487 #17 0x7f51471bb080 in js::Execute(JSContext*, JSScript*, JSObject&, JS::Value*) firefox/src/js/src/jsinterp.cpp:524 #18 0x7f51469b1081 in EvaluateUCScriptForPrincipalsCommon(JSContext*, JSObject*, JSPrincipals*, JSPrincipals*, unsigned short const*, unsigned int, char const*, unsigned int, JS::Value*, JSVersion) firefox/src/js/src/jsapi.cpp:5373 #19 0x7f51469b2fbc in JS_EvaluateUCScriptForPrincipalsVersionOrigin firefox/src/js/src/jsapi.cpp:5410 #20 0x7f513914479f in nsJSContext::EvaluateString(nsAString_internal const&, JSObject*, nsIPrincipal*, nsIPrincipal*, char const*, unsigned int, JSVersion, nsAString_internal*, bool*) firefox/src/dom/base/nsJSEnvironment.cpp:1466 #21 0x7f51392f3c9e in nsGlobalWindow::RunTimeoutHandler(nsTimeout*, nsIScriptContext*) firefox/src/dom/base/nsGlobalWindow.cpp:9527 #22 0x7f51392a9d32 in nsGlobalWindow::RunTimeout(nsTimeout*) firefox/src/dom/base/nsGlobalWindow.cpp:9791 #23 0x7f51392f1eab in nsGlobalWindow::TimerCallback(nsITimer*, void*) firefox/src/dom/base/nsGlobalWindow.cpp:10063 #24 0x7f5140707272 in nsTimerImpl::Fire() firefox/src/xpcom/threads/nsTimerImpl.cpp:474 #25 0x7f5140708eac in nsTimerEvent::Run() firefox/src/xpcom/threads/nsTimerImpl.cpp:558 #26 0x7f51406cb4fd in nsThread::ProcessNextEvent(bool, bool*) firefox/src/xpcom/threads/nsThread.cpp:625 #27 0x7f514035a30d in NS_ProcessNextEvent_P(nsIThread*, bool) firefox/src/objdir-ff-asan-sym/xpcom/build/nsThreadUtils.cpp:217 #28 0x7f513f3fb366 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) firefox/src/ipc/glue/MessagePump.cpp:82 #29 0x7f514097f46a in MessageLoop::RunInternal() firefox/src/ipc/chromium/src/base/message_loop.cc:209 #30 0x7f514097f2b3 in MessageLoop::RunHandler() firefox/src/ipc/chromium/src/base/message_loop.cc:202 #31 0x7f514097f198 in MessageLoop::Run() firefox/src/ipc/chromium/src/base/message_loop.cc:176 #32 0x7f513e9321ee in nsBaseAppShell::Run() firefox/src/widget/xpwidgets/nsBaseAppShell.cpp:165 #33 0x7f513d585a28 in nsAppStartup::Run() firefox/src/toolkit/components/startup/nsAppStartup.cpp:257 #34 0x7f5133d63830 in XREMain::XRE_mainRun() firefox/src/toolkit/xre/nsAppRunner.cpp:3787 #35 0x7f5133d6a1d2 in XREMain::XRE_main(int, char**, nsXREAppData const*) firefox/src/toolkit/xre/nsAppRunner.cpp:3864 #36 0x7f5133d6d6a2 in XRE_main firefox/src/toolkit/xre/nsAppRunner.cpp:3940 #37 0x40c29f in do_main(int, char**) firefox/src/browser/app/nsBrowserApp.cpp:160 #38 0x409ccd in main firefox/src/browser/app/nsBrowserApp.cpp:298 #39 0x7f51504e8c4d in ?? ??:0 0x7f51151628d0 is located 80 bytes inside of 1112-byte region [0x7f5115162880,0x7f5115162cd8) freed by thread T0 here: #0 0x4a43a2 in free ??:0 #1 0x7f514d3745d3 in moz_free firefox/src/memory/mozalloc/mozalloc.cpp:49 #2 0x7f513470e4f6 in ~nsHttpChannel firefox/src/netwerk/protocol/http/nsHttpChannel.cpp:332 #3 0x7f5140440702 in nsHashPropertyBag::Release() firefox/src/xpcom/ds/nsHashPropertyBag.cpp:40 #4 0x7f51346da3d4 in mozilla::net::HttpBaseChannel::Release() firefox/src/netwerk/protocol/http/HttpBaseChannel.cpp:143 #5 0x7f51347788b4 in mozilla::net::nsHttpChannel::Release() firefox/src/netwerk/protocol/http/nsHttpChannel.cpp:4242 #6 0x7f51347789ec in non-virtual thunk to mozilla::net::nsHttpChannel::Release() firefox/src/modules/zlib/src/inffast.c:0 #7 0x7f5133e87001 in nsCOMPtr_base::assign_assuming_AddRef(nsISupports*) firefox/src/../../dist/include/nsCOMPtr.h:440 #8 0x7f5140310e44 in nsCOMPtr_base::assign_with_AddRef(nsISupports*) firefox/src/objdir-ff-asan-sym/xpcom/build/nsCOMPtr.cpp:50 #9 0x7f5133e7d563 in nsCOMPtr<nsIChannel>::operator=(nsIChannel*) firefox/src/../../../../dist/include/nsCOMPtr.h:624 #10 0x7f513470a0f6 in mozilla::net::AutoRedirectVetoNotifier::ReportRedirectResult(bool) firefox/src/netwerk/protocol/http/nsHttpChannel.cpp:178 #11 0x7f51347c5068 in ~AutoRedirectVetoNotifier firefox/src/netwerk/protocol/http/nsHttpChannel.cpp:162 #12 0x7f513474a9c3 in ~AutoRedirectVetoNotifier firefox/src/netwerk/protocol/http/nsHttpChannel.cpp:162 #13 0x7f51347774ff in mozilla::net::nsHttpChannel::ContinueProcessRedirection(unsigned int) firefox/src/netwerk/protocol/http/nsHttpChannel.cpp:4195 #14 0x7f51347a8e76 in mozilla::net::nsHttpChannel::OnRedirectVerifyCallback(unsigned int) firefox/src/netwerk/protocol/http/nsHttpChannel.cpp:5782 #15 0x7f51347a9ad2 in non-virtual thunk to mozilla::net::nsHttpChannel::OnRedirectVerifyCallback(unsigned int) firefox/src/modules/zlib/src/inffast.c:0 #16 0x7f5133e87ca4 in nsAsyncVerifyRedirectCallbackEvent::Run() firefox/src/netwerk/base/src/nsAsyncRedirectVerifyHelper.cpp:44 #17 0x7f51406cb4fd in nsThread::ProcessNextEvent(bool, bool*) firefox/src/xpcom/threads/nsThread.cpp:625 #18 0x7f514035a30d in NS_ProcessNextEvent_P(nsIThread*, bool) firefox/src/objdir-ff-asan-sym/xpcom/build/nsThreadUtils.cpp:217 #19 0x7f513f3fb366 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) firefox/src/ipc/glue/MessagePump.cpp:82 #20 0x7f514097f46a in MessageLoop::RunInternal() firefox/src/ipc/chromium/src/base/message_loop.cc:209 #21 0x7f514097f2b3 in MessageLoop::RunHandler() firefox/src/ipc/chromium/src/base/message_loop.cc:202 #22 0x7f514097f198 in MessageLoop::Run() firefox/src/ipc/chromium/src/base/message_loop.cc:176 #23 0x7f513e9321ee in nsBaseAppShell::Run() firefox/src/widget/xpwidgets/nsBaseAppShell.cpp:165 #24 0x7f513d585a28 in nsAppStartup::Run() firefox/src/toolkit/components/startup/nsAppStartup.cpp:257 #25 0x7f5133d63830 in XREMain::XRE_mainRun() firefox/src/toolkit/xre/nsAppRunner.cpp:3787 #26 0x7f5133d6a1d2 in XREMain::XRE_main(int, char**, nsXREAppData const*) firefox/src/toolkit/xre/nsAppRunner.cpp:3864 #27 0x7f5133d6d6a2 in XRE_main firefox/src/toolkit/xre/nsAppRunner.cpp:3940 #28 0x40c29f in do_main(int, char**) firefox/src/browser/app/nsBrowserApp.cpp:160 #29 0x409ccd in main firefox/src/browser/app/nsBrowserApp.cpp:298 previously allocated by thread T0 here: #0 0x4a4462 in __interceptor_malloc ??:0 #1 0x7f514d374727 in moz_xmalloc firefox/src/memory/mozalloc/mozalloc.cpp:54 #2 0x7f51346c8bd9 in nsHttpHandler::NewProxiedChannel(nsIURI*, nsIProxyInfo*, nsIChannel**) firefox/src/netwerk/protocol/http/nsHttpHandler.cpp:1437 #3 0x7f51346c7acb in nsHttpHandler::NewChannel(nsIURI*, nsIChannel**) firefox/src/netwerk/protocol/http/nsHttpHandler.cpp:1398 #4 0x7f5133f6c1eb in nsIOService::NewChannelFromURIWithProxyFlags(nsIURI*, nsIURI*, unsigned int, nsIChannel**) firefox/src/netwerk/base/src/nsIOService.cpp:657 #5 0x7f5133f6ada0 in nsIOService::NewChannelFromURI(nsIURI*, nsIChannel**) firefox/src/netwerk/base/src/nsIOService.cpp:576 #6 0x7f51347757e2 in mozilla::net::nsHttpChannel::ContinueProcessRedirectionAfterFallback(unsigned int) firefox/src/netwerk/protocol/http/nsHttpChannel.cpp:4120 #7 0x7f5134723559 in mozilla::net::nsHttpChannel::AsyncProcessRedirection(unsigned int) firefox/src/netwerk/protocol/http/nsHttpChannel.cpp:4052 #8 0x7f5134734a7c in mozilla::net::nsHttpChannel::ProcessResponse() firefox/src/netwerk/protocol/http/nsHttpChannel.cpp:1264 #9 0x7f513478d8bc in mozilla::net::nsHttpChannel::OnStartRequest(nsIRequest*, nsISupports*) firefox/src/netwerk/protocol/http/nsHttpChannel.cpp:4802 #10 0x7f513478ee97 in non-virtual thunk to mozilla::net::nsHttpChannel::OnStartRequest(nsIRequest*, nsISupports*) firefox/src/modules/zlib/src/inffast.c:0 #11 0x7f5133f3f162 in nsInputStreamPump::OnStateStart() firefox/src/netwerk/base/src/nsInputStreamPump.cpp:416 #12 0x7f5133f3e30d in nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream*) firefox/src/netwerk/base/src/nsInputStreamPump.cpp:367 #13 0x7f5133f41c2f in non-virtual thunk to nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream*) firefox/src/modules/zlib/src/inffast.c:0 #14 0x7f51405b72ee in nsInputStreamReadyEvent::Run() firefox/src/xpcom/io/nsStreamUtils.cpp:82 #15 0x7f51406cb4fd in nsThread::ProcessNextEvent(bool, bool*) firefox/src/xpcom/threads/nsThread.cpp:625 #16 0x7f514035a30d in NS_ProcessNextEvent_P(nsIThread*, bool) firefox/src/objdir-ff-asan-sym/xpcom/build/nsThreadUtils.cpp:217 #17 0x7f513f3fb366 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) firefox/src/ipc/glue/MessagePump.cpp:82 #18 0x7f514097f46a in MessageLoop::RunInternal() firefox/src/ipc/chromium/src/base/message_loop.cc:209 #19 0x7f514097f2b3 in MessageLoop::RunHandler() firefox/src/ipc/chromium/src/base/message_loop.cc:202 #20 0x7f514097f198 in MessageLoop::Run() firefox/src/ipc/chromium/src/base/message_loop.cc:176 #21 0x7f513e9321ee in nsBaseAppShell::Run() firefox/src/widget/xpwidgets/nsBaseAppShell.cpp:165 #22 0x7f513d585a28 in nsAppStartup::Run() firefox/src/toolkit/components/startup/nsAppStartup.cpp:257 #23 0x7f5133d63830 in XREMain::XRE_mainRun() firefox/src/toolkit/xre/nsAppRunner.cpp:3787 #24 0x7f5133d6a1d2 in XREMain::XRE_main(int, char**, nsXREAppData const*) firefox/src/toolkit/xre/nsAppRunner.cpp:3864 ==16419== ABORTING Stats: 340M malloced (374M for red zones) by 855014 calls Stats: 92M realloced by 60631 calls Stats: 302M freed by 692995 calls Stats: 180M really freed by 372279 calls Stats: 480M (122951 full pages) mmaped in 120 calls mmaps by size class: 8:425958; 9:57337; 10:24570; 11:20470; 12:6144; 13:4608; 14:1792; 15:384; 16:640; 17:160; 18:336; 19:48; 20:16; mallocs by size class: 8:671876; 9:92732; 10:38267; 11:31549; 12:8574; 13:6870; 14:2771; 15:720; 16:804; 17:284; 18:490; 19:62; 20:15; frees by size class: 8:533367; 9:79542; 10:33885; 11:27984; 12:7349; 13:6211; 14:2532; 15:641; 16:706; 17:264; 18:443; 19:59; 20:12; rfrees by size class: 8:274158; 9:50191; 10:20177; 11:18120; 12:3448; 13:3069; 14:1711; 15:414; 16:562; 17:161; 18:216; 19:42; 20:10; Stats: malloc large: 851 small slow: 4152 Shadow byte and word: 0x1fea22a2c51a: fd 0x1fea22a2c518: fd fd fd fd fd fd fd fd More shadow bytes: 0x1fea22a2c4f8: fa fa fa fa fa fa fa fa 0x1fea22a2c500: fa fa fa fa fa fa fa fa 0x1fea22a2c508: fa fa fa fa fa fa fa fa 0x1fea22a2c510: fd fd fd fd fd fd fd fd =>0x1fea22a2c518: fd fd fd fd fd fd fd fd 0x1fea22a2c520: fd fd fd fd fd fd fd fd 0x1fea22a2c528: fd fd fd fd fd fd fd fd 0x1fea22a2c530: fd fd fd fd fd fd fd fd 0x1fea22a2c538: fd fd fd fd fd fd fd fd

The original report as published on Mozilla's Bugzilla, by Abhishek Arya. 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: Core & HTML. Mozilla made it public on 9 August 2012 as CVE-2012-1973.

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 Abhishek Arya

View all

130 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.