<?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"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:series="http://unfoldingneurons.com/"
> <channel><title>Comments on: Tips for Protecting Querystring Keys &amp; Values in&#160;PHP</title> <atom:link href="http://davidwalsh.name/tips-protecting-querystring-keys-values-php/feed" rel="self" type="application/rss+xml" /><link>http://davidwalsh.name/tips-protecting-querystring-keys-values-php</link> <description>Legendary scribbles about JavaScript, HTML5, AJAX, PHP, CSS, and ∞.</description> <lastBuildDate>Thu, 09 Feb 2012 15:40:33 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3</generator> <item><title>By: Jamie</title><link>http://davidwalsh.name/tips-protecting-querystring-keys-values-php/comment-page-1#comment-28118</link> <dc:creator>Jamie</dc:creator> <pubDate>Tue, 27 Dec 2011 09:10:31 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=271#comment-28118</guid> <description>There is very little reason I can see for using query strings, ever! Ok one, debugging.
I work for a company who sells theatre tickets. We use a very good database system that is used by many of the household known branded ticket agents. So when any large scale concert goes on sale, I can always get tickets quickly and easily (sometimes before they go on sale!)... Why because the practise of using querystrings.
However, I have always recommended (although people don&#039;t always listen!) that using form POSTs are far better. Yes people in the know will second guess that you are supplying information to the next page but the average joe isn&#039;t going to check the source code. And the average Joe isn&#039;t going to then copy the source code onto a page and submit it. It takes the temptation out of the URL bar.
If you are supplying info to your own page, use a POST and if you ise it often store it in a Session variable. That way it is only seen once at point of entry, the most hidden way needed.
There is also very little reason (with a little slightly optional validation) why you couldn&#039;t ask external sites to use forms either. If you offer commision it is also then easier to collect a referral URL or id.I imagine this may be a little controversial judging from past reactions and I am open to changing my mind if theres a compelling argument.</description> <content:encoded><![CDATA[<p>There is very little reason I can see for using query strings, ever! Ok one, debugging.<br
/> I work for a company who sells theatre tickets. We use a very good database system that is used by many of the household known branded ticket agents. So when any large scale concert goes on sale, I can always get tickets quickly and easily (sometimes before they go on sale!)&#8230; Why because the practise of using querystrings.<br
/> However, I have always recommended (although people don&#8217;t always listen!) that using form POSTs are far better. Yes people in the know will second guess that you are supplying information to the next page but the average joe isn&#8217;t going to check the source code. And the average Joe isn&#8217;t going to then copy the source code onto a page and submit it. It takes the temptation out of the URL bar.<br
/> If you are supplying info to your own page, use a POST and if you ise it often store it in a Session variable. That way it is only seen once at point of entry, the most hidden way needed.<br
/> There is also very little reason (with a little slightly optional validation) why you couldn&#8217;t ask external sites to use forms either. If you offer commision it is also then easier to collect a referral URL or id.</p><p>I imagine this may be a little controversial judging from past reactions and I am open to changing my mind if theres a compelling argument.</p> ]]></content:encoded> </item> <item><title>By: John</title><link>http://davidwalsh.name/tips-protecting-querystring-keys-values-php/comment-page-1#comment-22346</link> <dc:creator>John</dc:creator> <pubDate>Tue, 18 Jan 2011 09:15:11 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=271#comment-22346</guid> <description>I have always wanted to know how do I remove/clear the querystring portion from the URL after I extacted the data in the same function?</description> <content:encoded><![CDATA[<p>I have always wanted to know how do I remove/clear the querystring portion from the URL after I extacted the data in the same function?</p> ]]></content:encoded> </item> <item><title>By: rabia</title><link>http://davidwalsh.name/tips-protecting-querystring-keys-values-php/comment-page-1#comment-16725</link> <dc:creator>rabia</dc:creator> <pubDate>Thu, 01 Apr 2010 06:41:17 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=271#comment-16725</guid> <description>hi...
im using php4 and dw_encrypt is not eorking
here is the code in which i embedded dw_encrypt
&lt;a href=&quot;search.php?msg= &quot;&gt;hi&lt;/a&gt;</description> <content:encoded><![CDATA[<p>hi&#8230;<br
/> im using php4 and dw_encrypt is not eorking<br
/> here is the code in which i embedded dw_encrypt<br
/> &lt;a href=&quot;search.php?msg= &#8220;&gt;hi</p> ]]></content:encoded> </item> <item><title>By: Rabe'e Wahab</title><link>http://davidwalsh.name/tips-protecting-querystring-keys-values-php/comment-page-1#comment-2610</link> <dc:creator>Rabe'e Wahab</dc:creator> <pubDate>Wed, 06 Aug 2008 12:49:20 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=271#comment-2610</guid> <description>thanx alot .... this post is simple and very userful</description> <content:encoded><![CDATA[<p>thanx alot &#8230;. this post is simple and very userful</p> ]]></content:encoded> </item> <item><title>By: Martien de Jong</title><link>http://davidwalsh.name/tips-protecting-querystring-keys-values-php/comment-page-1#comment-2545</link> <dc:creator>Martien de Jong</dc:creator> <pubDate>Sat, 02 Aug 2008 12:37:38 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=271#comment-2545</guid> <description>I agree with Jay about the varnames and encryption thing.
Authorization should be done in the back-end code, not in the querystring ;)
When we make sure someone cannot access content they are not allowed to, we can user any variable we want in the querystring, since we know nothing is gonna happen.
As a suggestion, can you add a section about strings vs integers (ie. userID vs account name) and how to handle it.
That would be really nice.
Regards,
Martien de Jong</description> <content:encoded><![CDATA[<p>I agree with Jay about the varnames and encryption thing.<br
/> Authorization should be done in the back-end code, not in the querystring ;)<br
/> When we make sure someone cannot access content they are not allowed to, we can user any variable we want in the querystring, since we know nothing is gonna happen.<br
/> As a suggestion, can you add a section about strings vs integers (ie. userID vs account name) and how to handle it.<br
/> That would be really nice.<br
/> Regards,<br
/> Martien de Jong</p> ]]></content:encoded> </item> <item><title>By: Jay</title><link>http://davidwalsh.name/tips-protecting-querystring-keys-values-php/comment-page-1#comment-1409</link> <dc:creator>Jay</dc:creator> <pubDate>Fri, 30 May 2008 13:13:54 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=271#comment-1409</guid> <description>Essential PHP Security is the way to go, this is what we use as our handbook. It&#039;s really short and pretty thorough:http://www.amazon.com/Essential-PHP-Security-Chris-Shiflett/dp/059600656X/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1212153167&amp;sr=8-1</description> <content:encoded><![CDATA[<p>Essential PHP Security is the way to go, this is what we use as our handbook. It&#8217;s really short and pretty thorough:</p><p><a
href="http://www.amazon.com/Essential-PHP-Security-Chris-Shiflett/dp/059600656X/ref=pd_bbs_sr_1?ie=UTF8&#038;s=books&#038;qid=1212153167&#038;sr=8-1" rel="nofollow">http://www.amazon.com/Essential-PHP-Security-Chris-Shiflett/dp/059600656X/ref=pd_bbs_sr_1?ie=UTF8&#038;s=books&#038;qid=1212153167&#038;sr=8-1</a></p> ]]></content:encoded> </item> <item><title>By: Jay</title><link>http://davidwalsh.name/tips-protecting-querystring-keys-values-php/comment-page-1#comment-1401</link> <dc:creator>Jay</dc:creator> <pubDate>Thu, 29 May 2008 21:42:54 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=271#comment-1401</guid> <description>By one way I mean you can&#039;t decrypt hashes so that&#039;s not a good way of passing data if you need it decrypted.</description> <content:encoded><![CDATA[<p>By one way I mean you can&#8217;t decrypt hashes so that&#8217;s not a good way of passing data if you need it decrypted.</p> ]]></content:encoded> </item> <item><title>By: Jay</title><link>http://davidwalsh.name/tips-protecting-querystring-keys-values-php/comment-page-1#comment-1400</link> <dc:creator>Jay</dc:creator> <pubDate>Thu, 29 May 2008 21:42:07 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=271#comment-1400</guid> <description>Ya don&#039;t do the changing of var names, that really doesn&#039;t get you any more security. Also passing hashed deals as parameters doesn&#039;t really make sense to me, I&#039;d rather use an encrypted session to handle those. And hash of course is one way.The main way to secure php pages is just like securing any other language, escaping input and output. Most programmers escape input but alot still don&#039;t escape output which is why XSS hacks are so rampant. I am guilty of this as well sometimes, usually trusting data from a database even tho it originated for a user. Technically you should really escape all data regardless.</description> <content:encoded><![CDATA[<p>Ya don&#8217;t do the changing of var names, that really doesn&#8217;t get you any more security. Also passing hashed deals as parameters doesn&#8217;t really make sense to me, I&#8217;d rather use an encrypted session to handle those. And hash of course is one way.</p><p>The main way to secure php pages is just like securing any other language, escaping input and output. Most programmers escape input but alot still don&#8217;t escape output which is why XSS hacks are so rampant. I am guilty of this as well sometimes, usually trusting data from a database even tho it originated for a user. Technically you should really escape all data regardless.</p> ]]></content:encoded> </item> <item><title>By: david</title><link>http://davidwalsh.name/tips-protecting-querystring-keys-values-php/comment-page-1#comment-1359</link> <dc:creator>david</dc:creator> <pubDate>Wed, 28 May 2008 13:01:30 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=271#comment-1359</guid> <description>@Steffan:  Oh wow -- I have no clue how I missed that.  I do have an encrypt/decrypt function but the md5 doesn&#039;t do that.  Sorry -- totally whiffed on that one.</description> <content:encoded><![CDATA[<p>@Steffan:  Oh wow &#8212; I have no clue how I missed that.  I do have an encrypt/decrypt function but the md5 doesn&#8217;t do that.  Sorry &#8212; totally whiffed on that one.</p> ]]></content:encoded> </item> <item><title>By: Steffan</title><link>http://davidwalsh.name/tips-protecting-querystring-keys-values-php/comment-page-1#comment-1357</link> <dc:creator>Steffan</dc:creator> <pubDate>Wed, 28 May 2008 10:26:58 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=271#comment-1357</guid> <description>My thought on &quot;Encrypt Querystring Values&quot;&lt;a href=&quot;/profile.php?i=&quot;&gt;Click here&lt;/a&gt;The so called encryption used in this example is actually a hash. The significance of a hash function is you cant reverse the hashed value back to its original value. In opposite to encryption/decryption, there is no de-hash. So if you want to decrypt Http get values use encryption like RSA, 3DES etc.Different approach: you can add a md5 hash to verify your Http Get parameters and check if non of them has been modified. Further you would need a secret value which you include within your hash.&lt;a href=&quot;/profile.php?user_id=&amp;check=&quot;&gt;Click here&lt;/a&gt;</description> <content:encoded><![CDATA[<p>My thought on &#8220;Encrypt Querystring Values&#8221;</p><p>&lt;a href=&#8221;/profile.php?i=&#8221;&gt;Click here</p><p>The so called encryption used in this example is actually a hash. The significance of a hash function is you cant reverse the hashed value back to its original value. In opposite to encryption/decryption, there is no de-hash. So if you want to decrypt Http get values use encryption like RSA, 3DES etc.</p><p>Different approach: you can add a md5 hash to verify your Http Get parameters and check if non of them has been modified. Further you would need a secret value which you include within your hash.</p><p>&lt;a href=&#8221;/profile.php?user_id=&amp;check=&#8221;&gt;Click here</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 1/21 queries in 0.014 seconds using disk: basic
Object Caching 858/874 objects using disk: basic

Served from: davidwalsh.name @ 2012-02-09 12:08:51 -->
