<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Exploiting PHP SELF</title>
	<atom:link href="http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/</link>
	<description>A tool for designers dealing with programmers dealing with designers...</description>
	<pubDate>Tue, 30 Sep 2008 23:39:24 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: nuntius</title>
		<link>http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1291</link>
		<dc:creator>nuntius</dc:creator>
		<pubDate>Wed, 27 Aug 2008 14:23:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1291</guid>
		<description>Bipin, Busby is wrong, apparently he doesn't understand what this page is about... this is how you do it. Note however, that as this page is describing, this can be exploited. 

&#60;form method="post" action="&#60;?php echo $_SERVER['PHP_SELF']; ?&#62;"&#62;
  &#60;!-- My Form --&#62;
&#60;/form&#62;

Check out this page also:
http://www.gfx-depot.com/forum/-php-server-php-self-validation-t-1636.html</description>
		<content:encoded><![CDATA[<p>Bipin, Busby is wrong, apparently he doesn&#8217;t understand what this page is about&#8230; this is how you do it. Note however, that as this page is describing, this can be exploited. </p>
<p>&lt;form method=&#8221;post&#8221; action=&#8221;&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;&#8221;&gt;<br />
  &lt;!&#8211; My Form &#8211;&gt;<br />
&lt;/form&gt;</p>
<p>Check out this page also:<br />
<a href="http://www.gfx-depot.com/forum/-php-server-php-self-validation-t-1636.html" rel="nofollow">http://www.gfx-depot.com/forum/-php-server-php-self-validation-t-1636.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Busby SEO Challenge</title>
		<link>http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1282</link>
		<dc:creator>Busby SEO Challenge</dc:creator>
		<pubDate>Tue, 12 Aug 2008 03:31:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1282</guid>
		<description>If you want to past variable on the same page you need to pass it by using GET statement.</description>
		<content:encoded><![CDATA[<p>If you want to past variable on the same page you need to pass it by using GET statement.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bipin</title>
		<link>http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1240</link>
		<dc:creator>bipin</dc:creator>
		<pubDate>Tue, 27 May 2008 08:13:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1240</guid>
		<description>&#60;form method=POST action="&#60;?php echo $PHP_SELF;'SelectedState=$SelectedState' ?&#62;" &#62;

in the above line i am trying to pass a variables value onto the same page but its not working can anyone suggest me the syntax</description>
		<content:encoded><![CDATA[<p>&lt;form method=POST action=&#8221;&lt;?php echo $PHP_SELF;&#8217;SelectedState=$SelectedState&#8217; ?&gt;&#8221; &gt;</p>
<p>in the above line i am trying to pass a variables value onto the same page but its not working can anyone suggest me the syntax</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Diego</title>
		<link>http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1075</link>
		<dc:creator>Diego</dc:creator>
		<pubDate>Tue, 15 Jan 2008 05:53:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1075</guid>
		<description>the test 1 fails on PHP 5.2.4 without any special extension, etc
The error I get is "Warning: Header may not contain more than a single header, new line detected. in /var/www/htdocs/php_self.php on line 4"
The other 3 tests do work as expected.</description>
		<content:encoded><![CDATA[<p>the test 1 fails on PHP 5.2.4 without any special extension, etc<br />
The error I get is &#8220;Warning: Header may not contain more than a single header, new line detected. in /var/www/htdocs/php_self.php on line 4&#8243;<br />
The other 3 tests do work as expected.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guillaume Rossolini</title>
		<link>http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1074</link>
		<dc:creator>Guillaume Rossolini</dc:creator>
		<pubDate>Mon, 14 Jan 2008 23:55:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1074</guid>
		<description>Hi,
You might want to escape the variable in header() by calling either urlencode(), and that should be enough. Please remember that each output medium has its proper escaping mechanism.  The injection there happens mostly because you don't escape the output.
Regards,</description>
		<content:encoded><![CDATA[<p>Hi,<br />
You might want to escape the variable in header() by calling either urlencode(), and that should be enough. Please remember that each output medium has its proper escaping mechanism.  The injection there happens mostly because you don&#8217;t escape the output.<br />
Regards,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Esser</title>
		<link>http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1072</link>
		<dc:creator>Stefan Esser</dc:creator>
		<pubDate>Mon, 14 Jan 2008 20:51:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1072</guid>
		<description>@Eric:
There is noone to convince to fix this stuff. PHP_SELF is filled by the webserver. Apache supports PATH_INFO therefore this kind of path ends up in PHP_SELF.

This problem is known for ages and still many sites are vulnerable to this...

And well there is always the possibility to just install the Suhosin Extension and you are automatically secure from this kind of XSS.</description>
		<content:encoded><![CDATA[<p>@Eric:<br />
There is noone to convince to fix this stuff. PHP_SELF is filled by the webserver. Apache supports PATH_INFO therefore this kind of path ends up in PHP_SELF.</p>
<p>This problem is known for ages and still many sites are vulnerable to this&#8230;</p>
<p>And well there is always the possibility to just install the Suhosin Extension and you are automatically secure from this kind of XSS.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Francesc Rosàs</title>
		<link>http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1071</link>
		<dc:creator>Francesc Rosàs</dc:creator>
		<pubDate>Mon, 14 Jan 2008 20:00:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1071</guid>
		<description>@Eric:
I didn't know it. Thanks! Luckily I don't use single quotes at HTML level.

Anyway I'm gonna change my HTML escaping function to this:

function eh ($string)
{
    echo htmlspecialchars($string, ENT_QUOTES);
}

Being so essential, I don't understand why PHP doesn't have something like this built in.</description>
		<content:encoded><![CDATA[<p>@Eric:<br />
I didn&#8217;t know it. Thanks! Luckily I don&#8217;t use single quotes at HTML level.</p>
<p>Anyway I&#8217;m gonna change my HTML escaping function to this:</p>
<p>function eh ($string)<br />
{<br />
    echo htmlspecialchars($string, ENT_QUOTES);<br />
}</p>
<p>Being so essential, I don&#8217;t understand why PHP doesn&#8217;t have something like this built in.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Butera</title>
		<link>http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1070</link>
		<dc:creator>Eric Butera</dc:creator>
		<pubDate>Mon, 14 Jan 2008 15:58:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1070</guid>
		<description>@Francesc:
You need to use ENT_QUOTES as the second parameter just in case because by default ' will not be encoded.

@Gareth:
Thank you for the time for this post!  Hopefully now this will be enough to convince the powers that be to fix this stuff.</description>
		<content:encoded><![CDATA[<p>@Francesc:<br />
You need to use ENT_QUOTES as the second parameter just in case because by default &#8216; will not be encoded.</p>
<p>@Gareth:<br />
Thank you for the time for this post!  Hopefully now this will be enough to convince the powers that be to fix this stuff.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gareth Heyes</title>
		<link>http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1069</link>
		<dc:creator>Gareth Heyes</dc:creator>
		<pubDate>Mon, 14 Jan 2008 15:52:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1069</guid>
		<description>@Sean

Yeah that's pretty bad, I know it isn't new but a reader asked me the question so it can't do any harm bringing the subject up again.</description>
		<content:encoded><![CDATA[<p>@Sean</p>
<p>Yeah that&#8217;s pretty bad, I know it isn&#8217;t new but a reader asked me the question so it can&#8217;t do any harm bringing the subject up again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean Coates</title>
		<link>http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1068</link>
		<dc:creator>Sean Coates</dc:creator>
		<pubDate>Mon, 14 Jan 2008 15:41:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1068</guid>
		<description>I blogged about this 2.5 years ago, here: http://blog.phpdoc.info/archives/13-XSS-Woes.html

(-:

S</description>
		<content:encoded><![CDATA[<p>I blogged about this 2.5 years ago, here: <a href="http://blog.phpdoc.info/archives/13-XSS-Woes.html" rel="nofollow">http://blog.phpdoc.info/archives/13-XSS-Woes.html</a></p>
<p>(-:</p>
<p>S</p>
]]></content:encoded>
	</item>
</channel>
</rss>
