<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Suspekt...</title>
	<atom:link href="http://www.suspekt.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.suspekt.org</link>
	<description>A Blog About Code, Information Security, PHP And More</description>
	<pubDate>Wed, 05 Nov 2008 15:11:04 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>PHP Bytecode in Binnavi 2.0</title>
		<link>http://www.suspekt.org/2008/11/05/php-bytecode-in-binnavi-20/</link>
		<comments>http://www.suspekt.org/2008/11/05/php-bytecode-in-binnavi-20/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 15:11:04 +0000</pubDate>
		<dc:creator>Stefan Esser</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Security]]></category>

		<category><![CDATA[binnavi]]></category>

		<category><![CDATA[bytecode]]></category>

		<category><![CDATA[navigation]]></category>

		<category><![CDATA[php bytecode]]></category>

		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://www.suspekt.org/?p=194</guid>
		<description><![CDATA[I just finished porting php2sql 0.1 to the new Binnavi 2.0 database format. php2sql is my still private way to import PHP bytecode into Binnavi for manual analysation and navigation.
Here are some screenshots how the PHP bytecode of FluxBB 1.2.20 looks like in Binnavi.
First screen shows the project overview window. So far 281 PHP functions [...]]]></description>
			<content:encoded><![CDATA[<p>I just finished porting php2sql 0.1 to the new <a href="http://www.zynamics.com/index.php?page=binnavi">Binnavi 2.0</a> <a href="http://www.zynamics.com/BinNavi/manual/html/dbformat.htm">database format</a>. php2sql is my still private way to import PHP bytecode into Binnavi for manual analysation and navigation.</p>
<p>Here are some screenshots how the PHP bytecode of <a href="http://www.fluxbb.org">FluxBB 1.2.20</a> looks like in Binnavi.</p>
<p>First screen shows the project overview window. So far 281 PHP functions were identified. This includes those defined within fluxBB, those called in fluxBB and one virtual main function for every PHP file.</p>
<p><center><a href="http://www.suspekt.org/wp-content/uploads/2008/11/binnavi-1.png"><img class="aligncenter size-medium wp-image-195" title="Binnavi Project Overview" src="http://www.suspekt.org/wp-content/uploads/2008/11/binnavi-1.png" border="1" alt="" width="300" height="209" /></a></center></p>
<p>The second screenshot shows a part of the native callgraph within FluxBB.</p>
<p><center><a href="http://www.suspekt.org/wp-content/uploads/2008/11/binnavi-2.png"><img class="aligncenter size-medium wp-image-196" title="Part of Native Callgraph" src="http://www.suspekt.org/wp-content/uploads/2008/11/binnavi-2.png" border="1" alt="" width="300" height="203" /></a></center></p>
<p>The last screenshot shows a part of the code flow graph (CFG) of the handle_url_tag function defined in FluxBB.</p>
<p><center><a href="http://www.suspekt.org/wp-content/uploads/2008/11/binnavi-3.png"><img class="aligncenter size-medium wp-image-197" title="Part of handle_url_tag()'s CFG" src="http://www.suspekt.org/wp-content/uploads/2008/11/binnavi-3.png" border="1" alt="" width="300" height="196" /></a></center></p>
<p>Now that php2sql finally works with Binnavi 2.0 it is time to convert my PHP decompiler and code scanner to Binnavi 2.0 plugins. I will keep you updated.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.suspekt.org/2008/11/05/php-bytecode-in-binnavi-20/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP USB Device to solve namespace problems</title>
		<link>http://www.suspekt.org/2008/11/03/php-usb-device-to-solve-namespace-problems/</link>
		<comments>http://www.suspekt.org/2008/11/03/php-usb-device-to-solve-namespace-problems/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 10:54:25 +0000</pubDate>
		<dc:creator>Stefan Esser</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[fun]]></category>

		<category><![CDATA[namespaces]]></category>

		<guid isPermaLink="false">http://www.suspekt.org/?p=188</guid>
		<description><![CDATA[Now that the PHP namespace seperator is fixed as backslash developers around the world face two problems. On the one hand their source code will end up looking more ugly than .NET source code and on the other hand most non-american keyboards, especially those attached to apple computers will require strange key combinations to enter [...]]]></description>
			<content:encoded><![CDATA[<p>Now that the PHP namespace seperator is fixed as backslash developers around the world face two problems. On the one hand their source code will end up looking more ugly than .NET source code and on the other hand most non-american keyboards, especially those attached to apple computers will require strange key combinations to enter the backslash.</p>
<p>However rescue is near in the form of a USB device that allows you to enter the backslash character in a smooth and easy way. First pictures of this device that will be available at <a href="http://www.php.net">shop.php.net</a> around christmas have leaked to the internet.</p>
<p><center><a href="http://www.suspekt.org/wp-content/uploads/2008/11/backslash-usb-device.jpeg"><img class="aligncenter size-medium wp-image-189" title="Zimt PHP Namespace Enabler for USB Pro" src="http://www.suspekt.org/wp-content/uploads/2008/11/backslash-usb-device.jpeg" alt="" width="300" height="188" /></a></center></p>
<p>This should finally shut up all the namespace seperator critics and allow the PHP developers to finally release the long awaited PHP 5.3</p>
]]></content:encoded>
			<wfw:commentRss>http://www.suspekt.org/2008/11/03/php-usb-device-to-solve-namespace-problems/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP got forked</title>
		<link>http://www.suspekt.org/2008/10/31/php-got-forked/</link>
		<comments>http://www.suspekt.org/2008/10/31/php-got-forked/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 12:43:10 +0000</pubDate>
		<dc:creator>Stefan Esser</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[fork]]></category>

		<category><![CDATA[fun]]></category>

		<category><![CDATA[ipc]]></category>

		<category><![CDATA[php fork]]></category>

		<guid isPermaLink="false">http://www.suspekt.org/?p=184</guid>
		<description><![CDATA[During International PHP Conference 2008 there where a lot of discussions about the stupid backslash namespace seperator decision. Most of the guys &#8220;do not want to have their PHP files look like windows registry dumps&#8221; (Quoting some unknown guy at the panel discussion). Some people even suggested forking PHP at PHP 5.3 to replace the [...]]]></description>
			<content:encoded><![CDATA[<p>During <a href="http://www.phpconference.com">International PHP Conference 2008</a> there where a lot of discussions about the stupid backslash namespace seperator decision. Most of the guys &#8220;do not want to have their PHP files look like windows registry dumps&#8221; (Quoting some unknown guy at the panel discussion). Some people even suggested forking PHP at PHP 5.3 to replace the backslash with the more accepted tripple colon (:::).</p>
<p>Being a man of actions the first thing I did today was to fork PHP. </p>
<p>Proof is here.</p>
<p><a href="http://www.suspekt.org/wp-content/uploads/2008/10/forkedphp.jpg"><img class="aligncenter size-medium wp-image-185" title="forkedphp" src="http://www.suspekt.org/wp-content/uploads/2008/10/forkedphp.jpg" alt="" width="300" height="225" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.suspekt.org/2008/10/31/php-got-forked/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CGNSec - Second Meeting in Cologne</title>
		<link>http://www.suspekt.org/2008/10/30/cgnsec-second-meeting-in-cologne/</link>
		<comments>http://www.suspekt.org/2008/10/30/cgnsec-second-meeting-in-cologne/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 16:08:05 +0000</pubDate>
		<dc:creator>Stefan Esser</dc:creator>
		
		<category><![CDATA[CGNSec]]></category>

		<category><![CDATA[Security]]></category>

		<category><![CDATA[information security]]></category>

		<category><![CDATA[meeting]]></category>

		<guid isPermaLink="false">http://www.suspekt.org/?p=182</guid>
		<description><![CDATA[I just wanted to announce that next wednesday (5th of November) at 19:30 there will be the second CGNSec meetup in Cologne/Germany.
The meeting takes place at Hallmackenreuther, Brüsseler Platz 9, 50674 Köln (Google Maps)
Everyone working in the field of information security is invited to attend. To find us, just ask for the tables reserved for [...]]]></description>
			<content:encoded><![CDATA[<p>I just wanted to announce that next wednesday (5th of November) at 19:30 there will be the second <a href="http://www.cgnsec.de/">CGNSec</a> meetup in Cologne/Germany.</p>
<p>The meeting takes place at Hallmackenreuther, Brüsseler Platz 9, 50674 Köln (<a href="http://www.google.com/maps?q=Hallmackenreuther%2c%20Br%c3%bcsseler%20Platz%209,50674,K%c3%b6ln,Germany">Google Maps</a>)</p>
<p>Everyone working in the field of information security is invited to attend. To find us, just ask for the tables reserved for CGNSec.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.suspekt.org/2008/10/30/cgnsec-second-meeting-in-cologne/feed/</wfw:commentRss>
		</item>
		<item>
		<title>FreeBSD? Witches? - No Thank You</title>
		<link>http://www.suspekt.org/2008/10/16/freebsd-witches-no-thank-you/</link>
		<comments>http://www.suspekt.org/2008/10/16/freebsd-witches-no-thank-you/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 06:15:21 +0000</pubDate>
		<dc:creator>Stefan Esser</dc:creator>
		
		<category><![CDATA[CGNSec]]></category>

		<category><![CDATA[Security]]></category>

		<category><![CDATA[identity]]></category>

		<guid isPermaLink="false">http://www.suspekt.org/?p=180</guid>
		<description><![CDATA[There is a common misunderstanding about me in the circles of BSD users that I have encountered once again at yesterdays first CGNSec meeting.
There is a FreeBSD kernel developer Stefan Eßer (Esser) that is also from cologne and also works in the field of IT-Security. We are not the same person and I am not [...]]]></description>
			<content:encoded><![CDATA[<p>There is a common misunderstanding about me in the circles of BSD users that I have encountered once again at yesterdays first <a href="http://www.cgnsec.de">CGNSec</a> meeting.</p>
<p>There is a FreeBSD kernel developer <a href="https://www.xing.com/profile/Stefan_Esser10">Stefan Eßer (Esser)</a> that is also from cologne and also works in the field of IT-Security. We are not the same person and I am not related to him in any way, however he is of course invited to join us at <a href="http://www.cgnsec.de">CGNSec</a> next month.</p>
<p>Ahh yes&#8230; I am also not related to that other Stefan Esser that writes <a href="http://www.amazon.de/Hexenrituale-Meine-magischen-Rezepte-Gesundheit/dp/3442121930/ref=sr_1_9?ie=UTF8&amp;s=books&amp;qid=1224137981&amp;sr=8-9">books about Witches</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.suspekt.org/2008/10/16/freebsd-witches-no-thank-you/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CGNSec - First Meeting in Cologne</title>
		<link>http://www.suspekt.org/2008/10/13/cgnsec-first-meeting-in-cologne/</link>
		<comments>http://www.suspekt.org/2008/10/13/cgnsec-first-meeting-in-cologne/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 10:58:39 +0000</pubDate>
		<dc:creator>Stefan Esser</dc:creator>
		
		<category><![CDATA[CGNSec]]></category>

		<category><![CDATA[Security]]></category>

		<category><![CDATA[citysec]]></category>

		<category><![CDATA[meeting]]></category>

		<guid isPermaLink="false">http://www.suspekt.org/?p=178</guid>
		<description><![CDATA[Next wednesday at 19:30 there will be the first CGNSec meetup in Cologne/Germany. CGNSec is inspired by the CitySec meetups that are popular in the United States and some other european and asian countries.
Everyone working in the field of information security is invited to come.
Because it is the first meeting we still have to elaborate [...]]]></description>
			<content:encoded><![CDATA[<p>Next wednesday at 19:30 there will be the first <a href="http://www.cgnsec.de">CGNSec</a> meetup in Cologne/Germany. <a href="http://www.cgnsec.de">CGNSec</a> is inspired by the <a href="http://www.citysec.org">CitySec</a> meetups that are popular in the United States and some other european and asian countries.</p>
<p>Everyone working in the field of information security is invited to come.</p>
<p>Because it is the first meeting we still have to elaborate how scalable the <a href="http://www.google.com/maps?q=Hallmackenreuther%2c%20Br%c3%bcsseler%20Platz%209,50674,K%c3%b6ln,Germany">location</a> will be. I therefore recommend dropping a mail to me until tuesday night if you want to attend so that we can reserve enough seats.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.suspekt.org/2008/10/13/cgnsec-first-meeting-in-cologne/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Suhosin: canary mismatch on efree() - heap overflow detected</title>
		<link>http://www.suspekt.org/2008/10/12/suhosin-canary-mismatch-on-efree-heap-overflow-detected/</link>
		<comments>http://www.suspekt.org/2008/10/12/suhosin-canary-mismatch-on-efree-heap-overflow-detected/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 10:38:27 +0000</pubDate>
		<dc:creator>Stefan Esser</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Security]]></category>

		<category><![CDATA[bugs]]></category>

		<category><![CDATA[no support]]></category>

		<category><![CDATA[suhosin]]></category>

		<guid isPermaLink="false">http://www.suspekt.org/?p=173</guid>
		<description><![CDATA[Users of Suhosin-Patch will sooner or later see messages like &#8220;canary mismatch on efree() - heap overflow detected&#8221; in their error log. When this happens they are often confused and don&#8217;t understand what it means.
The first questions they often ask themself are:

Did they trigger a bug in Suhosin?


Is something wrong with Suhosin?

In reality this means [...]]]></description>
			<content:encoded><![CDATA[<p>Users of <a href="http://www.suspekt.org/">Suhosin-Patch</a> will sooner or later see messages like &#8220;canary mismatch on efree() - heap overflow detected&#8221; in their error log. When this happens they are often confused and don&#8217;t understand what it means.</p>
<p>The first questions they often ask themself are:</p>
<ul>
<li>Did they trigger a bug in <a href="http://www.suhosin.org">Suhosin</a>?</li>
</ul>
<ul>
<li>Is something wrong with <a href="http://www.suhosin.org">Suhosin</a>?</li>
</ul>
<p>In reality this means that when PHP internally tried to free some allocated memory the memory manager security features of <a href="http://www.suhosin.org">Suhosin</a> detected that the memory to be freed is somehow corrupted. This corruption occured somewhen between the allocation of the memory area and the attempt to free it. <a href="http://www.suhosin.org">Suhosin</a> detects this by writing canary values infront and after allocated memory areas. These canary values are random numbers that are stored in one of <a href="http://www.suhosin.org">Suhosin</a>&#8217;s internal variables. The check consists of comparing the internally stored random number with the values found infront and after the memory area. Those values are outside of anything PHP is supposed to write to and therefore a failed canary comparision can only mean two things.</p>
<ol>
<li>some memory corruption destroyed/overwrote the internally stored random values</li>
<li>some memory corruption destroyed/overwrote the canaries next to the allocated memory</li>
</ol>
<p>This means everytime <a href="http://www.suhosin.org">Suhosin</a> gives out an error there was a memory corruption. There are no false positives <a href="http://news.php.net/php.internals/40919">as some of the PHP developers claim</a> again and again. This means that everytime you see this error there has been a memory corruption in PHP or one of the loaded extensions. This means there is a bug and some code in one of the loaded components that behaves wrongly.</p>
<p>Unfortunately the PHP developers refuse to support PHP users that decided to go with the more secure version of PHP, because the patch could influence how PHP works and be the cause of the bug. They require their users to reproduce the problem with a vanilla PHP with valgrind running.</p>
<p>The obvious problems with this are</p>
<ol>
<li>Running PHP in valgrind has a much greater influence on how PHP works than Suhosin-Patch has</li>
<li>Using valgrind wrongly means the memory corruption bugs cannot be found</li>
<li>Using valgrind correctly does not necessary reveal the bug, because it might be hidden by memory alignment or just because valgrind cannot detect that class of memory corruptions</li>
<li>A memory corruption that Suhosin might detect everytime might only crash a vanilla (valgrind) PHP once every thousand invocations or might not result in a crash at all but in wrong computation results</li>
<li>Some memory corruptions occur in memory areas that are unused due to alignment, they will not result in misbehaviour of vanilla PHP - However any memory corruption is a bug in PHP (or extensions) that should be fixed and a little harmless memory corruption today could turn into a remote exploit in the future when the code is changed (or when PHP is executed on another (new) architecture).</li>
<li>A normal user will not be able to recompile PHP and reproduce with valgrind correctly</li>
<li>A not reproduced memory corruption still exists but will not be fixed</li>
</ol>
<p>That said the only option for users of the more secure PHP is at the moment to try to get support for their problem at their distribution&#8217;s PHP maintainers because the people at PHP.net will not be interested in helping them. However due to the reasons above the distribution maintainers might not be able to help you, because they cannot reproduce the bug (although Suhosin proved its existance).</p>
<p>If you know what you are doing then just use valgrind on the Suhosin patched PHP and simply claim that you reproduced the bug without Suhosin installed. This will also give you a higher probability of reproducing the problem.</p>
<p>Because of this I will think up some debugging functionality for Suhosin that will make it easier for users to tell the PHP developers where their bug is located. More information about how this will be implemented will be released during the next month.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.suspekt.org/2008/10/12/suhosin-canary-mismatch-on-efree-heap-overflow-detected/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP 5.3 and Delayed Cross Site Request Forgeries/Hijacking</title>
		<link>http://www.suspekt.org/2008/10/01/php-53-and-delayed-cross-site-request-forgerieshijacking/</link>
		<comments>http://www.suspekt.org/2008/10/01/php-53-and-delayed-cross-site-request-forgerieshijacking/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 02:26:38 +0000</pubDate>
		<dc:creator>Stefan Esser</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Security]]></category>

		<category><![CDATA[$_request]]></category>

		<category><![CDATA[cookie dos]]></category>

		<category><![CDATA[cookie injection]]></category>

		<category><![CDATA[cross site request hijacking]]></category>

		<category><![CDATA[csrf]]></category>

		<category><![CDATA[delayed csrf]]></category>

		<category><![CDATA[dos]]></category>

		<category><![CDATA[php security]]></category>

		<guid isPermaLink="false">http://www.suspekt.org/?p=166</guid>
		<description><![CDATA[Although PHP 5.3 is still in alpha stage and certain features like the PHAR extension or the whole namespace support are still topics of endless discussions it already contains smaller changes that could improve the security of PHP applications a lot.
One of these small changes is the introduction of a new php ini directive called [...]]]></description>
			<content:encoded><![CDATA[<p>Although PHP 5.3 is still in alpha stage and certain features like the PHAR extension or the whole namespace support are still topics of endless discussions it already contains smaller changes that could improve the security of PHP applications a lot.</p>
<p>One of these small changes is the introduction of a new php ini directive called request_order. request_order is the response of the PHP developers to me preaching for years that using $_REQUEST is not only deprecated but actually dangerous for PHP applications. With request_order it is now possible to control in what order $_REQUEST is created and what variable sources are taken into account. This finally allows removing cookie data from $_REQUEST without removing them from $_COOKIE also.</p>
<p>Because removing cookies from $_REQUEST might break badly written software request_order is not set by default. However the recommended setting by the PHP developer is to set it to &#8220;GP&#8221; which means only $_GET and _POST data is merged into $_REQUEST with $_POST data overwriting $_GET data.</p>
<p>To learn why using $_REQUEST is a bad idea and what Delayed Cross Site Request Forgeries/Hijacking are continue reading&#8230;<br />
<span id="more-166"></span><br />
<strong>$_REQUEST and Cookies</strong></p>
<p>PHP application developers often use $_REQUEST instead of $_GET or $_POST because they do not care about the source of input. This has been considered bad practice for a while, because it is actually a violation of the idea behind GET and POST requests: GET is meant to retrieve data, POST is meant to manipulate data. And others have wrongly claimed that using POST instead of GET is a protection against CSRF. Nevertheless PHP application developers still use $_REQUEST a lot, because they cannot see the security threat in using it.</p>
<p>What most of them forget is that $_REQUEST does also contain $_COOKIE data and cookies unlike $_GET and $_POST data are shared among a (sub-)domain. So an application must actually expect that there might be cookies alien to the application. These cookies could be an attack on the application but aren&#8217;t necessary. However their presence in $_REQUEST results in application input filters going crazy or they might influence the application logic.</p>
<p>Therefore it is important to remember that cookies might be legal cookies of another application on the same host. And it is also important to remember that some browsers like Firefox 2 does allow an application to set cookies valid for a whole country if the domain is like *.co.uk or *.co.kr. While this allows cross domain user tracking, it also means any application in the country could set a cookie that is seen by your application and considered an attack.</p>
<p><strong>Cookie Denial of Service (DOS)</strong></p>
<p>Taking this into account it should be obvious that any application blocking requests because of some value appearing in $_COOKIE or $_REQUEST is vulnerable to denial of service. Once an attacker is able to get a cookie into the browser of a user, which is possible through XSS in one application on the same domain or cross domain vulnerabilities in browsers, it will trigger the request blocking in the application with every request. The user will not be able to use the application anymore unless the cookie expires or he manually deletes it. However the average user does not have a clue how to delete a cookie, which means he will be denied access forever.</p>
<p><strong>NOTE: </strong>Due to PHP&#8217;s way of ignoring trailing spaces in variable names and because cookies might be set (sub-)domain wide or path wide, it is not possible for the application to kill the cookie by issuing a simple Set-Cookie HTTP header.</p>
<p>Many open source PHP applications are vulnerable to Cookie Denial of Service because they introduced code similar to the following example to protect against PHP&#8217;s GLOBALS overwrite problem.</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'GLOBALS'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;GLOBALS Overwrite attack attempt!!!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Because of this it is possible to deny a user access to a lot of sites in Korea or the UK by just creating a GLOBALS=1 cookie for *.co.kr/*.co.uk in older Firefox versions. Another attack that hits many PHP applications is creating a cookie called action=logout.</p>
<p><strong>Delayed Cross Site Request Forgeries/Hijacking</strong></p>
<p>When $_REQUEST is used by an application to react on user input instead of just $_GET or $_POST an attacker can inject certain values or actions into an application through injected cookie data instead of just killing it with a Cookie DOS. This attack is similar to a Cross Site Request Forgery with the difference that it actually hijacks a user request instead of simply forging it and that it happens with a delay: After the cookie is injected the CSRF is executed the next time the user uses the site.</p>
<p>Because the actual attack relies on hijacking an actual user request that is abused by manipulating by adding or modifying some input variables people might prefer to call it Cross Site Request Hijacking. It is important to realise that a delayed hijacking is different from just forging the request. This also means that traditional CSRF protections like form tokens or asking the user for his password are ineffective against this kind of attack. Because the attack just changes some of the variables within a request the secret form tokens and/or user submitted passwords of the original request will be transmitted correctly.</p>
<p>A vulnerability like this was found and disclosed in phpMyAdmin a while ago. Within phpMyAdmin it was possible to inject a cookie that would execute arbitrary SQL statements on the server the next the user logged into his phpMyAdmin account.</p>
<p>Another incarnation of this vulnerability class was found within a form software where the admin configuration was handled by code similar to this.</p>

<div class="wp_syntax"><div class="code"><pre class="php">   <span style="color: #666666; font-style: italic;">// save only modified admin options</span>
   <span style="color: #666666; font-style: italic;">// BEWARE THIS CODE IS VULNERABLE</span>
   <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000033;">$_REQUEST</span><span style="color: #009900;">&#91;</span>‘options‘<span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000033;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000033;">$val</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #000033;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000033;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #000033;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #000033;">$val</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
         saveOption<span style="color: #009900;">&#40;</span><span style="color: #000033;">$key</span><span style="color: #339933;">,</span> <span style="color: #000033;">$val</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
   <span style="color: #009900;">&#125;</span></pre></div></div>

<p>In this example an attacker that is able to inject a cookie titled <em>options[includePath]</em> into the admin&#8217;s browser will be able to remotely include arbitrary PHP code. Because the attack relies on Delayed Cross Site Request Forgery/Hijacking the attack is even possible when the admin is not currently logged into the administrative interface. The payload sleeps and will become effective once the admin tries to change the forum configuration the next time, although there is a CSRF protection in place.</p>
<p><strong>Conclusion</strong></p>
<p>Once PHP 5.3 is out it is recommended for hosters to set request_order to &#8220;GP&#8221; on all the servers running arbitrary PHP applications to protect applications from this kind of Cookie DOS or Delayed Cross Site Request Forgery/Hijacking vulnerabilities.</p>
<p>PHP Application developers on the other hand should finally move away from using $_REQUEST for user input, because it is cleaner and more secure.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.suspekt.org/2008/10/01/php-53-and-delayed-cross-site-request-forgerieshijacking/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Starbucks, WIFI, Internet and South Korea</title>
		<link>http://www.suspekt.org/2008/09/30/starbucks-wifi-internet-and-south-korea/</link>
		<comments>http://www.suspekt.org/2008/09/30/starbucks-wifi-internet-and-south-korea/#comments</comments>
		<pubDate>Tue, 30 Sep 2008 02:17:44 +0000</pubDate>
		<dc:creator>Stefan Esser</dc:creator>
		
		<category><![CDATA[korea]]></category>

		<category><![CDATA[annoying]]></category>

		<category><![CDATA[internet]]></category>

		<category><![CDATA[internet explorer]]></category>

		<category><![CDATA[microsoft]]></category>

		<category><![CDATA[starbucks]]></category>

		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://www.suspekt.org/?p=163</guid>
		<description><![CDATA[When I came to Seoul, South Korea I had already heard about the high distribution of broadband internet access. Therefore I was not suprised at all that my hotel room had ethernet sockets that provided me with fast internet access. What suprised me however was the fact that it was for free. In Germany or [...]]]></description>
			<content:encoded><![CDATA[<p>When I came to Seoul, South Korea I had already heard about the high distribution of broadband internet access. Therefore I was not suprised at all that my hotel room had ethernet sockets that provided me with fast internet access. What suprised me however was the fact that it was for free. In Germany or the USA you usually pay atleast 10$ per day for a similiar connection.</p>
<p>On the other hand when I visited Starbucks I had to learn the hard way that without Microsoft Windows you are an outsider in South Korea. It is simply not possible to connect to the NETSPOT hotspots within Starbucks Korea without Microsoft Windows and without Internet Explorer. On the one hand their special connectivity software only exists for Windows and on the other hand the web login seems to require an activex module for credit card payment.</p>
<p>With this kind of limit in place I can now understand why devices like the IPOD Touch are far cheaper in South Korea than in Germany. You simply cannot use them <img src='http://www.suspekt.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I think the guys behind NETSPOT should really consider redesigning their system to be compatible to non Microsoft systems, like osx or linux. After all it is not that hard to do credit card billing.</p>
<p><em>PS.1: Yes I know that the NETSPOT hotspots seem to let everything through on port 53 UDP which might allow VPN tunnels on port 53 but I am only speaking about legal access here.</em></p>
<p><em>PS.2: Beside that little annoyance I really love South Korea and plan to come back as often as possible</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.suspekt.org/2008/09/30/starbucks-wifi-internet-and-south-korea/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Slides from my Lesser Known Security Problems in PHP Applications Talk at ZendCon</title>
		<link>http://www.suspekt.org/2008/09/18/slides-from-my-lesser-known-security-problems-in-php-applications-talk-at-zendcon/</link>
		<comments>http://www.suspekt.org/2008/09/18/slides-from-my-lesser-known-security-problems-in-php-applications-talk-at-zendcon/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 15:05:47 +0000</pubDate>
		<dc:creator>Stefan Esser</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Security]]></category>

		<category><![CDATA[slides]]></category>

		<category><![CDATA[talk]]></category>

		<category><![CDATA[zendcon]]></category>

		<guid isPermaLink="false">http://www.suspekt.org/?p=159</guid>
		<description><![CDATA[Here are the slides of my ZendCon talk about Lesser Known Security Problems in PHP Applications.
(PDF) Lesser Known Security Problems in PHP Applications
]]></description>
			<content:encoded><![CDATA[<p>Here are the slides of my ZendCon talk about Lesser Known Security Problems in PHP Applications.</p>
<p><a href="http://www.suspekt.org/wp-content/uploads/2008/09/lesserknownsecurityproblemsinphpapplications.pdf">(PDF) Lesser Known Security Problems in PHP Applications</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.suspekt.org/2008/09/18/slides-from-my-lesser-known-security-problems-in-php-applications-talk-at-zendcon/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
