<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>

<channel>
	<title>sizzo.org &#187; Facebook</title>
	<atom:link href="http://sizzo.org/wp/tag/facebook/feed" rel="self" type="application/rss+xml" />
	<link>http://sizzo.org/wp</link>
	<description></description>
	<pubDate>Tue, 30 Dec 2008 04:02:10 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>DCPHP Talk</title>
		<link>http://sizzo.org/wp/2007/11/dcphp-talk</link>
		<comments>http://sizzo.org/wp/2007/11/dcphp-talk#comments</comments>
		<pubDate>Sat, 24 Nov 2007 08:53:17 +0000</pubDate>
		<dc:creator>screen</dc:creator>
		
		<category><![CDATA[PHP]]></category>

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

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

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

		<guid isPermaLink="false">http://sizzo.org/wp/2007/11/24/dcphp-talk/</guid>
		<description><![CDATA[I&#8217;ve been traveling a lot and almost forgot to get up the slides from my talk in DC a couple weeks ago. If you&#8217;d like to check out the slides, they are available in the Talks section. I had a great time giving this talk and meeting the great DC PHP guys as well as [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been traveling a lot and almost forgot to get up the slides from my talk in DC a couple weeks ago. If you&#8217;d like to check out the slides, they are available in the <a href="http://sizzo.org/talks/">Talks</a> section. I had a great time giving this talk and meeting the great DC PHP guys as well as hanging out with some of the OmniTI folks.</p>
<p><img id="image13" src="http://sizzo.org/wp/wp-content/uploads/2007/11/dcphpconference2007.png" alt="DCPHP2007" /></p>
]]></content:encoded>
			<wfw:commentRss>http://sizzo.org/wp/2007/11/dcphp-talk/feed</wfw:commentRss>
		</item>
		<item>
		<title>You&#8217;re Source Code is Showing</title>
		<link>http://sizzo.org/wp/2007/09/youre-source-code-is-showing</link>
		<comments>http://sizzo.org/wp/2007/09/youre-source-code-is-showing#comments</comments>
		<pubDate>Tue, 25 Sep 2007 06:21:31 +0000</pubDate>
		<dc:creator>screen</dc:creator>
		
		<category><![CDATA[PHP]]></category>

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

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

		<guid isPermaLink="false">http://sizzo.org/wp/2007/09/24/youre-source-code-is-showing/</guid>
		<description><![CDATA[We&#8217;ve all seen Apache serve up some source code when it should have been parsing PHP, or whatever you&#8217;re server side language of choice is, but what can we do to prevent it?
Although it seems improbable I have seen a case where this could be attributed to achieving a mysteriously unstable Apache or PHP state. [...]]]></description>
			<content:encoded><![CDATA[<p><img align="left" style="margin: 0px 10px 3px 0px" alt="01-021-sm.jpg" id="image15" src="http://sizzo.org/wp/wp-content/uploads/2007/09/01-021-sm.thumbnail.jpg" />We&#8217;ve all seen Apache serve up some source code when it should have been parsing PHP, or whatever you&#8217;re server side language of choice is, but what can we do to prevent it?</p>
<p>Although it seems improbable I have seen a case where this could be attributed to achieving a mysteriously unstable Apache or PHP state. This particular server happened to be mis-configured to load <a target="_blank" title="APC Manual Page" href="http://www.php.net/apc">APC</a> as a shared object even though it was already compiled into PHP statically. I recently tried to reproduce this but failed when running a recent build of APC. I do know, however, that removing the erroneous apc.so solved the problem.</p>
<p>We, at Facebook, recently encountered a similar issue resulting in the same outcome. It was the middle of August when I got a message from a user wondering why we were showing him &#8216;codes&#8217; instead of search results when he was searching for a friend. He was able to reach me because my email address is in the first 10 lines of the source code for s.php. This source code was visible to him rather than the search results he was looking for so I dropped everything to try and figure out why.</p>
<p>This shouldn&#8217;t have been possible running the Apache modifications we have in place. We had already patched Apache to detect requested PHP extensions that return a non-handled response, preventing source code from being returned. Although similar results can be achieved using an Apache module such as mod_security, this module only supports output filtering in Apache 2. We decided to patch Apache 1.3 directly which has the added benefit of averting a potential configuration error. This patch for Apache 1.3.37/1.3.39 is now available <a title="Apache Source Defense Patch" href="http://tekrat.com/2007/09/24/apache-source-defense/">here</a>.</p>
<p>After looking at every possible angle, I was unable to configure our Apache build to serve source code even if we wanted to. What we eventually found was a single server running a standard distribution build of Apache in our production pool of several thousand web severs. A lot has been posted online blaming PHP for this, however, the server that we eventually found was not running PHP. In order to criticize PHP we should scrutinize the implementation details of the language itself and eschew the attributes that are common among all web server programming languages.</p>
<p>These sorts of issues can and do happen to anyone, large or small, so what can you do to minimize the damage when this situation arises? As I mentioned earlier, you can use a module like mod_security and it&#8217;s response parsing features, however this does not come free of cost. You&#8217;ll need to be running Apache 2.x and if you are concerned with PHP performance this is not a good choice today, see Ilia Alshanetsky&#8217;s article <a target="_blank" title="Apache 1 vs Apache 2 Performance" href="http://ilia.ws/archives/32-Apache-1-vs-Apache-2-Performance.html">Apache 1 vs Apache 2 Performance</a>. If you&#8217;re already running Apache 1.x you can take a look at our patch but you can also do more, like abstract all PHP pages by implementing an include which evaluates code outside of the document root:</p>
<p><code>/siteroot/docroot/index.php:<br />
include_once '/siteroot/site/index.php';  // point to the real index.php<br />
?></code></p>
<p>Although not absolutely preventing source code leaks, this method, proposed in the blog <a target="_blank" href="http://www.nik.com.au/archives/2007/08/11/learning-from-facebook-preventing-php-leakage">New Web Order</a>, is sound advice and minimizes risk when an exposure occurs. In an optimized APC environment, where <a title="APC stat=0 description" href="http://www.php.net/apc#ini.apc.stat">apc.stat=0</a>, this added abstraction should come at little to no cost in performance.</p>
<p>Simple problems such as this can affect anyone large or small and as the complexity of an environment increases it requires more robust auditing and monitoring. Open source monitoring toolkits largely lack the necessary features to scale in support of these environments so it is essential that we continue to build and improve these systems internally to prevent and detect problems like this. If you are interested in building these types of systems with us or working on PHP with us, feel free to contact me or checkout <a target="_blank" title="Facebook Jobs" href="http://www.facebook.com/jobs/">Facebook Jobs</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sizzo.org/wp/2007/09/youre-source-code-is-showing/feed</wfw:commentRss>
		</item>
		<item>
		<title>PHP&#124;works Talk</title>
		<link>http://sizzo.org/wp/2007/09/phpworks-talk</link>
		<comments>http://sizzo.org/wp/2007/09/phpworks-talk#comments</comments>
		<pubDate>Fri, 14 Sep 2007 18:47:27 +0000</pubDate>
		<dc:creator>screen</dc:creator>
		
		<category><![CDATA[PHP]]></category>

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

		<category><![CDATA[PHP|Works]]></category>

		<category><![CDATA[Terry Chay]]></category>

		<guid isPermaLink="false">http://sizzo.org/wp/2007/09/14/phpworks-talk/</guid>
		<description><![CDATA[I did my first PHP conference talk yesterday at PHP&#124;works. I think it went pretty well considering it was my first for this presentation. If you&#8217;d like to check it out the slides are available in my new Talks section. Now back to being entertained by Terry Chay&#8217;s talk.

]]></description>
			<content:encoded><![CDATA[<p>I did my first PHP conference talk yesterday at <a href="http://works.phparch.com/c/p/index" target="_blank">PHP|works</a>. I think it went pretty well considering it was my first for this presentation. If you&#8217;d like to check it out the slides are available in my new <a href="http://sizzo.org/talks/">Talks</a> section. Now back to being entertained by <a href="http://terrychay.com/blog/" target="_blank" title="Thats fucking viral">Terry Chay&#8217;s</a> talk.</p>
<p><img id="image12" src="http://sizzo.org/wp/wp-content/uploads/2007/09/phpworks2007.thumbnail.png" alt="PHP|works" /></p>
]]></content:encoded>
			<wfw:commentRss>http://sizzo.org/wp/2007/09/phpworks-talk/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
