Skip to content
Memory corruption Disclosed report

Heap-buffer-overflow in nsBidi::ResolveImplicitLevels

Atte Kettunen Follow

Originally disclosed on Mozilla

Critical View original
  • Fixed in 7 days
  • Paid in 7 days
  • Disclosed after 7 days
Text
Created attachment 8604086
repro-file.html

Tested on:

OS: Ubuntu 14.04

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

ASAN-trace:

=================================================================
==13442==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x604000081184 at pc 0x7f242df1b3f7 bp 0x7ffeceda9350 sp 0x7ffeceda9348
WRITE of size 2 at 0x604000081184 thread T0 (Web Content)
    #0 0x7f242df1b3f6 in nsBidi::ResolveImplicitLevels(int, int, unsigned char, unsigned char) /builds/slave/m-cen-l64-asan-000000000000000/build/src/layout/base/nsBidi.cpp:1271:0
    #1 0x7f242df18cee in nsBidi::SetPara(char16_t const*, int, unsigned char, unsigned char*) /builds/slave/m-cen-l64-asan-000000000000000/build/src/layout/base/nsBidi.cpp:419:0
    #2 0x7f242df21035 in SetPara /builds/slave/m-cen-l64-asan-000000000000000/build/src/layout/base/nsBidiPresUtils.cpp:210:0
    #3 0x7f242df21035 in nsBidiPresUtils::ResolveParagraph(nsBlockFrame*, BidiParagraphData*) /builds/slave/m-cen-l64-asan-000000000000000/build/src/layout/base/nsBidiPresUtils.cpp:702:0
    #4 0x7f242df1d63a in nsBidiPresUtils::Resolve(nsBlockFrame*) /builds/slave/m-cen-l64-asan-000000000000000/build/src/layout/base/nsBidiPresUtils.cpp:686:0
    #5 0x7f242e187874 in ResolveBidi /builds/slave/m-cen-l64-asan-000000000000000/build/src/layout/generic/nsBlockFrame.cpp:7343:0
    #6 0x7f242e187874 in nsBlockFrame::Reflow(nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&) /builds/slave/m-cen-l64-asan-000000000000000/build/src/layout/generic/nsBlockFrame.cpp:1099:0
.
.
.
0x604000081184 is located 4 bytes to the right of 48-byte region [0x604000081150,0x604000081180)
allocated by thread T0 (Web Content) here:
    #0 0x474c01 in __interceptor_malloc _asan_rtl_:0
    #1 0x7f242df188cb in GetMemory /builds/slave/m-cen-l64-asan-000000000000000/build/src/layout/base/nsBidi.cpp:203:0
    #2 0x7f242df188cb in nsBidi::SetPara(char16_t const*, int, unsigned char, unsigned char*) /builds/slave/m-cen-l64-asan-000000000000000/build/src/layout/base/nsBidi.cpp:330:0
    #3 0x7f242df21035 in SetPara /builds/slave/m-cen-l64-asan-000000000000000/build/src/layout/base/nsBidiPresUtils.cpp:210:0
    #4 0x7f242df21035 in nsBidiPresUtils::ResolveParagraph(nsBlockFrame*, BidiParagraphData*) /builds/slave/m-cen-l64-asan-000000000000000/build/src/layout/base/nsBidiPresUtils.cpp:702:0
    #5 0x7f242df2003f in ResolveParagraphWithinBlock /builds/slave/m-cen-l64-asan-000000000000000/build/src/layout/base/nsBidiPresUtils.cpp:1249:0
    #6 0x7f242df2003f in nsBidiPresUtils::TraverseFrames(nsBlockFrame*, nsBlockInFlowLineIterator*, nsIFrame*, BidiParagraphData*) /builds/slave/m-cen-l64-asan-000000000000000/build/src/layout/base/nsBidiPresUtils.cpp:1173:0
.
.
.

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 Layout. Mozilla made it public on 18 May 2015.

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.