Skip to content
Memory corruption Disclosed report

Bad svg length object crash in nsSVGElement::WillChangeLength

Abhishek Arya Follow

Originally disclosed on Mozilla

Critical View original
  • Fixed in 4 days
  • Paid in 2 months
  • Disclosed after 4 days

Created attachment 778813 Testcase

NS_NOTREACHED("Unknown unit type"); in nsSVGLength2::GetUnitScaleFactor, followed by NS_ASSERTION(aAttrEnum < info.mLengthCount, "aAttrEnum out of range");, followed by corrupted object crash in nsAttrAndChildArray::SetAndTakeAttr [new (&ATTRS(mImpl)[i].mName) nsAttrName(aLocalName);]

==6958==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f98aadc2b90 at pc 0x7f98a5d33568 bp 0x7fff3f89e7d0 sp 0x7fff3f89e7c8 READ of size 8 at 0x7f98aadc2b90 thread T0 #0 0x7f98a5d33567 in nsSVGElement::WillChangeLength(unsigned char) content/svg/content/src/nsSVGElement.cpp:1604 #1 0x7f98a5d492a0 in nsSVGLength2::ConvertToSpecifiedUnits(unsigned short, nsSVGElement*) content/svg/content/src/nsSVGLength2.cpp:312 #2 0x7f98a38b220d in NS_InvokeByIndex xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_unix.cpp:162 #3 0x7f98a5e5897d in XPCWrappedNative::CallMethod(XPCCallContext&, XPCWrappedNative::CallMode) js/xpconnect/src/XPCWrappedNative.cpp:2795 #4 0x7f98a5e68f8f in XPC_WN_CallMethod(JSContext*, unsigned int, JS::Value*) js/xpconnect/src/XPCWrappedNativeJSOps.cpp:1315 #5 0x7f98a7a81bc4 in js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/jscntxtinlines.h:225 #6 0x7f98a7a72f1c in Interpret(JSContext*, js::RunState&) js/src/vm/Interpreter.cpp:2502 #7 0x7f98a7a6343b in js::RunScript(JSContext*, js::RunState&) js/src/vm/Interpreter.cpp:434 #8 0x7f98a7a83b05 in js::ExecuteKernel(JSContext*, JS::Handle<JSScript*>, JSObject&, JS::Value const&, js::ExecuteType, js::AbstractFramePtr, JS::Value*) js/src/vm/Interpreter.cpp:618 #9 0x7f98a8302907 in EvalKernel(JSContext*, JS::CallArgs const&, EvalType, js::AbstractFramePtr, JS::Handle<JSObject*>, unsigned char*) js/src/builtin/Eval.cpp:330 #10 0x7f98a8302f34 in js::DirectEval(JSContext*, JS::CallArgs const&) js/src/builtin/Eval.cpp:452 #11 0x7f98a7f69ea3 in js::ion::DoCallFallback(JSContext*, js::ion::BaselineFrame*, js::ion::ICCall_Fallback*, unsigned int, JS::Value*, JS::MutableHandleJS::Value) js/src/ion/BaselineIC.cpp:6991 #12 0x7f9894a36732 in #13 0x611000376b37 in #14 0x7f9894a2efff in #15 0x7f98a7f9ea66 in EnterBaseline(JSContext*, js::ion::EnterJitData&) js/src/ion/BaselineJIT.cpp:107 #16 0x7f98a7f9f5df in js::ion::EnterBaselineAtBranch(JSContext*, js::StackFrame*, unsigned char*) js/src/ion/BaselineJIT.cpp:188 #17 0x7f98a7a7c6a3 in Interpret(JSContext*, js::RunState&) js/src/vm/Interpreter.cpp:1610 #18 0x7f98a7a6343b in js::RunScript(JSContext*, js::RunState&) js/src/vm/Interpreter.cpp:434 #19 0x7f98a7a83b05 in js::ExecuteKernel(JSContext*, JS::Handle<JSScript*>, JSObject&, JS::Value const&, js::ExecuteType, js::AbstractFramePtr, JS::Value*) js/src/vm/Interpreter.cpp:618 #20 0x7f98a7a83e18 in js::Execute(JSContext*, JS::Handle<JSScript*>, JSObject&, JS::Value*) js/src/vm/Interpreter.cpp:654 #21 0x7f98a7c3aa38 in JS::Evaluate(JSContext*, JS::Handle<JSObject*>, JS::CompileOptions, unsigned short const*, unsigned long, JS::Value*) js/src/jsapi.cpp:5549 #22 0x7f98a53ed6bb in nsJSContext::EvaluateString(nsAString_internal const&, JS::Handle<JSObject*>, JS::CompileOptions&, bool, JS::Value*) dom/base/nsJSEnvironment.cpp:1278 #23 0x7f98a53b03bd in nsGlobalWindow::RunTimeoutHandler(nsTimeout*, nsIScriptContext*) dom/base/nsGlobalWindow.cpp:10237 #24 0x7f98a53986a3 in nsGlobalWindow::RunTimeout(nsTimeout*) dom/base/nsGlobalWindow.cpp:10481 #25 0x7f98a53af733 in nsGlobalWindow::TimerCallback(nsITimer*, void*) dom/base/nsGlobalWindow.cpp:10728 #26 0x7f98a387a3f6 in nsTimerEvent::Run() xpcom/threads/nsTimerImpl.cpp:627 #27 0x7f98a37ad29a in NS_ProcessNextEvent(nsIThread*, bool) objdir-ff-asan/xpcom/build/nsThreadUtils.cpp:238 #28 0x7f98a29c656c in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) ipc/glue/MessagePump.cpp:81 #29 0x7f98a391ab99 in MessageLoop::Run() ipc/chromium/src/base/message_loop.cc:219 #30 0x7f98a66364bc in nsBaseAppShell::Run() widget/xpwidgets/nsBaseAppShell.cpp:163 #31 0x7f98a26cad59 in XREMain::XRE_main(int, char**, nsXREAppData const*) toolkit/xre/nsAppRunner.cpp:3921 #32 0x7f98a26cbbc9 in XRE_main toolkit/xre/nsAppRunner.cpp:4123 #33 0x4282a4 in main browser/app/nsBrowserApp.cpp:272 #34 0x7f98acc8676c in ?? ?? 0x7f98aadc2b90 is located 40 bytes to the right of global variable _ZN7mozilla3dom25SVGTextPositioningElement15sNumberListInfoE (content/svg/content/src/SVGTextPositioningElement.cpp) (0x7f98aadc2b60) of size 8 Shadow bytes around the buggy address: 0x0ff3955b0520: 00 00 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 f9 f9 0x0ff3955b0530: f9 f9 f9 f9 00 00 f9 f9 f9 f9 f9 f9 00 00 00 00 0x0ff3955b0540: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0ff3955b0550: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0ff3955b0560: 00 00 00 00 00 00 00 00 f9 f9 f9 f9 00 f9 f9 f9 =>0x0ff3955b0570: f9 f9[f9]f9 00 00 00 00 00 00 00 00 00 00 00 00 0x0ff3955b0580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0ff3955b0590: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0ff3955b05a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0ff3955b05b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0ff3955b05c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 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 righ 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 ASan internal: fe ==6958==ABORTING

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 SVG. Mozilla made it public on 24 July 2013.

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.