<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6967489162537296891</id><updated>2011-10-31T07:39:38.203+02:00</updated><title type='text'>Roee Hay</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://roeehay.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6967489162537296891/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://roeehay.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Roee Hay</name><uri>http://www.blogger.com/profile/11051524207781515121</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6967489162537296891.post-4564668904937698067</id><published>2011-10-18T23:02:00.001+02:00</published><updated>2011-10-18T23:02:00.797+02:00</updated><title type='text'>DNS poisoning via Port Exhaustion</title><content type='html'>&lt;p&gt;We have just released a very interesting whitepaper which describes a DNS poisoning attack against stub resolvers.&lt;/p&gt;  &lt;p&gt;It discloses two vulnerabilities:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;A vulnerability in &lt;strong&gt;Java&lt;/strong&gt; (CVE-2011-3552, CVE-2010-4448) which enables &lt;em&gt;remote&lt;/em&gt; DNS poisoning using Java applets. This vulnerability can be triggered when opening a malicious webpage. A successful exploitation of this vulnerability may lead to disclosure and manipulation of cookies and web pages, disclosure of NTLM credentials and clipboard data of the logged-on user, and even firewall bypass. &lt;/li&gt;    &lt;li&gt;A vulnerability in multiuser &lt;strong&gt;Windows&lt;/strong&gt; environments which enables &lt;em&gt;local&lt;/em&gt; DNS cache poisoning of arbitrary domains. This&amp;#160; vulnerability can be triggered by a normal user (i.e. one with non-administrative rights) in order to attack other users of the system. A successful exploitation of this vulnerability may lead to information disclosure, privilege escalation, universal XSS and more. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;The whitepaper can be found &lt;a title="DNS poisoning via Port Exhaustion whitepaper" href="http://bit.ly/q31wSq"&gt;here&lt;/a&gt;&lt;strong&gt;&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;A few video demos of our Proof-of-Concept:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Attack: Remote DNS poisoning via Java Applets: Cookie theft.      &lt;br /&gt;Environment: Ubuntu 11.04, Firefox 7.0.1.       &lt;br /&gt;      &lt;br /&gt;&lt;iframe height="315" src="http://www.youtube.com/embed/eSEvFmsw55A?rel=0&amp;amp;hd=1" frameborder="0" width="420"&gt;&lt;/iframe&gt;      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Attack: Remote DNS poisoning via Java Apples: NTLM credentials and Clipboard theft.      &lt;br /&gt;Environment: Windows 2008, Internet Explorer 9.       &lt;br /&gt;      &lt;br /&gt;&lt;iframe height="315" src="http://www.youtube.com/embed/i-Fmk7-pFFA?rel=0&amp;amp;hd=1" frameborder="0" width="420"&gt;&lt;/iframe&gt;&lt;/li&gt;    &lt;li&gt;Attack: Remote DNS poisoning via Java Applets: Firewall bypass.      &lt;br /&gt;Environment: Windows 2008, Firefox 7.0.1.       &lt;br /&gt;      &lt;br /&gt;&lt;iframe height="315" src="http://www.youtube.com/embed/7CFq_pofeBU?rel=0&amp;amp;hd=1" frameborder="0" width="420"&gt;&lt;/iframe&gt;&lt;/li&gt;    &lt;li&gt;Attack: Local DNS poisoning via port exhaustion.      &lt;br /&gt;Environment: Windows 2008.       &lt;br /&gt;      &lt;br /&gt;&lt;iframe height="315" src="http://www.youtube.com/embed/m2GkLL9d68E?rel=0&amp;amp;hd=1" frameborder="0" width="420"&gt;&lt;/iframe&gt;&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;We would like to thank Oracle and Microsoft for their cooperation.&lt;/p&gt;  &lt;p&gt;-Roee Hay and Yair Amit&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6967489162537296891-4564668904937698067?l=roeehay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://roeehay.blogspot.com/feeds/4564668904937698067/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6967489162537296891&amp;postID=4564668904937698067' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6967489162537296891/posts/default/4564668904937698067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6967489162537296891/posts/default/4564668904937698067'/><link rel='alternate' type='text/html' href='http://roeehay.blogspot.com/2011/10/dns-poisoning-via-port-exhaustion.html' title='DNS poisoning via Port Exhaustion'/><author><name>Roee Hay</name><uri>http://www.blogger.com/profile/11051524207781515121</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/eSEvFmsw55A/default.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6967489162537296891.post-7027173380522299366</id><published>2011-08-04T11:45:00.002+03:00</published><updated>2011-08-04T11:47:36.016+03:00</updated><title type='text'>Android Browser Cross-Application Scripting (CVE-2011-2357)</title><content type='html'>Recently Yair Amit and I have discovered a Cross-Application Scripting vulnerability in Android’s Browser, which allows malicious applications to bypass Android’s sandboxing model, in order to inject JavaScript code into an arbitrary domain.&lt;br /&gt;Full details can be obtained from the following sources:   &lt;br /&gt;1. &lt;a href="http://blog.watchfire.com/wfblog/2011/08/android-browser-cross-application-scripting-cve-2011-2357.html"&gt;Blog post&lt;/a&gt;    &lt;br /&gt;2. &lt;a href="http://blog.watchfire.com/files/advisory-android-browser.pdf"&gt;Advisory&lt;/a&gt;    &lt;br /&gt;3. Demo of PoC:&lt;br /&gt;&lt;div class="wlWriterEditableSmartContent" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:1101823e-7d7a-4761-9fe5-bd7e9c315d00" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;div id="66a9cac7-0d3e-4557-9812-879c1ddd1359" style="display: inline; margin: 0px; padding: 0px;"&gt;&lt;div&gt;&lt;a href="http://www.youtube.com/watch?v=BzUpbcrWufs&amp;amp;feature=player_embedded" target="_new"&gt;&lt;img alt="" galleryimg="no" onload="var downlevelDiv = document.getElementById('66a9cac7-0d3e-4557-9812-879c1ddd1359'); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;448\&amp;quot; height=\&amp;quot;252\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/BzUpbcrWufs?hl=en&amp;amp;hd=1\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/BzUpbcrWufs?hl=en&amp;amp;hd=1\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;448\&amp;quot; height=\&amp;quot;252\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;" src="http://lh5.ggpht.com/-IAnZ2b7DECA/TjpcLc5FbYI/AAAAAAAAAyA/8hqAys1nO-s/video5512d103fdc7%25255B12%25255D.jpg?imgmax=800" style="border-style: none;" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="clear: both; font-size: .8em; width: 448px;"&gt;Android Browser CAS (CVE-2011-2357)&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6967489162537296891-7027173380522299366?l=roeehay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://roeehay.blogspot.com/feeds/7027173380522299366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6967489162537296891&amp;postID=7027173380522299366' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6967489162537296891/posts/default/7027173380522299366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6967489162537296891/posts/default/7027173380522299366'/><link rel='alternate' type='text/html' href='http://roeehay.blogspot.com/2011/08/android-browser-cross-application.html' title='Android Browser Cross-Application Scripting (CVE-2011-2357)'/><author><name>Roee Hay</name><uri>http://www.blogger.com/profile/11051524207781515121</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-IAnZ2b7DECA/TjpcLc5FbYI/AAAAAAAAAyA/8hqAys1nO-s/s72-c/video5512d103fdc7%25255B12%25255D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6967489162537296891.post-3606112115447243513</id><published>2010-11-10T19:31:00.000+02:00</published><updated>2010-11-10T19:31:48.323+02:00</updated><title type='text'>Babylon Cross-Application Scripting Code Execution</title><content type='html'>Recently Yair Amit and I have discovered a Cross-Application Scripting vulnerability in Babylon which could lead to code execution.&lt;br /&gt;&lt;br /&gt;Full details can be obtained from the following references:&lt;br /&gt;1. &lt;a href="http://blog.watchfire.com/wfblog/2010/11/babylon-cross-application-scripting.html"&gt;Blog post&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://blog.watchfire.com/files/babylon_cas_advisory.pdf"&gt;Advisory&lt;/a&gt;&lt;br /&gt;3. Proof of concept:&lt;br /&gt;&lt;object height="385" width="480"&gt;&lt;param name="movie" value="http://www.youtube.com/v/51ypgI1lqzE?fs=1&amp;amp;hl=en_US"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/51ypgI1lqzE?fs=1&amp;amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;-Roee&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6967489162537296891-3606112115447243513?l=roeehay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://roeehay.blogspot.com/feeds/3606112115447243513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6967489162537296891&amp;postID=3606112115447243513' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6967489162537296891/posts/default/3606112115447243513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6967489162537296891/posts/default/3606112115447243513'/><link rel='alternate' type='text/html' href='http://roeehay.blogspot.com/2010/11/babylon-cross-application-scripting.html' title='Babylon Cross-Application Scripting Code Execution'/><author><name>Roee Hay</name><uri>http://www.blogger.com/profile/11051524207781515121</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6967489162537296891.post-606389308639066766</id><published>2009-08-03T21:12:00.001+03:00</published><updated>2009-08-03T21:12:15.399+03:00</updated><title type='text'>Exploitation of CVE-2009-1869</title><content type='html'>&lt;p&gt;During the research of the Flash vulnerability I’ve managed to create a functional PoC.    &lt;br /&gt;    &lt;br /&gt;The process of the exploit is the following:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Spray the heap in order to achieve the following:&lt;/li&gt;    &lt;ol&gt;     &lt;li&gt;The aforementioned path conditions would pass.&lt;/li&gt;      &lt;li&gt;A DWORD memory overwrite with user controlled target and value would take place when the vulnerability is triggered.&lt;/li&gt;      &lt;li&gt;Allocate a placeholder for the shellcode. The target of the memory overwrite would be some function pointer, the value would be the location of the shellcode’s placeholder. &lt;/li&gt;   &lt;/ol&gt;    &lt;li&gt;Trigger the vulnerability.&lt;/li&gt;    &lt;li&gt;Free the placeholder of the shellcode. &lt;/li&gt;    &lt;li&gt;Allocate the shellcode by spraying the heap.&lt;/li&gt;    &lt;li&gt;Trigger some function which calls the function pointer. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;The reason that there are 2 passes for allocating the shellcode is the fact that after the arbitrary overwrite occurs, some random chunks are also written to the location of the shellcode, hence the block has to be freed and re-allocated.&lt;/p&gt;  &lt;p&gt;The exploit contains the following components:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;     &lt;div&gt;&lt;strong&gt;Exploit.fla/as – &lt;/strong&gt;main code&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div&gt;&lt;strong&gt;HeapLib.as – &lt;/strong&gt;ActionScript3 Heap Spraying library        &lt;br /&gt;The Heap Spraying library bypasses the ActionScript’s maximum execution time limitation by using a Timer that allocates small chunks at each iteration.        &lt;br /&gt;It provides two basics functions:         &lt;br /&gt;1) &lt;font face="Consolas"&gt;alloc(value, size)          &lt;br /&gt;&lt;/font&gt;2) &lt;font face="Consolas"&gt;free()&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div&gt;&lt;strong&gt;TriggerVuln.swf &lt;/strong&gt;-&lt;strong&gt;&amp;#160; &lt;/strong&gt;malformed SWF which triggers the vulnerability (i.e: intf_count=0)&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div&gt;&lt;strong&gt;TriggerFunc.fla – &lt;/strong&gt;ActionScript2 code which triggers a call to the function pointer by invoking &lt;a href="http://www.adobe.com/actionscript_dictionary435.html"&gt;&lt;font color="#000000" face="Consolas"&gt;LoadVars.sendAndLoad&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div&gt;&lt;strong&gt;Exploit.htm – &lt;/strong&gt;HTML wrapper for the Exploit.as        &lt;br /&gt;&lt;/div&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;The exploit has been tested against Windows XP SP3 with IE7. Flash is assumed to be loaded at VA 0x10000000. However, since the vulnerable code is wrapped by a permissive SEH handler, brute-force is possible (not covered by the PoC).&lt;/p&gt;  &lt;p&gt;The binaries and source code of the PoC can be found &lt;a href="http://code.google.com/p/roeehay"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6967489162537296891-606389308639066766?l=roeehay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://roeehay.blogspot.com/feeds/606389308639066766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6967489162537296891&amp;postID=606389308639066766' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6967489162537296891/posts/default/606389308639066766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6967489162537296891/posts/default/606389308639066766'/><link rel='alternate' type='text/html' href='http://roeehay.blogspot.com/2009/08/exploitation-of-cve-2009-1869.html' title='Exploitation of CVE-2009-1869'/><author><name>Roee Hay</name><uri>http://www.blogger.com/profile/11051524207781515121</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6967489162537296891.post-1230005197148097762</id><published>2009-08-02T04:30:00.002+03:00</published><updated>2009-08-05T11:03:09.905+03:00</updated><title type='text'>Advisory: Adobe Flash Player and AIR AVM2 intf_count Integer Overflow</title><content type='html'>&lt;p&gt;&lt;u&gt;&lt;strong&gt;       &lt;br /&gt;&lt;font size="2"&gt;Background          &lt;br /&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/u&gt;    &lt;br /&gt;&lt;font size="3"&gt;ActionScript code is compiled into ActionScript Byte Code segments, loaded by AVM2 (ActionScript Virtual Machine 2).      &lt;br /&gt;These segments are described by the abcFile structure: &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; abcFile      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; u16 minor_version       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; u16 major_version       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; cpool_info constant_pool       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; u30 method_count       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; method_info method[method_count]       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; u30 metadata_count       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; metadata_info metadata[metadata_count]       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; u30 class_count       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; instance_info instance[class_count]       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; class_info class[class_count]       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; u30 script_count       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; script_info script[script_count]       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; u30 method_body_count       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; method_body_info method_body[method_body_count]       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&lt;/font&gt;    &lt;br /&gt;The value of &lt;em&gt;&lt;strong&gt;class_count&lt;/strong&gt;&lt;/em&gt; element is the number of entries in the &lt;em&gt;&lt;strong&gt;instance&lt;/strong&gt;&lt;/em&gt; and &lt;em&gt;&lt;strong&gt;class&lt;/strong&gt;&lt;/em&gt; arrays. Each instance entry is a variable length &lt;em&gt;&lt;strong&gt;instance_info&lt;/strong&gt;&lt;/em&gt; structure which specifies the characteristics of object instances created by a particular class: &lt;/p&gt;  &lt;p&gt;&lt;font face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; instance_info      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; u30 name       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; u30 super_name       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; u8 flags       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; u30 protectedNs       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; u30 intrf_count       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; u30 interface[intrf_count]       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; u30 iinit       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; u30 trait_count       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; traits_info trait[trait_count]       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/p&gt; &lt;font face="Consolas"&gt;&lt;/font&gt;  &lt;p align="justify"&gt;The value of the &lt;strong&gt;&lt;em&gt;intrf_count&lt;/em&gt;&lt;/strong&gt; field is the number of entries in the interface array. The interface array contains indices into the multiname array of the constant pool; the referenced names specify the interfaces implemented by this class. &lt;/p&gt;  &lt;p align="justify"&gt;&lt;strong&gt;&lt;u&gt;&lt;font size="2"&gt;Vulnerability &lt;/font&gt;        &lt;br /&gt;&lt;/u&gt;&lt;/strong&gt;&lt;strong&gt;&lt;u&gt;       &lt;br /&gt;&lt;/u&gt;&lt;/strong&gt;An integer overflow exists in the AVM2 abcFile parser code which handles the &lt;strong&gt;&lt;em&gt;intrf_count&lt;/em&gt;&lt;/strong&gt; value of the instance_info structure. &lt;/p&gt;  &lt;p&gt;When &lt;strong&gt;intrf_count&lt;/strong&gt; is larger than 0x10000000, it is nullified due to an integer overflow. This results in an out of bounds pointer dereference. The out of bounds object contains arbitrary values (in the context of the code which handles the interfaces count element) which are manipulated in a way so that an arbitrary memory overwrite with an attacker supplied destination and value is possible. &lt;/p&gt;  &lt;p&gt;The following is a detailed run trace which explains the vulnerability. Irrelevant instructions are omitted. Flash10b.ocx is assumed to be loaded at VA 10000000h. &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; let &amp;lt;intrf_count&amp;gt; be 0x10000000 &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color="#800000" size="2" face="Consolas"&gt;.text:10206B03&amp;#160; mov&amp;#160; edi, [esp+50h+var_2C]        &lt;br /&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font color="#008000"&gt;; EDI=&amp;lt;intrf_count&amp;gt;=0x10000000          &lt;br /&gt;&lt;/font&gt;&lt;font color="#800000"&gt;.text:10206B14&amp;#160; lea&amp;#160; edx, [edi+edi]          &lt;br /&gt;&lt;/font&gt;&lt;font color="#008000"&gt;; EDX=&amp;lt;intrf_count*2&amp;gt;=0x20000000, m&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font color="#008000"&gt;ay not overflow (verified elsewhere)&lt;/font&gt;&amp;#160; &lt;br /&gt;&lt;font color="#800000"&gt;.text:10206B1B&amp;#160; call&amp;#160; sub_101EAC30&amp;#160; &lt;br /&gt;.text:101EAC45&amp;#160; call&amp;#160; sub_101EAB90&lt;/font&gt;&amp;#160; &lt;br /&gt;&lt;font color="#800000"&gt;.text:101EAB98&amp;#160; call&amp;#160; sub_101D1FF0          &lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#008000"&gt;&lt;font size="2" face="Consolas"&gt;; this method calculates the nearest p&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;ower of 2 for &amp;lt;intrf_count*2&amp;gt;&amp;#160; (i.e: &lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font color="#008000"&gt;stays 0x20000000)&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#800000"&gt;.text:101EABA0&amp;#160; add&amp;#160; eax, eax          &lt;br /&gt;&lt;/font&gt;&lt;font color="#008000"&gt;; doubles that value (i.e: EAX=0x40000000)&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#800000"&gt;.text:101EABCC&amp;#160; lea&amp;#160; ecx, ds:0[eax*4]          &lt;br /&gt;&lt;/font&gt;&lt;font color="#008000"&gt;; multiplies it by 4 (i.e: ECX=0x00000000) &lt;strong&gt;=&amp;gt;OVERFLOW&amp;lt;=&lt;/strong&gt;           &lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font color="#800000"&gt;.text:101EABDA&amp;#160; call&amp;#160; sub_10224C62&amp;#160; &lt;br /&gt;.text:10224C62&amp;#160; jmp&amp;#160;&amp;#160; sub_10224363&amp;#160; &lt;br /&gt;.text:10224363&amp;#160; mov&amp;#160;&amp;#160; edx, [esp+arg_0]           &lt;br /&gt;&lt;/font&gt;&lt;font color="#800000"&gt;&lt;font color="#008000"&gt;; arg_0 is the overflown value (i.e: EDX=00000000) &lt;/font&gt;          &lt;br /&gt;.text:10224367&amp;#160; lea&amp;#160;&amp;#160;&amp;#160;&amp;#160; eax, [edx+7]           &lt;br /&gt;&lt;/font&gt;&lt;font color="#800000"&gt;.text:10224376&amp;#160; and&amp;#160;&amp;#160;&amp;#160;&amp;#160; eax, 0FFFFFFF8h &lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font color="#008000"&gt;; EAX=00000000&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#800000"&gt;.text:1022437A&amp;#160; mov&amp;#160;&amp;#160;&amp;#160;&amp;#160; esi, eax &lt;/font&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#008000"&gt;; ESI=00000000&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#800000"&gt;.text:102243A4&amp;#160; mov&amp;#160;&amp;#160;&amp;#160;&amp;#160; ecx, esi&amp;#160;&amp;#160; &lt;/font&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#008000"&gt;; ECX=00000000&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#800000"&gt;.text:102243A9&amp;#160; mov&amp;#160;&amp;#160;&amp;#160;&amp;#160; eax, [eax+ecx*4-4]          &lt;br /&gt;&lt;/font&gt;&lt;font color="#008000"&gt;; the overflown value is used as an index into pointer table, starting at EAX.          &lt;br /&gt;; since we can cause ECX to become 0x0000000, we may select an out of bounds           &lt;br /&gt;; pointer (eax-4). Tests show that it always contains a valid pointer to some           &lt;br /&gt;; object, with arbitrary values. i.e: EAX=&amp;amp;OutOfBoundsObject           &lt;br /&gt;&lt;/font&gt;&lt;font color="#800000"&gt;.text:102243AD&amp;#160; mov&amp;#160;&amp;#160;&amp;#160;&amp;#160; ecx, eax&lt;/font&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#008000"&gt;; ECX=&amp;amp;OutOfBoundsObject&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#800000"&gt;.text:102243C8&amp;#160; call&amp;#160;&amp;#160;&amp;#160; sub_10226D4D          &lt;br /&gt;.text:10226D53&amp;#160; mov&amp;#160;&amp;#160;&amp;#160;&amp;#160; ebx, ecx&amp;#160; &lt;/font&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#008000"&gt;; EBX=&amp;amp;OutOfBoundsObject          &lt;br /&gt;&lt;/font&gt;&lt;font color="#800000"&gt;.text:10226D6C&amp;#160; mov&amp;#160;&amp;#160;&amp;#160;&amp;#160; esi, [ebx+8] &lt;/font&gt;&amp;#160;&amp;#160; &lt;br /&gt;&lt;font color="#008000"&gt;; ESI=&amp;amp;ArbitraryObjectA (usually: 0x55555555) &lt;/font&gt;        &lt;br /&gt;&lt;font color="#800000"&gt;.text:10226D76&amp;#160; test&amp;#160;&amp;#160;&amp;#160; byte ptr [esi+2Ah], 1          &lt;br /&gt;&lt;/font&gt;&lt;font color="#008000"&gt;; &amp;lt;PathConditionA &amp;gt;- must pass this in order to continue          &lt;br /&gt;&lt;/font&gt;&lt;font color="#800000"&gt;.text:10226D7A&amp;#160; jz&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; short loc_10226DA5 &lt;/font&gt;        &lt;br /&gt;&lt;font color="#800000"&gt;.text:10226D7C&amp;#160; mov&amp;#160;&amp;#160;&amp;#160;&amp;#160; eax, [ebx+38h]          &lt;br /&gt;&lt;/font&gt;&lt;font color="#008000"&gt;; EAX=&amp;amp;ArbitraryObjectB, (usually 0x55555557)&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#800000"&gt;.text:10226D7F&amp;#160; cmp&amp;#160;&amp;#160;&amp;#160;&amp;#160; byte ptr [eax+33Ch], 0          &lt;br /&gt;&lt;/font&gt;&lt;font color="#008000"&gt;; &amp;lt;PathConditionB&amp;gt; - must pass this in order to continue &lt;/font&gt;        &lt;br /&gt;&lt;font color="#800000"&gt;.text:10226D86&amp;#160; mov&amp;#160;&amp;#160;&amp;#160;&amp;#160; ecx, ebx &lt;/font&gt;&lt;font color="#008000"&gt;; ECX=&amp;amp;OutOfBoundsObject          &lt;br /&gt;&lt;/font&gt;&lt;font color="#800000"&gt;.text:10226D88&amp;#160; jnz&amp;#160;&amp;#160;&amp;#160;&amp;#160; short loc_10226D9D &lt;/font&gt;        &lt;br /&gt;&lt;font color="#800000"&gt;.text:10226D8A&amp;#160; push&amp;#160;&amp;#160;&amp;#160; esi          &lt;br /&gt;.text:10226D8B&amp;#160; call&amp;#160;&amp;#160;&amp;#160; sub_10226CAF&lt;/font&gt;         &lt;br /&gt;&lt;font color="#800000"&gt;.text:10226CB0&amp;#160; mov&amp;#160;&amp;#160;&amp;#160;&amp;#160; esi, [esp+4+arg_0]          &lt;br /&gt;&lt;/font&gt;&lt;font color="#008000"&gt;; ESI=&amp;amp;ArbitraryObjectA, (usually 0x55555555)          &lt;br /&gt;&lt;/font&gt;&lt;font color="#800000"&gt;.text:10226CB5&amp;#160; push&amp;#160;&amp;#160;&amp;#160; esi &lt;/font&gt;        &lt;br /&gt;&lt;font color="#800000"&gt;.text:10226CB6&amp;#160; mov&amp;#160;&amp;#160;&amp;#160;&amp;#160; edi, ecx &lt;/font&gt;&lt;font color="#008000"&gt;; EDI=&amp;amp;OutOfBoundsObject          &lt;br /&gt;&lt;/font&gt;&lt;font color="#800000"&gt;.text:10226CB8&amp;#160; call&amp;#160;&amp;#160;&amp;#160; sub_102266CA &lt;/font&gt;        &lt;br /&gt;&lt;font color="#800000"&gt;.text:102266CA&amp;#160; mov&amp;#160;&amp;#160;&amp;#160;&amp;#160; eax, [esp+arg_0]          &lt;br /&gt;&lt;/font&gt;&lt;font color="#008000"&gt;; EAX=ESI=&amp;amp;ArbitraryObjectA (usually 0x55555555) &lt;/font&gt;        &lt;br /&gt;&lt;font color="#800000"&gt;.text:102266DB&amp;#160; mov&amp;#160;&amp;#160;&amp;#160;&amp;#160; ecx, [eax+1Ch]          &lt;br /&gt;&lt;/font&gt;&lt;font color="#008000"&gt;; ECX=arbitrary value&amp;#160; - usually *(0x55555571)          &lt;br /&gt;&lt;/font&gt;&lt;font color="#800000"&gt;.text:102266CE&amp;#160; mov&amp;#160;&amp;#160;&amp;#160;&amp;#160; edx, [eax+20h]          &lt;br /&gt;&lt;/font&gt;&lt;font color="#008000"&gt;; EDX=arbitrary value&amp;#160; - usually *(0x55555575) &lt;/font&gt;        &lt;br /&gt;&lt;font color="#800000"&gt;.text:102266DE&amp;#160; mov&amp;#160;&amp;#160;&amp;#160;&amp;#160; [ecx+20h], edx;          &lt;br /&gt;&lt;/font&gt;&lt;font color="#008000"&gt;; jackpot - a write of an arbitrary DWORD to an arbitrary VA &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The following is an illustration of the pointer table and the out of bounds pointer which may be dereferenced: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160; addr&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; val        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 0017487C&amp;#160; 00E82000 &amp;lt;- EAX-4 (ECX=0)         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 00174880&amp;#160; 001681C8 &amp;lt;- EAX&amp;#160;&amp;#160; (ECX=1)         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 00174884&amp;#160; 00174AC8         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 00174888&amp;#160; 00174BD0         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 0017488C&amp;#160; 00174CD8         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 00174890&amp;#160; 00174DE0         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 00174894&amp;#160; 00174EE8         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 00174898&amp;#160; 00174FF0         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 0017489C&amp;#160; 001750F8         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 001748A0&amp;#160; 00175200         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 001748A4&amp;#160; 00175308         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 001748A8&amp;#160; 00175410         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 001748AC&amp;#160; 00175518         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 001748B0&amp;#160; 00175620         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 001748B4&amp;#160; 00175728         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 001748B8&amp;#160; 00175830         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 001748BC&amp;#160; 00175938         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 001748C0&amp;#160; 00175A40         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 001748C4&amp;#160; 00175B48         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 001748C8&amp;#160; 00175C50         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 001748CC&amp;#160; 00175D58&lt;/font&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; The following is a memory dump of the out of bounds object: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font size="2" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160; 00E82000&amp;#160; 44 51 55 55 55 45 55 75 55 55 55 55 55 55 55 55&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 00E82010&amp;#160; 55 55 55 55 55 55 55 54 55 55 55 55 01 00 00 00&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 00E82020&amp;#160; 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 00E82030&amp;#160; 55 55 55 55 D5 55 55 55 57 55 55 55 55 55 55 55&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 00E82040&amp;#160; D5 5A 55 55 54 55 55 55 55 55 55 55 75 B5 56 55&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 00E82050&amp;#160; 55 55 55 55 15 55 55 D5 55 55 AD 55 77 D5 55 55&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 00E82060&amp;#160; 55 55 55 55 D5 D5 BA 56 55 55 55 55 55 55 6B 55&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 00E82070&amp;#160; B5 56 55 55 57 55 55 01 00 00 00 00 00 00 00 00&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 00E82080&amp;#160; 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 00E82090&amp;#160; 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 00E820A0&amp;#160; 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 00E820B0&amp;#160; 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 00E820C0&amp;#160; 00 00 00 00 00 00 00 00 00 00&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; To make things more clear: &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; Let &lt;strong&gt;'ArbitraryObjectA'&lt;/strong&gt; be pointed by (&amp;amp;&lt;strong&gt;OutOfBoundsObject&lt;/strong&gt;+0x8)     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Let &lt;strong&gt;'ArbitraryObjectB'&lt;/strong&gt; be pointed by (&amp;amp;&lt;strong&gt;OutOfBoundsObject&lt;/strong&gt;+0x38) &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; In order to reach the arbitrary overwrite, there are three conditions &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; 1)&amp;#160; &lt;strong&gt;intrf_count&lt;/strong&gt; &amp;gt;= 0x10000000 // in order to overflow     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 2)&amp;#160; &lt;strong&gt;PathConditionA&lt;/strong&gt;: ((char *)ArbitraryObjectA)[0x2e]&amp;#160; == 1&amp;#160; //&amp;#160; .text:10226D76     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; 3)&amp;#160; &lt;strong&gt;PathConditionB&lt;/strong&gt;: ((char *)ArbitraryObjectB)[0x33c] == 0&amp;#160; //&amp;#160; .text:10226D7F &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; Given the conditions are passed, a memory DWORD overwrite of arbitrary target and value occurs: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; &lt;font face="Consolas"&gt;*(DWORD *)((*(DWORD *)(ArbitraryObjectA+0x1c))+0x20) = *(DWORD *)(ArbitraryObjectA+0x20)&lt;/font&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;       &lt;br /&gt;&lt;font size="2"&gt;Exploitation          &lt;br /&gt;&lt;/font&gt;        &lt;br /&gt;&lt;/u&gt;&lt;/strong&gt;Since the out of bounds object contains arbitrary values, the attacker may spray the heap so he/she would have control over &lt;em&gt;ArbitraryObjectA&lt;/em&gt; and &lt;em&gt;ArbitraryObjectB&lt;/em&gt; (they would be located at addresses which contain data controlled by the attacker). This may allow him/her to pass all aforementioned conditions and also control the value which is written&amp;#160; in the arbitrary memory MOV and the target of it. Achieving this may allow him the execute arbitrary code.     &lt;br /&gt;    &lt;br /&gt;During the research of this vulnerability I’ve managed to create a functional exploit (demo: &lt;a href="http://www.youtube.com/watch?v=wJb6a-J3i4c"&gt;http://www.youtube.com/watch?v=wJb6a-J3i4c&lt;/a&gt;).&lt;/p&gt; It should also be denoted that the vulnerable code is wrapped by an SEH handler which doesn't crash the application on Access Violation. This means that the exploitation process may try different base addresses and offsets in case of a failure.   &lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;font size="2"&gt;Attack vector&lt;/font&gt;         &lt;br /&gt;&lt;/u&gt;&lt;/strong&gt;    &lt;br /&gt;Lure the victim to open a malicious SWF file&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;font size="2"&gt;Impact &lt;/font&gt;        &lt;br /&gt;&lt;/u&gt;&lt;/strong&gt;    &lt;br /&gt;Remote Code Execution&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;font size="2"&gt;Test Environment&lt;/font&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Adobe Flash Player 10.0.22.87 &lt;/li&gt;    &lt;li&gt;Windows XP SP3. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;/u&gt;&lt;/strong&gt;&lt;strong&gt;&lt;u&gt;&lt;font size="2"&gt;Identifiers&lt;/font&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;1&lt;em&gt;. CVE-ID&lt;/em&gt;: &lt;a href="http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2009-1869"&gt;CVE-2009-1869&lt;/a&gt;     &lt;br /&gt;2. BID: &lt;a href="http://www.securityfocus.com/bid/35907"&gt;35907&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;&lt;u&gt;Remediation          &lt;br /&gt;          &lt;br /&gt;&lt;/u&gt;&lt;/strong&gt;New versions of Adobe Flash Player (10.0.32.18) and AIR (1.5.2) have been released in order to address this vulnerability.       &lt;br /&gt;&lt;/font&gt;    &lt;br /&gt;&lt;font size="2"&gt;&lt;strong&gt;&lt;u&gt;References&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;a href="(http://www.adobe.com/devnet/actionscript/articles/avm2overview.pdf"&gt;&amp;quot;ActionScript Virtual Machine 2 (AVM2) Overview&amp;quot;&lt;/a&gt;, Adobe Systems, Inc. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.adobe.com/support/security/bulletins/apsb09-10.html"&gt;Adobe’s advisory&lt;/a&gt; &lt;/li&gt; &lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6967489162537296891-1230005197148097762?l=roeehay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://roeehay.blogspot.com/feeds/1230005197148097762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6967489162537296891&amp;postID=1230005197148097762' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6967489162537296891/posts/default/1230005197148097762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6967489162537296891/posts/default/1230005197148097762'/><link rel='alternate' type='text/html' href='http://roeehay.blogspot.com/2009/08/advisory-adobe-flash-player-avm2.html' title='Advisory: Adobe Flash Player and AIR AVM2 intf_count Integer Overflow'/><author><name>Roee Hay</name><uri>http://www.blogger.com/profile/11051524207781515121</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6967489162537296891.post-7265720038483398737</id><published>2009-07-31T02:38:00.001+03:00</published><updated>2009-08-02T05:01:38.708+03:00</updated><title type='text'>Adobe Flash Player Integer Overflow Remote Code Execution</title><content type='html'>&lt;p&gt;Adobe has just released a new version of Flash Player (10.0.32.18).&lt;/p&gt;  &lt;p&gt;This update addresses a &lt;strong&gt;Remote Code Execution&lt;u&gt;&amp;#160;&lt;/u&gt;&lt;/strong&gt;vulnerability (CVE-2009-1869) I reported to Adobe a month ago.     &lt;br /&gt;    &lt;br /&gt;I would like to thank Adobe for the efficient way in which they handled this security issue.&lt;/p&gt;  &lt;p&gt;A full advisory will be posted on Sunday. In the meanwhile, I’ve uploaded a video which demonstrates a successful exploitation of this vulnerability:&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:73585c84-4d27-429f-a758-b933ec021bb2" class="wlWriterEditableSmartContent"&gt;&lt;div id="df10ab69-11ce-4afd-928e-354041abf9b0" style="margin: 0px; padding: 0px; display: inline;"&gt;&lt;div&gt;&lt;a href="http://www.youtube.com/watch?v=wJb6a-J3i4c" target="_new"&gt;&lt;img src="http://lh5.ggpht.com/_3k30ILKeTWA/SnTzgF2Ut-I/AAAAAAAAAKM/9LARu5EMAEY/video8f6162e2e588%5B2%5D.jpg?imgmax=800" style="border-style: none" galleryimg="no" onload="var downlevelDiv = document.getElementById('df10ab69-11ce-4afd-928e-354041abf9b0'); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/wJb6a-J3i4c&amp;amp;hl=en\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/wJb6a-J3i4c&amp;amp;hl=en\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;" alt=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6967489162537296891-7265720038483398737?l=roeehay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://roeehay.blogspot.com/feeds/7265720038483398737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6967489162537296891&amp;postID=7265720038483398737' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6967489162537296891/posts/default/7265720038483398737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6967489162537296891/posts/default/7265720038483398737'/><link rel='alternate' type='text/html' href='http://roeehay.blogspot.com/2009/07/adobe-flash-player-integer-overflow.html' title='Adobe Flash Player Integer Overflow Remote Code Execution'/><author><name>Roee Hay</name><uri>http://www.blogger.com/profile/11051524207781515121</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_3k30ILKeTWA/SnTzgF2Ut-I/AAAAAAAAAKM/9LARu5EMAEY/s72-c/video8f6162e2e588%5B2%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6967489162537296891.post-6446556846712129399</id><published>2009-06-02T10:26:00.004+03:00</published><updated>2009-06-03T21:04:48.908+03:00</updated><title type='text'>Apple QuickTime Image Description Atom Sign Extension Memory Corruption</title><content type='html'>&lt;p&gt;Apple has just released a new version of QuickTime. This version includes a fix to a vulnerability I reported to them back in March. &lt;br&gt;&lt;br&gt;I would like to thank Apple for the efficient way in which they handled this security issue.&lt;/p&gt; &lt;p&gt;The following is the advisory.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;INTRODUCTION &lt;br&gt;&lt;/strong&gt;According to QuickTime's specification, The sample description atom (STSD) stores information that allows QuickTime to decode samples in the media. &lt;/p&gt; &lt;p&gt;It has the following structure: &lt;br&gt;&lt;br&gt;&lt;/p&gt; &lt;p class="csharpcode"&gt;&lt;pre class="alt"&gt; 0  DWORD   Size&lt;br&gt; 4  DWORD   Type&lt;br&gt; 8  BYTE    Version&lt;br&gt; 9  BYTE[3] FLAGS&lt;br&gt; 12  DWORD   Number of entries&lt;br&gt; 16  DWORD   Sample description table &lt;br&gt;&lt;/pre&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The structure of each entry in the sample description table varies by the media type, however the first four fields are the same for all media types: &lt;/p&gt;&lt;br /&gt;&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt; 0  DWORD   Sample description size&lt;br&gt; 4  DWORD   Data format&lt;br&gt; 6  BYTE[6] Reserved &lt;br&gt;12  WORD    Data reference index &lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;These four fields may be followed by additional data specific to the media type and data format. &lt;br&gt;For video media, the general sample description format is extended by the following structure: &lt;/p&gt;&lt;br&gt;&lt;br /&gt;&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;14 WORD     Version&lt;br&gt;16 WORD     Revision level&lt;br&gt;18 DWORD    Vendor&lt;br&gt;22 DWORD    Temporal quality&lt;br&gt;26 DWORD    Spatial quality&lt;br&gt;30 WORD     Width&lt;br&gt;32 WORD     Height&lt;br&gt;34 DWORD    Horizontal resolution&lt;br&gt;38 DWORD    Vertical resolution&lt;br&gt;42 DWORD    Data size&lt;br&gt;46 WORD     Frame count&lt;br&gt;48 BYTE[32] Compressor name&lt;br&gt;80 WORD     Depth&lt;br&gt;82 WORD     Color table ID &lt;br&gt;&lt;font face="Verdana"&gt;&lt;strong&gt;&lt;br&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;font face="Verdana"&gt;&lt;strong&gt;VULNERABILITY DETAILS&lt;br&gt;&lt;/strong&gt;&lt;/font&gt;&lt;font face="Verdana"&gt;When the data format field (offset 4 of the sample description table extension) is 'RPZA' (Apple Video), i&lt;/font&gt;&lt;font face="Verdana"&gt;t is possible to trigger a sign extension vulnerability which leads to a buffer underflow.&lt;/font&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;The following is the faulty sign extended MOV:&amp;nbsp; &lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; MOVSX ECX,WORD PTR SS:[ESP+4C] &lt;/p&gt;&lt;br /&gt;&lt;p&gt;[ESP+4C] contains a user controlled input, which is equal to &lt;br&gt;"((width+(4-width%4))*4 &amp;amp; 0xFFFF" where 'width' is taken from the RPZA sample description entry (offset 30). &lt;br&gt;&lt;br&gt;If width &amp;gt;= 0x5FFD, then [ESP+4C] &amp;gt;= 0x8000. &lt;br&gt;Sign-extending such values results in very large unsigned values, as their most significant word becomes 0xFFFF (so 0x8000 is sign-extended to 0xFFFF8000). &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Deeper in the code, the user controllable sign-extended value is treated as the size of a structure. &lt;br&gt;&lt;br&gt;A vector of this structure is walked over: &lt;/p&gt;&lt;br /&gt;&lt;p&gt;[1] At each iteration the base pointer is incremented by the user's controlled sign-extended value. This means that it is possible to force the pointer to reference memory regions below the vector's VA: &lt;/p&gt;&lt;br /&gt;&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;   ADD EAX,EDX ; EAX = vector, EDX = sign extended value&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;[2] At each iteration values are written to an element in the vector (a single structure) which is referenced by the incremented pointer. This means that it is possible to write to memory regions below the buffer's VA. &lt;br&gt;&lt;/p&gt;&lt;br /&gt;&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;   MOV DWORD PTR DS:[EAX],EBX&lt;br&gt;   MOV DWORD PTR DS:[EAX+4],EBX&lt;br&gt;   MOV DWORD PTR DS:[EAX+4],EBX&lt;br&gt;   MOV DWORD PTR DS:[EAX],EBX &lt;strong&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;br&gt;&lt;br&gt;IMPACT &lt;br&gt;&lt;/strong&gt;By writing to memory regions below the buffer's VA, An attacker may overwrite crucial data such as function pointers, flags, heap structures and so forth. Doing so may allow an attacker &lt;br&gt;to alter the normal control flow of the application and execute arbitrary code. &lt;br&gt;A simple attack vector would be to lure the victim to browse to a web site controlled by the attacker, which serves a malicious QuickTime file that exploits this vulnerability.&lt;br&gt;&lt;strong&gt;&lt;br&gt;TEST ENVIRONMENT &lt;br&gt;&lt;/strong&gt;Windows XP Service Pack 3&lt;br&gt;QuickTime 7.6 (472)&lt;br&gt;&lt;br&gt;&lt;strong&gt;REMEDIATION&lt;br&gt;&lt;/strong&gt;A new version of QuickTime (7.6.2) has been released in order to address this issue.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;IDENTIFIERS&lt;br&gt;&lt;/strong&gt;1&lt;em&gt;. CVE-ID&lt;/em&gt;: CVE-2009-0955&lt;br&gt;2. BID: 35166&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;REFERENCES&lt;br&gt;&lt;/strong&gt;1. &lt;a href="http://support.apple.com/kb/HT3591"&gt;Apple's advisory&lt;/a&gt;, Apple Inc.&lt;br&gt;2. &lt;a href="http://developer.apple.com/DOCUMENTATION/QuickTime/QTFF/qtff.pdf"&gt;QuickTime File Format Specification&lt;/a&gt;, Apple Inc.&lt;br&gt;3. &lt;a href="http://www.securityfocus.com/bid/35166"&gt;Apple QuickTime Image Description Atom Sign Extension Vulnerability&lt;/a&gt;, SecurityFocus&amp;nbsp; &lt;br&gt;4. &lt;a href="http://blog.watchfire.com/wfblog/2008/09/quicktime-patch.html"&gt;QuickTime patched&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6967489162537296891-6446556846712129399?l=roeehay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://roeehay.blogspot.com/feeds/6446556846712129399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6967489162537296891&amp;postID=6446556846712129399' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6967489162537296891/posts/default/6446556846712129399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6967489162537296891/posts/default/6446556846712129399'/><link rel='alternate' type='text/html' href='http://roeehay.blogspot.com/2009/06/apple-quicktime-image-description-atom.html' title='Apple QuickTime Image Description Atom Sign Extension Memory Corruption'/><author><name>Roee Hay</name><uri>http://www.blogger.com/profile/11051524207781515121</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6967489162537296891.post-7256374086051672585</id><published>2009-02-25T10:39:00.002+02:00</published><updated>2009-02-25T10:41:04.237+02:00</updated><title type='text'>Adobe Flash Player Update</title><content type='html'>&lt;p&gt;Adobe just released a patch to a vulnerability I had reported to them.   &lt;br /&gt;    &lt;br /&gt;The issue is due to a lack of input validation which allows a specially crafted SWF file to cause Flash Player to perform an arbitrary memory read.&lt;/p&gt;  &lt;p&gt;Exploiting the issue results in DoS (i.e crashes the browser). Further analysis might show it may lead to arbitrary code execution as well. &lt;/p&gt;  &lt;p&gt;More details about it can be found in &lt;a href="http://www.adobe.com/support/security/bulletins/apsb09-01.html"&gt;Adobe's security bulletin&lt;/a&gt; (&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-0519"&gt;CVE-2009-0519&lt;/a&gt;).     &lt;br /&gt;    &lt;br /&gt;I would like to thank Adobe for the efficient way in which they handled this security issue. &lt;/p&gt;  &lt;p&gt;This update contains fixes to other vulnerabilities as well, so go update :)   &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6967489162537296891-7256374086051672585?l=roeehay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://roeehay.blogspot.com/feeds/7256374086051672585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6967489162537296891&amp;postID=7256374086051672585' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6967489162537296891/posts/default/7256374086051672585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6967489162537296891/posts/default/7256374086051672585'/><link rel='alternate' type='text/html' href='http://roeehay.blogspot.com/2009/02/adobe-flash-player-update.html' title='Adobe Flash Player Update'/><author><name>Roee Hay</name><uri>http://www.blogger.com/profile/11051524207781515121</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6967489162537296891.post-7342361781354894738</id><published>2008-10-08T20:30:00.012+02:00</published><updated>2008-10-09T16:34:19.082+02:00</updated><title type='text'>Graphviz Buffer Overflow Code Execution</title><content type='html'>&lt;p&gt;Graphviz just released a patch to a critical security issue I reported to them.    &lt;br /&gt;    &lt;br /&gt;The following is the advisory:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Background      &lt;br /&gt;&lt;/strong&gt;Graphviz is an open-source multi-platform graph visualization software. It takes a description of graphs in a simple text format (DOT language), and makes diagrams out of it in several useful formats (including SVG).&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Description      &lt;br /&gt;&lt;/strong&gt;A vulnerability exists in Graphviz's parsing engine which makes it possible to overflow a globally allocated array and corrupt memory by doing so.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;parser.y (Graphviz 2.20.2):&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Consolas"&gt;34:&amp;#160; static Agraph_t&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; *Gstack[32];      &lt;br /&gt;35:&amp;#160; static int&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; GSP;       &lt;br /&gt;45:&amp;#160; static void push_subg(Agraph_t *g)       &lt;br /&gt;46:&amp;#160; {       &lt;br /&gt;47:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; G = Gstack[GSP++] = g;       &lt;br /&gt;48:&amp;#160; } &lt;/font&gt;&lt;/p&gt;  &lt;div class="csharpcode"&gt;As it can be seen, no bounds check is performed by the &lt;font face="Consolas" color="#0000ff"&gt;push_subg&lt;/font&gt; procedure, allowing one to overflow &lt;font face="Consolas" color="#0000ff"&gt;Gstack&lt;/font&gt; by pushing more than 32 (&lt;font face="Consolas" color="#0000ff"&gt;Agraph_t *&lt;/font&gt;) elements.&lt;/div&gt;  &lt;p&gt;&lt;strong&gt;Impact/Severity      &lt;br /&gt;&lt;/strong&gt;A malicious user can achieve an &lt;em&gt;arbitrary code execution&lt;/em&gt; by creating a specially crafted DOT file and convince the victim to render it using Graphviz.     &lt;br /&gt;    &lt;br /&gt;Below is a screenshot of a successful exploitation. When the&amp;#160; malicious DOT file is rendered, a shellcode which calls the MessageBoxA API is executed:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/roeehay/SOz8LWfiAII/AAAAAAAAAFw/OuNWnSwJ54M/s1600-h/image4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="337" alt="image" src="http://lh6.ggpht.com/roeehay/SOz8M6Ki5LI/AAAAAAAAAF4/UzxrCHsQM2M/image_thumb2.png?imgmax=800" width="428" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Affected versions&lt;/strong&gt;     &lt;br /&gt;Graphviz 2.20.2 is affected by this vulnerability. Older versions are probably affected as well.     &lt;br /&gt;    &lt;br /&gt;&lt;strong&gt;Workaround      &lt;br /&gt;&lt;/strong&gt;Version 2.20.3 has been released in order to address this issue. A bounds check has been added in order to avoid an overflow.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;parser.y (Graphviz 2.20.3):&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Consolas"&gt;34:&amp;#160; #define GSTACK_SIZE 64      &lt;br /&gt;35:&amp;#160; static Agraph_t&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; *Gstack[GSTACK_SIZE];       &lt;br /&gt;36:&amp;#160; static int&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; GSP;       &lt;br /&gt;45:       &lt;br /&gt;46:&amp;#160; static void push_subg(Agraph_t *g)       &lt;br /&gt;47:&amp;#160; {       &lt;br /&gt;48:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (GSP &amp;gt;= GSTACK_SIZE) {       &lt;br /&gt;49:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; agerr (AGERR, &amp;quot;Gstack overflow in graph parser\n&amp;quot;); exit(1);       &lt;br /&gt;50:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;51:&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; G = Gstack[GSP++] = g;       &lt;br /&gt;52:&amp;#160; }&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Acknowledgements      &lt;br /&gt;&lt;/strong&gt;I would like to thank the Graphviz team (Stephen C. North, John Ellson, Emden R. Gansner and others) for their quick responses and fix (it took them only a day since my disclosure to release a patch!).&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6967489162537296891-7342361781354894738?l=roeehay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://roeehay.blogspot.com/feeds/7342361781354894738/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6967489162537296891&amp;postID=7342361781354894738' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6967489162537296891/posts/default/7342361781354894738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6967489162537296891/posts/default/7342361781354894738'/><link rel='alternate' type='text/html' href='http://roeehay.blogspot.com/2008/10/graphviz-buffer-overflow-code-execution.html' title='Graphviz Buffer Overflow Code Execution'/><author><name>Roee Hay</name><uri>http://www.blogger.com/profile/11051524207781515121</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/roeehay/SOz8M6Ki5LI/AAAAAAAAAF4/UzxrCHsQM2M/s72-c/image_thumb2.png?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6967489162537296891.post-3106190324053127611</id><published>2007-11-10T03:44:00.000+02:00</published><updated>2007-11-21T12:20:10.873+02:00</updated><title type='text'>Untrusted Gateways - Open wireless networks</title><content type='html'>&lt;div style="text-align: justify;"&gt;One should always ask himself if the wireless gateway he uses is trustworthy.&lt;br /&gt;&lt;br /&gt;Depict yourself the following situation:&lt;br /&gt;&lt;br /&gt;You are sitting in a coffee shop, seeking for wireless networks. what are you gonna do next? connect to a network which SSID's is similar to the coffee shop's name, or if none exists, connect to the first open network you find.&lt;br /&gt;&lt;br /&gt;If the coffee shop doesn't have a wireless network, it gives a malicious user an opportunity to run his own network, on behalf of the coffee shop to attract clients. Otherwise, he will have to spoof the legitimate access-point's MAC, and race for new clients.&lt;br /&gt;&lt;br /&gt;Everyone knows that open wireless networks are prone to sniffing, but most people are unaware of the fact that active attacks could take place as well, and it is especially easy if the malicious user controls the gateway.&lt;br /&gt;&lt;br /&gt;This &lt;a href="http://vimeo.com/379554"&gt;video&lt;/a&gt; demonstrates how an exe file is injected transparently into an innocent HTTP session.&lt;br /&gt;&lt;br /&gt;What happens behind the scenes is the use of a transparent proxy I built, which terminates HTTP traffic, and searches for exe download patterns (&lt;span style="font-family:Courier;"&gt;Content-Type:\s+application/octet-stream&lt;/span&gt; to be exact). When it matches an exe pattern, it replaces the response with a malicious binary. The proxy runs on the gateway, which is fixed with an iptables rule (&lt;span style="font-family:Courier;"&gt;iptables -t nat -A PREROUTING -i [interface] -p tcp --dport 80 -j REDIRECT --to-ports [proxy interface]&lt;/span&gt;)  that forwards all transit HTTP via the proxy.&lt;br /&gt;&lt;br /&gt;By the use of PKI you can ensure you pass your malicious gateway without data mutation.&lt;br /&gt;So consider yourself one of the following countermeasures:&lt;br /&gt;&lt;br /&gt;1) Download binaries from SSL sites only (and verify the certificate!)&lt;br /&gt;2) Use an SSL proxy (and again verify the certificate)&lt;br /&gt;3) Tunnel traffic through a VPN&lt;br /&gt;4) Tunnel traffic through SSH&lt;br /&gt;5) Download signed binaries, and verify the digital signature.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6967489162537296891-3106190324053127611?l=roeehay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://roeehay.blogspot.com/feeds/3106190324053127611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6967489162537296891&amp;postID=3106190324053127611' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6967489162537296891/posts/default/3106190324053127611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6967489162537296891/posts/default/3106190324053127611'/><link rel='alternate' type='text/html' href='http://roeehay.blogspot.com/2007/11/untrusted-gateways-open-wireless.html' title='Untrusted Gateways - Open wireless networks'/><author><name>Roee Hay</name><uri>http://www.blogger.com/profile/11051524207781515121</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
