Skip to content
Memory corruption Disclosed report CVE-2014-1592

1410H - Firefox 32,33 xul.dll!nsHtml5TreeOperation use-after-free (poisoned)

SkyLined Follow

Originally disclosed on Mozilla

Critical View original
  • Fixed in 12 days
  • Paid in 17 days
  • Disclosed after 12 days
Text
Created attachment 8511025
repro.html

User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0
Build ID: 20141011015303

Steps to reproduce:

<script>
  window.onload = function() {
    oMenuElement = document.createElement("MENU");
    document.open();
    document.insertBefore(oMenuElement, null);
    document.write("<script></"+"script>\n");
  };
</script>


Actual results:

Access Violation around 0x5a5a5a5a


Expected results:

Synopsis
--------
Firefox can be made to use data from a freed and poisoned object through
specially crafted HTML, resulting in access violations around address
0x5a5a5a5a in x66 systems.

Known affected versions
-----------------------
  + Mozilla Firefox 32 & 33
    (other versions not tested)

Attack vectors
--------------
  * Mozilla Firefox 32 & 33
    
    An attacker would need to get a target user to open a specially crafted
    webpage.

Mitigations
-----------
  * Mozilla Firefox 32 & 33
    
    Disabling JavaScript should prevent an attacker from triggering the
    vulnerable code path.

Description
-----------
The repro causes the nsHtml5TreeOperation's mOne member object to be freed. The
freed memory is not released, but poisoned by filling it with "z" (0x5a). A
pointer to the freed object is kept in mOne and  continues to be used. The repro
causes xul!nsHtml5TreeOperation::Perform to pass the "node" member of mOne to
xul!nsHtml5TreeOperation::AppendText as a pointer to an object, but the pointer
is 0x5a5a5a5a and this will cause an access violation.

http://lxr.mozilla.org/mozilla-central/source/parser/html/nsHtml5TreeOperation.cpp#687

Exploit
-------
I am not sure if this is exploitable, as I am not familiar with the heap
management and mitigations (such as poisoning) of Firefox. I am reporting this
as a security issue in case the poisoning is temporarily and the object can get
released and reused, or in case a heap spray could allocate memory at the
address 0x5a5a5a5a.

The original report as published on Mozilla's Bugzilla, by SkyLined. 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: HTML Parser. Mozilla made it public on 5 November 2014 as CVE-2014-1592.

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 SkyLined

View all

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