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

Heap-buffer-overflow in SVGTextFrame::ResolvePositions

Atte Kettunen Follow

Originally disclosed on Mozilla

Critical View original
  • Fixed in 6 days
  • Paid in 20 days
  • Disclosed after 6 days
Text
Created attachment 8586115
repro-file.svg

Tested on:

OS: Ubuntu 14.04

Firefox: ASAN build from https://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/mozilla-central-linux64-asan/1427796124/


Note:

Repro-file will also crash stable Firefox 36.0.4 on Ubuntu 14.04

Crash report-ID: bp-6e47afc4-a88c-4cf3-a591-0a0552150331

ASAN-trace:

==1594==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x621000e67503 at pc 0x7fdce471f097 bp 0x7fffec35a250 sp 0x7fffec35a248
WRITE of size 1 at 0x621000e67503 thread T0 (Web Content)
    #0 0x7fdce471f096 in SVGTextFrame::ResolvePositions(nsIContent*, unsigned int, bool, bool&, nsTArray<gfxPoint>&) /builds/slave/m-cen-l64-asan-ntly-0000000000/build/src/layout/svg/SVGTextFrame.cpp:4403
    #1 0x7fdce471ee90 in SVGTextFrame::ResolvePositions(nsIContent*, unsigned int, bool, bool&, nsTArray<gfxPoint>&) /builds/slave/m-cen-l64-asan-ntly-0000000000/build/src/layout/svg/SVGTextFrame.cpp:4519
    #2 0x7fdce47203b5 in SVGTextFrame::ResolvePositions(nsTArray<gfxPoint>&, bool) /builds/slave/m-cen-l64-asan-ntly-0000000000/build/src/layout/svg/SVGTextFrame.cpp:4564
    #3 0x7fdce4726769 in SVGTextFrame::DoGlyphPositioning() /builds/slave/m-cen-l64-asan-ntly-0000000000/build/src/layout/svg/SVGTextFrame.cpp:5017
    #4 0x7fdce4715179 in UpdateGlyphPositioning /builds/slave/m-cen-l64-asan-ntly-0000000000/build/src/layout/svg/SVGTextFrame.cpp:5187
    #5 0x7fdce4715179 in SVGTextFrame::ReflowSVG() /builds/slave/m-cen-l64-asan-ntly-0000000000/build/src/layout/svg/SVGTextFrame.cpp:3819
    #6 0x7fdce471759b in nsSVGDisplayContainerFrame::ReflowSVG() /builds/slave/m-cen-l64-asan-ntly-0000000000/build/src/layout/svg/nsSVGContainerFrame.cpp:356
    #7 0x7fdce477cdbe in nsSVGOuterSVGFrame::Reflow(nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&) /builds/slave/m-cen-l64-asan-ntly-0000000000/build/src/layout/svg/nsSVGOuterSVGFrame.cpp:437
.
.
.
0x621000e67503 is located 3 bytes to the right of 4096-byte region [0x621000e66500,0x621000e67500)
allocated by thread T0 (Web Content) here:
    #0 0x474c1b in realloc /builds/slave/moz-toolchain/src/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:95
    #1 0x49213d in moz_xrealloc /builds/slave/m-cen-l64-asan-ntly-0000000000/build/src/memory/mozalloc/mozalloc.cpp:121
    #2 0x7fdcde6d1adf in Realloc /builds/slave/m-cen-l64-asan-ntly-0000000000/build/src/obj-firefox/media/libstagefright/../../dist/include/nsTArray.h:185
    #3 0x7fdcde6d1adf in nsTArray_base<nsTArrayInfallibleAllocator, nsTArray_CopyWithMemutils>::EnsureCapacity(unsigned long, unsigned long) /builds/slave/m-cen-l64-asan-ntly-0000000000/build/src/obj-firefox/media/libstagefright/../../dist/include/nsTArray-inl.h:182
    #4 0x7fdce471fe2a in AppendElement<mozilla::CharPosition> /builds/slave/m-cen-l64-asan-ntly-0000000000/build/src/obj-firefox/layout/svg/../../dist/include/nsTArray.h:1353
    #5 0x7fdce471fe2a in SVGTextFrame::ResolvePositions(nsTArray<gfxPoint>&, bool) /builds/slave/m-cen-l64-asan-ntly-0000000000/build/src/layout/svg/SVGTextFrame.cpp:4555
    #6 0x7fdce4726769 in SVGTextFrame::DoGlyphPositioning() /builds/slave/m-cen-l64-asan-ntly-0000000000/build/src/layout/svg/SVGTextFrame.cpp:5017
    #7 0x7fdce4715179 in UpdateGlyphPositioning /builds/slave/m-cen-l64-asan-ntly-0000000000/build/src/layout/svg/SVGTextFrame.cpp:5187
    #8 0x7fdce4715179 in SVGTextFrame::ReflowSVG() /builds/slave/m-cen-l64-asan-ntly-0000000000/build/src/layout/svg/SVGTextFrame.cpp:3819
.
.
.

The original report as published on Mozilla's Bugzilla, by Atte Kettunen. 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 7 April 2015 as CVE-2015-2710.

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 Atte Kettunen

View all

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