<?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>Mon, 15 Mar 2010 06:31:21 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Ruggie</title>
		<link>http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1559</link>
		<dc:creator>Ruggie</dc:creator>
		<pubDate>Sat, 23 May 2009 00:19:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1559</guid>
		<description>Use SCRIPT_NAME instead of PHP_SELF</description>
		<content:encoded><![CDATA[<p>Use SCRIPT_NAME instead of PHP_SELF</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dry_gin</title>
		<link>http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1555</link>
		<dc:creator>dry_gin</dc:creator>
		<pubDate>Thu, 14 May 2009 21:04:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1555</guid>
		<description>I mean you could probably spam in emails a crafted link to legitimate web site, where at the end of file name it will send user cookies for example to some web-based email sender.
so the link will look ok in spammer's email, and so users will probably click on it...
ok, i guess it make sense to validate php_self after all...</description>
		<content:encoded><![CDATA[<p>I mean you could probably spam in emails a crafted link to legitimate web site, where at the end of file name it will send user cookies for example to some web-based email sender.<br />
so the link will look ok in spammer&#8217;s email, and so users will probably click on it&#8230;<br />
ok, i guess it make sense to validate php_self after all&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dry_gin</title>
		<link>http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1554</link>
		<dc:creator>dry_gin</dc:creator>
		<pubDate>Thu, 14 May 2009 20:54:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1554</guid>
		<description>What kind of harm this could possibly (but realistically) do, except for displaying some modified html to the "hacker" HIMSELF (only) ?
i mean i don't see a way to alternate php code itself or displaying some useful info like database structure or php source code using this exploit...
please explain!</description>
		<content:encoded><![CDATA[<p>What kind of harm this could possibly (but realistically) do, except for displaying some modified html to the &#8220;hacker&#8221; HIMSELF (only) ?<br />
i mean i don&#8217;t see a way to alternate php code itself or displaying some useful info like database structure or php source code using this exploit&#8230;<br />
please explain!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jszym</title>
		<link>http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1477</link>
		<dc:creator>Jszym</dc:creator>
		<pubDate>Wed, 11 Mar 2009 00:22:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1477</guid>
		<description>@j squid, local/relative urls are fine and dandy however is not always a possible solutions. Certain senarios simply require a full path.

Let's say for example that I want to redirect ppl to the former page so you need to pass the current page to the next. PHP_SELF is very useful. Just escape and validate properly and you'll be fine.</description>
		<content:encoded><![CDATA[<p>@j squid, local/relative urls are fine and dandy however is not always a possible solutions. Certain senarios simply require a full path.</p>
<p>Let&#8217;s say for example that I want to redirect ppl to the former page so you need to pass the current page to the next. PHP_SELF is very useful. Just escape and validate properly and you&#8217;ll be fine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: j squid</title>
		<link>http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1379</link>
		<dc:creator>j squid</dc:creator>
		<pubDate>Sun, 21 Dec 2008 06:51:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2008/01/14/exploiting-php-self/#comment-1379</guid>
		<description>Um... have people never heard of local/relative  urls????

saying &#60;a href='&#60;?php echo $_SERVER[PHP_SELF]?&#62;/cow/lame.php'&#62;link&#60;/a&#62; is a retarded waste of time.

try &#60;a href='cow/lame.php' &#62;link&#60;/a&#62; or for a form action, action=''.... not 'action='&#60;?php blah blah self?&#62;
it's such a waste of time.</description>
		<content:encoded><![CDATA[<p>Um&#8230; have people never heard of local/relative  urls????</p>
<p>saying &lt;a href=&#8217;&lt;?php echo $_SERVER[PHP_SELF]?&gt;/cow/lame.php&#8217;&gt;link&lt;/a&gt; is a retarded waste of time.</p>
<p>try &lt;a href=&#8217;cow/lame.php&#8217; &gt;link&lt;/a&gt; or for a form action, action=&#8221;&#8230;. not &#8216;action=&#8217;&lt;?php blah blah self?&gt;<br />
it&#8217;s such a waste of time.</p>
]]></content:encoded>
	</item>
	<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>
</channel>
</rss>
