<?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>Sat, 25 Dec 2010 07:36:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Improving the ASLR of Mac OS X Snow Leopard</title>
		<link>http://www.suspekt.org/2010/12/25/improving-the-aslr-of-mac-os-x-snow-leopard/</link>
		<comments>http://www.suspekt.org/2010/12/25/improving-the-aslr-of-mac-os-x-snow-leopard/#comments</comments>
		<pubDate>Sat, 25 Dec 2010 07:36:33 +0000</pubDate>
		<dc:creator>Stefan Esser</dc:creator>
		
		<category><![CDATA[Projects]]></category>

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

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

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

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

		<category><![CDATA[mac os x]]></category>

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

		<guid isPermaLink="false">http://www.suspekt.org/?p=366</guid>
		<description><![CDATA[Last week I presented my research about &#8220;Adding ASLR to jailbroken iPhones&#8221; at the Power of Community 2010 (POC2010) security conference in Seoul. During my talk I explained how one can use a modified &#8216;rebase&#8217; utility to rebase the dynamic linker dyld on the iPhone. Rebasing dyld is important because it contains enough code gadgets [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I presented my research about &#8220;<a href="http://antid0te.com/POC2010-Adding-ASLR-To-Jailbroken-iPhones.pdf">Adding ASLR to jailbroken iPhones</a>&#8221; at the <a href="http://www.powerofcommunity.net">Power of Community 2010 (POC2010)</a> security conference in Seoul. During my talk I explained how one can use a modified &#8216;rebase&#8217; utility to rebase the dynamic linker dyld on the iPhone. Rebasing dyld is important because it contains enough code gadgets that can be used to kickstart arbitrary shellcode on jailbroken iPhones. A tool called <a href="http://www.antid0te.com">Antid0te</a> will be released until the end of this year that allows normal users to add ASLR to their iPhones. The release of this tool was originally planned for 24th December 2010 but it had to be postponed because I got really ill and also my glasses broke.</p>
<p>Anyway a few days ago I demonstrated how my &#8220;rebase dyld&#8221; research that was originally done for the iPhone applies directly to the dynamic linker used by Mac OS X Snow Leopard. I released a <a href="http://antid0te.com/antid0te-for-snow-leopard-rebasing-dyld.html">short article </a>describing how one can rebase his dyld binary with a patched &#8216;rebase&#8217; utility which I also released. This can be used to rebase your own dyld binary to a different position. Rebasing dyld to an address other than the normal one, improves the security of your Mac because all the public articles/techniques about state of the art Mac OS X exploitation assume/require the dyld binary to be loaded at a fixed address. All attacks based on this will fail once you have rebased your dynamic linker binary.</p>
<p>So enjoy this little christmas present until I am fit enough to release <a href="http://antid0te.com/">antid0te.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.suspekt.org/2010/12/25/improving-the-aslr-of-mac-os-x-snow-leopard/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Speaking at POC 2010 - ASLR for jailbroken iPhones</title>
		<link>http://www.suspekt.org/2010/12/01/speaking-at-poc-2010-aslr-for-jailbroken-iphones/</link>
		<comments>http://www.suspekt.org/2010/12/01/speaking-at-poc-2010-aslr-for-jailbroken-iphones/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 10:57:16 +0000</pubDate>
		<dc:creator>Stefan Esser</dc:creator>
		
		<category><![CDATA[Projects]]></category>

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

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

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

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

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

		<category><![CDATA[exploit mitigation]]></category>

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

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

		<guid isPermaLink="false">http://www.suspekt.org/?p=361</guid>
		<description><![CDATA[
December has arrived and it is time to announce my talk for the Power of Community security conference in Seoul. This year I will not only return there for the 3rd time as speaker, but this time I will talk about something not related to PHP or web security at all. My company SektionEins recently [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.powerofcommunity.net/"><img class="alignnone size-medium wp-image-76" title="poc_logo" src="http://www.suspekt.org/wp-content/uploads/2008/08/poc_logo.jpg" border="1" alt="" width="100" height="100" /></a><br />
December has arrived and it is time to announce my talk for the <a href="http://www.powerofcommunity.net">Power of Community</a> security conference in Seoul. This year I will not only return there for the 3rd time as speaker, but this time I will talk about something not related to PHP or web security at all. My company <a href="http://www.sektioneins.com">SektionEins</a> recently started to offer mobile security audits and I am now playing around with iPhone security all the time which resulted in the talk that I will present at POC this year.</p>
<blockquote><p><strong>Session: Adding Address Space Layout Randomization (ASLR) to jailbroken iPhones</strong><br />
This year has brought bad news for the security of the iPhone. First it was demonstrated during the PWN2OWN contest that ROP payloads can steal information like the SMS database from factory iPhones and later this year jailbreakme.com combined multiple exploits for vulnerabilities in MobileSafari, the iOS kernel and the userland to jailbreak the device from remote. And for jailbroken devices the situation is even worse because the jailbreak weakens the otherwise strong security features of the iPhone in a way that remote exploits are far easier to accomplish.</p>
<p>However it is time to remember that the whole purpose of a jailbreak is to free the device from Apple and to allow users to do whatever they want with their device. The fact that current jailbreaks destroy the security is just because jailbreakers did not bother to find a better solution. This changes now.</p>
<p>In this session the differences in exploiting jailbroken and factory iPhones will be highlighted and it will be explained step by step how a new tool was developed that adds ASLR (address space layout randomization) to jailbroken iPhones. With ASLR an exploit mitigation is added that is not available in factory iPhones and makes exploitation more difficult. And this is only the first step, more mitigations and a full reactivation of the codesigning protection are planed for the next months.</p></blockquote>
<p>See you in Seoul between 13th and 16th December.</p>
<p>서울에서 12월 13일에서 16일에 만나요!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.suspekt.org/2010/12/01/speaking-at-poc-2010-aslr-for-jailbroken-iphones/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Month of PHP Security 2010 has begun&#8230;</title>
		<link>http://www.suspekt.org/2010/05/02/month-of-php-security-2010-has-begun/</link>
		<comments>http://www.suspekt.org/2010/05/02/month-of-php-security-2010-has-begun/#comments</comments>
		<pubDate>Sun, 02 May 2010 05:23:11 +0000</pubDate>
		<dc:creator>Stefan Esser</dc:creator>
		
		<category><![CDATA[PHP]]></category>

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

		<category><![CDATA[month of]]></category>

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

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

		<guid isPermaLink="false">http://www.suspekt.org/?p=357</guid>
		<description><![CDATA[In case you haven&#8217;t noticed it through the other channels already&#8230;
The Month of PHP Security 2010 has finally begun.
During the Month of May 2010 we (SektionEins) will post every day at least one new  vulnerabilities in PHP and one new vulnerability in a PHP applications.  In addition to that every other day we [...]]]></description>
			<content:encoded><![CDATA[<p>In case you haven&#8217;t noticed it through the other channels already&#8230;</p>
<p>The <a href="http://php-security.org">Month of PHP Security 2010</a> has finally begun.</p>
<p>During the Month of May 2010 we (<a href="http://www.sektioneins.com">SektionEins</a>) will post every day at least one new  vulnerabilities in PHP and one new vulnerability in a PHP applications.  In addition to that every other day we will post an article about a PHP  security topic or a new PHP security tool. Among these articles and  tools are those that were submitted to us during the Month of PHP  Security CFP.</p>
<p>BTW: You can also <a href="http://twitter.com/mops_2010">follow</a> the Month of PHP Security on <a href="http://twitter.com/mops_2010">twitter</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.suspekt.org/2010/05/02/month-of-php-security-2010-has-begun/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SyScan-Workshop: Advanced PHP Auditing at Source and Bytecode Level</title>
		<link>http://www.suspekt.org/2010/04/19/syscan-workshop-advanced-php-auditing-at-source-and-bytecode-level/</link>
		<comments>http://www.suspekt.org/2010/04/19/syscan-workshop-advanced-php-auditing-at-source-and-bytecode-level/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 12:08:23 +0000</pubDate>
		<dc:creator>Stefan Esser</dc:creator>
		
		<category><![CDATA[PHP]]></category>

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

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

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

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

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

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

		<guid isPermaLink="false">http://www.suspekt.org/?p=355</guid>
		<description><![CDATA[At SyScan&#8217;10 Singapore I will give a two day workshop about &#8220;Advanced PHP Auditing at Source and Bytecode Level&#8221;.
This course will teach students advanced methods and techniques for PHP application audits at source code and at bytecode level. The students will get to know the most common PHP security problems and how to find them [...]]]></description>
			<content:encoded><![CDATA[<p>At <a href="http://syscan.org/Sg/training.html">SyScan&#8217;10 Singapore</a> I will give a two day workshop about <a href="http://syscan.org/Sg/syscan_10_03.php">&#8220;Advanced PHP Auditing at Source and Bytecode Level&#8221;</a>.</p>
<blockquote><p>This course will teach students advanced methods and techniques for PHP application audits at source code and at bytecode level. The students will get to know the most common PHP security problems and how to find them at source code and bytecode level. Throughout the course several free and open source software tools will be introduced and used in order to visualize application structure, find security problems with static and dynamic analysis on source code and bytecode level and also to break PHP bytecode encryption.</p></blockquote>
<p>You can read the full description <a href="http://syscan.org/Sg/syscan_10_03.php">here</a>. During the course students will get exclusive access to a few of our internal tools. You should apply early because seats are limited. And if you want to get training like this outside of a conference, then please contact <a href="mailto:info@sektioneins.de">info@sektioneins.de</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.suspekt.org/2010/04/19/syscan-workshop-advanced-php-auditing-at-source-and-bytecode-level/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MOPS CFP: Deadline Extension - April 18, 2010</title>
		<link>http://www.suspekt.org/2010/04/09/mops-cfp-deadline-extension-april-18-2010/</link>
		<comments>http://www.suspekt.org/2010/04/09/mops-cfp-deadline-extension-april-18-2010/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 06:17:18 +0000</pubDate>
		<dc:creator>Stefan Esser</dc:creator>
		
		<category><![CDATA[PHP]]></category>

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

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

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

		<category><![CDATA[mops cfp]]></category>

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

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

		<guid isPermaLink="false">http://www.suspekt.org/?p=349</guid>
		<description><![CDATA[The Month of PHP Security committee has decided to extend the CFP deadline from April 11, 2010 to April 18, 2010. The reason for that is very simple: so far we only got a few submissions from the PHP community and the security community. Even fewer submissions than we have prizes. Therefore it is only [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://php-security.org">Month of PHP Security</a> committee has decided to extend the CFP deadline from April 11, 2010 to April 18, 2010. The reason for that is very simple: so far we only got a few submissions from the PHP community and the security community. Even fewer submissions than we have prizes. Therefore it is only fair to wait a bit more for your submissions.</p>
<p>There seems to be a confusion about the accepted topics.</p>
<ul>
<li>We do not only accept but welcome articles about PHP security topics. The whole point of involving the community in MOPS was to gather articles about secure PHP programming or PHP security research.</li>
<li>We will accept vulnerabilities in PHP applications as long the application is installed on more than 100 systems and the vulnerability gives you access to the data or to the system. However you have to write a text describing the vulnerability and what you can do with it.</li>
<li>You DO NOT loose any rights by submitting something to us. You will be credited and in case of bugs you are also allowed to write your own advisory to bugtraq (or whereever else). In case of articles you can reuse them for everything you want. Only condition: no other publication before the article/bug appears during MOPS.</li>
</ul>
<p>To revisit the full list of accepted topics: <a href="http://php-security.org/#topics">look here</a>.</p>
<p>If there are no more community submissions this does not mean that the MOPS is cancelled. We at <a href="http://www.sektioneins.com">SektionEins GmbH</a> will ensure that there is enough content to fill each day. In any case the Month of PHP Security will start on May 1, 2010.</p>
<p><strong>TIP: If you send in an article please ensure that chapters titled &#8220;conclusion&#8221; actually contain a conclusion and not &#8220;WE ARE THE MOST AWESOME GUYS IN WEB APP SEC - HERE IS A LINK LIST OF OUR OTHER PROJECTS&#8221;</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.suspekt.org/2010/04/09/mops-cfp-deadline-extension-april-18-2010/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MOPS - Zend Webinar: Secure Application Development with the Zend Framework</title>
		<link>http://www.suspekt.org/2010/04/09/mops-zend-webinar-secure-application-development-with-the-zend-framework/</link>
		<comments>http://www.suspekt.org/2010/04/09/mops-zend-webinar-secure-application-development-with-the-zend-framework/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 05:58:26 +0000</pubDate>
		<dc:creator>Stefan Esser</dc:creator>
		
		<category><![CDATA[PHP]]></category>

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

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

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

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

		<category><![CDATA[Zend Framework]]></category>

		<category><![CDATA[zend webinar]]></category>

		<guid isPermaLink="false">http://www.suspekt.org/?p=346</guid>
		<description><![CDATA[During the Month of PHP Security there will be a Zend Webinar about &#8220;Secure Application Development with the Zend Framework&#8221; by me. While this webinar is not directly connected to the MOPS and the time (5th of May) is just a coincident it fits nicely into the whole MOPS idea. The webinar contains the following [...]]]></description>
			<content:encoded><![CDATA[<p>During the <a href="http://php-security.org">Month of PHP Security </a>there will be a Zend Webinar about <a href="http://www.zend.com/en/company/news/event/webinar-secure-application-development-with-the-zend-framework">&#8220;Secure Application Development with the Zend Framework&#8221;</a> by me. While this webinar is not directly connected to the MOPS and the time (5th of May) is just a coincident it fits nicely into the whole MOPS idea. The webinar contains the following content:</p>
<blockquote><p>More and more developers have started to use Zend Framework for new PHP  application development projects. This changes the way applications are  developed, because more framework components are used and less core PHP  functions. Therefore new guidelines for secure programming are needed.</p>
<p>This  webinar will introduce the audience to Zend Framework features that  help while developing secure applications and to features that result in  security vulnerabilities if wrongly used. Zend Framework&#8217;s own security  features will be explained and evaluated what kind of security problems  still have to be dealt with by the programmer himself.</p></blockquote>
<p>Because I am not entirely sure how many visitors can attend a Zend Webinar you should register early.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.suspekt.org/2010/04/09/mops-zend-webinar-secure-application-development-with-the-zend-framework/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Zend Webinar: Sichere Applikationen auf Basis des Zend Frameworks</title>
		<link>http://www.suspekt.org/2010/03/14/zend-webinar-sichere-applikationen-auf-basis-des-zend-frameworks/</link>
		<comments>http://www.suspekt.org/2010/03/14/zend-webinar-sichere-applikationen-auf-basis-des-zend-frameworks/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 14:17:34 +0000</pubDate>
		<dc:creator>Stefan Esser</dc:creator>
		
		<category><![CDATA[PHP]]></category>

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

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

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

		<category><![CDATA[Zend Framework]]></category>

		<category><![CDATA[zend framework security]]></category>

		<category><![CDATA[zend webinar]]></category>

		<guid isPermaLink="false">http://www.suspekt.org/?p=344</guid>
		<description><![CDATA[Hier einmal ein Announcement in letzter Minute: in zwei Tagen halte ich für Zend ein Webinar über &#8220;Sichere Applikationen auf Basis des Zend Frameworks&#8220;.
Immer mehr PHP-Entwickler setzen das Zend Framework bei der  Programmierung  neuer Applikationen ein. Für die Entwicklung bringt  dies einige  Veränderungen mit sich, da mehr und
mehr Framework-Komponenten  benutzt werden [...]]]></description>
			<content:encoded><![CDATA[<p>Hier einmal ein Announcement in letzter Minute: in zwei Tagen halte ich für Zend ein Webinar über &#8220;<a href="http://www.zend.com/de/company/news/event/webinar-sichere-applikationen-auf-basis-des-zend-frameworks">Sichere Applikationen auf Basis des Zend Frameworks</a>&#8220;.</p>
<blockquote><p>Immer mehr PHP-Entwickler setzen das Zend Framework bei der  Programmierung  neuer Applikationen ein. Für die Entwicklung bringt  dies einige  Veränderungen mit sich, da mehr und<br />
mehr Framework-Komponenten  benutzt werden und immer weniger direkt auf PHP Funktionen  zurückgegriffen wird. Dadurch ändert sich auch der Prozess, wie sichere  Applikationen zu entwickeln sind.</p>
<p>In diesem  Webinar erfahren Sie, welche Features des Zend Frameworks  die  Entwicklung sicherer Applikationen erleichtern, welche Features bei  falschem Einsatz zu Sicherheitsproblemen führen können, welche  Sicherheitsfeatures existieren, wie man sie einsetzt und welche  Sicherheitsprobleme nach wie vor alleine gelöst werden müssen.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.suspekt.org/2010/03/14/zend-webinar-sichere-applikationen-auf-basis-des-zend-frameworks/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Suhosin-Patch 0.9.9.1</title>
		<link>http://www.suspekt.org/2010/03/05/suhosin-patch-0991/</link>
		<comments>http://www.suspekt.org/2010/03/05/suhosin-patch-0991/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 08:26:52 +0000</pubDate>
		<dc:creator>Stefan Esser</dc:creator>
		
		<category><![CDATA[PHP]]></category>

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

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

		<guid isPermaLink="false">http://www.suspekt.org/?p=341</guid>
		<description><![CDATA[Together with the release of PHP 5.3.2 by the PHP team I have released Suhosin-Patch 0.9.9.1 which comes with bugfixes and new features. The changes are:




fixed some crashbugs for IA64 architecture


check return value of mprotect() to ensure that memory is read only - credits: PAX Team


fixed mprotect() call - encrypted pointer was used in revoked [...]]]></description>
			<content:encoded><![CDATA[<p>Together with the release of <a href="http://www.php.net">PHP 5.3.2</a> by the PHP team I have released <a href="http://www.suhosin.org/">Suhosin-Patch 0.9.9.1</a> which comes with bugfixes and new features. The changes are:</p>
<div class="level3">
<div class="level3">
<ul>
<li class="level1">
<div class="li">fixed some crashbugs for IA64 architecture</div>
</li>
<li class="level1">
<div class="li">check return value of mprotect() to ensure that memory is read only - credits: PAX Team</div>
</li>
<li class="level1">
<div class="li">fixed mprotect() call - encrypted pointer was used in revoked 0.9.9 - credits: PAX Team</div>
</li>
<li class="level1">
<div class="li">added additional hardening to destructor protection</div>
</li>
<li class="level1">
<div class="li">added pointer obfuscation to memory manager</div>
</li>
</ul>
</div>
<div class="level3">The most important new feature is the pointer obfuscation inside the PHP memory manager. This mitigation makes it much harder to exploit lots of memory corruptions correctly. Pointer obfuscation is also used to protect the pointer to the read only configuration inside Suhosin-Patch that allows it to be configured by environment variables.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.suspekt.org/2010/03/05/suhosin-patch-0991/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Month of PHP Security - Blog Post Drawing</title>
		<link>http://www.suspekt.org/2010/03/05/month-of-php-security-blog-post-drawing/</link>
		<comments>http://www.suspekt.org/2010/03/05/month-of-php-security-blog-post-drawing/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 08:06:30 +0000</pubDate>
		<dc:creator>Stefan Esser</dc:creator>
		
		<category><![CDATA[PHP]]></category>

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

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

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

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

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

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

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

		<guid isPermaLink="false">http://www.suspekt.org/?p=338</guid>
		<description><![CDATA[While going through the HTTP_REFERER log of the Month of PHP Security website I realised that there are more incoming refers from various blog posts about it than there are submissions to drawing@php-security.org. Like I previously announced we will honor 10 blog postings with 25 EUR amazon coupons. The winners will be selected by random, [...]]]></description>
			<content:encoded><![CDATA[<p>While going through the HTTP_REFERER log of the <a href="http://php-security.org">Month of PHP Security</a> website I realised that there are more incoming refers from various blog posts about it than there are submissions to <a href="mailto:drawing@php-security.org">drawing@php-security.org</a>. Like I <a href="http://www.suspekt.org/2010/02/27/month-of-php-security-2010-call-for-papers/">previously announced</a> we will honor 10 blog postings with 25 EUR amazon coupons. The winners will be selected by random, however only among those we will select that announce their blogpost to us via the email address provided above.</p>
<p>The reasons for this rule is very simple. Without the announcement we would have to look at every new HTTP_REFERER and manually check if it is just spam, an old link to the Month of PHP Bugs, someone who just copied the blog of another person or other nonsense. In addition to that we have to find a contact address of the person who originally has written the entry and ask him/her if he/she wants to take part in the drawing. This would be too much work. Therefore announce your blog posting to <a href="mailto:drawing@php-security.org">drawing@php-security.org</a> or you have no chance of winning one of the coupons.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.suspekt.org/2010/03/05/month-of-php-security-blog-post-drawing/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Patch breaks Suhosin Security Feature in Debian Unstable/Testing</title>
		<link>http://www.suspekt.org/2010/02/27/debian-breaks-suhosin-security-feature/</link>
		<comments>http://www.suspekt.org/2010/02/27/debian-breaks-suhosin-security-feature/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 18:52:46 +0000</pubDate>
		<dc:creator>Stefan Esser</dc:creator>
		
		<category><![CDATA[PHP]]></category>

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

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

		<category><![CDATA[debian security fail]]></category>

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

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

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

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

		<guid isPermaLink="false">http://www.suspekt.org/?p=325</guid>
		<description><![CDATA[Two days ago I installed a mail client on my reinstalled desktop system that was not doing anything for 2 month and checked mails of the hardened-php account that were not checked for 2 months. Usually noone uses this email account to contact me, but the Suhosin bug reports sometimes end up there. While killing [...]]]></description>
			<content:encoded><![CDATA[<p>Two days ago I installed a mail client on my reinstalled desktop system that was not doing anything for 2 month and checked mails of the hardened-php account that were not checked for 2 months. Usually noone uses this email account to contact me, but the Suhosin bug reports sometimes end up there. While killing thousands of SPAM messages I also found a message from the Debian PHP maintainers, dating back to the 10th February 2010, telling me about a crash problem inside the Suhosin patch. The email also contained their solution to the problem: a patch for the suhosin patch. You can view this patch <a href="http://git.debian.org/?p=pkg-php/php.git;a=blob;f=debian/patches/suhosin_page_size_fixes.patch">here</a>. However you should not commit this patch to your PHP because it does not solve the problem correctly.</p>
<p>I previously blogged about one of the <a href="http://www.suspekt.org/2009/08/13/suhosin-patch-098-for-php-530-beta-please-test/">new features</a> in Suhosin Patch for PHP 5.3.x. It is now possible to adjust several internal features by setting certain environment variables on startup. This includes the memory manager canary protection, the sanitization of free memory blocks, the protection of linked lists and hashtables. When a Suhosin patched PHP starts the environment variables are evaluated and the suhosin config is written into a variable called suhosin_config.</p>
<p>It should be obvious that this kind of feature comes with a little problem. Certain bytes in memory now control if Suhosin&#8217;s internal memory protections are activated or not. This means that a memory corruption vulnerability in PHP could be used by an attacker to overwrite the config variable and disable the security. Because of this Suhosin Patch tries to align the suhosin_config variable to a page boundary and then set it to read only.</p>

<div class="wp_syntax"><div class="code"><pre class="c"><span style="color: #808080; font-style: italic;">/* hack that needs to be fixed */</span>
<span style="color: #339933;">#ifndef PAGE_SIZE</span>
<span style="color: #339933;">#define PAGE_SIZE 4096</span>
<span style="color: #339933;">#endif</span>
&nbsp;
<span style="color: #339933;">#ifdef ZEND_WIN32</span>
__declspec<span style="color: #009900;">&#40;</span>align<span style="color: #009900;">&#40;</span>PAGE_SIZE<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">#endif</span>
<span style="color: #993333;">char</span> suhosin_config<span style="color: #009900;">&#91;</span>PAGE_SIZE<span style="color: #009900;">&#93;</span>
<span style="color: #339933;">#if defined(__GNUC__)</span>
__attribute__ <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>aligned<span style="color: #009900;">&#40;</span>PAGE_SIZE<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">#endif</span>
;
&nbsp;
<span style="color: #993333;">static</span> <span style="color: #993333;">void</span> suhosin_write_protect_configuration<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #339933;">#if defined(__GNUC__)</span>
   mprotect<span style="color: #009900;">&#40;</span>suhosin_config, PAGE_SIZE, PROT_READ<span style="color: #009900;">&#41;</span>;
<span style="color: #339933;">#endif</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The implementation has some problems. First of all it only works in case of a GNU C compiler. The second and more serious problem is that it assumes that the PAGE_SIZE is smaller than or equal to 4096. Otherwise mprotect() will not correctly work. On systems where the PAGE_SIZE is bigger than 4096 the mprotect() will either fail or set too many bytes to read only. In case of a write access after the suhosin_config variable this can lead to a crash.</p>
<p>The Debian people saw this crash on some architectures and reacted with a patch. However they did misunderstand the security idea behind it and therefore their patch looks like this.</p>

<div class="wp_syntax"><div class="code"><pre class="c"><span style="color: #993333;">char</span> <span style="color: #339933;">*</span>suhosin_config <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">NULL</span>;
&nbsp;
<span style="color: #993333;">static</span> <span style="color: #993333;">void</span> suhosin_write_protect_configuration<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #339933;">#if defined(__GNUC__)</span>
   mprotect<span style="color: #009900;">&#40;</span>suhosin_config, sysconf<span style="color: #009900;">&#40;</span>_SC_PAGESIZE<span style="color: #009900;">&#41;</span>, PROT_READ<span style="color: #009900;">&#41;</span>;
<span style="color: #339933;">#endif</span>
<span style="color: #009900;">&#125;</span>
...
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>suhosin_config<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   suhosin_config <span style="color: #339933;">=</span> mmap<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">NULL</span>, sysconf<span style="color: #009900;">&#40;</span>_SC_PAGESIZE<span style="color: #009900;">&#41;</span>, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, <span style="color: #cc66cc;">-1</span>, <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>;
   <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>suhosin_config <span style="color: #339933;">==</span> MAP_FAILED<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      perror<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;suhosin&quot;</span><span style="color: #009900;">&#41;</span>;
      _exit<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>;
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The Debian maintainers tried to fix the problem by replacing the aligned suhosin_config variable with a pointer. They then allocate a single memory mapped page and set it to read only. While this fixes the possible crash it shows that the Debian PHP maintainers did not fully understand the idea behind that code. The patch ensures that the suhosin configuration is set to read only, but now a memory corruption exploit can just overwrite the suhosin_config pointer and let it point to a memory area that contains a new configuration.</p>
<p><del datetime="2010-02-28T18:44:06+00:00">A correct fix would be to check if the dynamic page size is indeed bigger than 4096 and in this case just warn the user that he should recompile PHP with a bigger PAGE_SIZE definition and do not set the variable to read only in this case. But this might arise the next problem that the PAGE_SIZE might exceed the maximum alignment that the compiler supports.</del></p>
<p><strong>UPDATE:</strong> I rewrote several parts of this blog entry to make it less critic and sound less aggressive. I spent the day discussing possible fixes and other problems with the current solution. The current solution is also not safe in all cases (all OS/architectures/compilers) because of intermediate pointers introduced by the compiler that are invisible at the C level. The solution to this is that the runtime configurability of Suhosin will become optional and can be selected at compile time. If the runtime configurability is selected the sysconf() method will be used to determine the correct page size. The pointer however will be protected by pointer obfuscation/encryption and maybe checksums.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.suspekt.org/2010/02/27/debian-breaks-suhosin-security-feature/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
