<?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/"
> <channel><title>Comments on: Improving security in Wordpress plugins using Nonces</title> <atom:link href="http://www.prelovac.com/vladimir/improving-security-in-wordpress-plugins-using-nonces/feed" rel="self" type="application/rss+xml" /><link>http://www.prelovac.com/vladimir/improving-security-in-wordpress-plugins-using-nonces</link> <description>Web 2.0, Marketing, Analytics, WordPress SEO</description> <lastBuildDate>Sat, 21 Nov 2009 07:43:51 -0600</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>By: Vladimir</title><link>http://www.prelovac.com/vladimir/improving-security-in-wordpress-plugins-using-nonces/comment-page-1#comment-16894</link> <dc:creator>Vladimir</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=803#comment-16894</guid> <description>How do you propose the hacker would hijack a session that uses nonces?</description> <content:encoded><![CDATA[<p>How do you propose the hacker would hijack a session that uses nonces?</p> ]]></content:encoded> </item> <item><title>By: Brenton</title><link>http://www.prelovac.com/vladimir/improving-security-in-wordpress-plugins-using-nonces/comment-page-1#comment-16886</link> <dc:creator>Brenton</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=803#comment-16886</guid> <description>I&#039;ve implemented nonces for the Admin pages of my plugin, but after thinking about this for a while I&#039;m of the opinion that its really not an adequate solution.  Specifically, there are two short comings with this whole approach:
1.  Its NOT a number used once.  Its a number that can be used as many times as you want in 24 hours.  Does this make a difference? Yes!  The whole problem thats trying to be solved is someone hijacking a session (originally, this was just the cookie, but now its the nonce as well).  A 24hr window of opportunity is ridiculous.  A competent hacker would need about 2minutes in your Wordpress installation (if they were organized) to setup a back door: probably less if they had rehearsed it.  Hence my biggest gripe with this types of solutions: a false sense of security.  Nonces only marginally increase your protection, but if you read the way people rave about this principle you would think that all threats have been eliminated.
2.  Its intrusive.  Its a royal pain in the a$$ to mutilate your URLs with this stuff - and even worse when it doesn&#039;t provide effective security.  At least cookies are transparent to URLs!  I can&#039;t count the number of times clients of mine have said &quot;our theme doesn&#039;t use widgets so we want to embed your plugin-generated URLs directly in our theme&quot;.  Sounds like a reasonable request.  But wait!  I need to tell them that those URLs contains nonces and hence you need to fetch them a-new everytime you want to display them.  In effect, they&#039;re dynamic URLs.  That requires them to write PHP code; and over 50% of my clients aren&#039;t PHP programmers.  My point is that this approach takes away some existing flexibility but doesn&#039;t really improve the security of the system in return.
Now that I&#039;ve got that out, I&#039;m going to propose an alternative, just so I won&#039;t be accused of being a whiner.
Go back to the threat and work within the existing constraints.
The threat is session hijacking.  Existing constraints are static URLs.  Proposals:
1. augment session authentication (i.e. cookies) with IP address filtering.  Have Wordpress not only require a valid cookie but a cookie that came from the same IP address it was issued to and was received from.  I know IP addresses can be spoofed but nonce sessions can be spoofed too with far greater ease.  At least with this approach you don&#039;t have to mangle your URLs.
2. Update the cookie value on every request.  Although this sounds good in theory, in practice it would probably cause a lot of false-positive lock-outs which would require the user to log back in again.  And fundamentally, it actually doesn&#039;t resolve the problem: its just reduces the window of opportunity to an incredibly short time.  If a hacker were fast enough (i.e. submitted the next page as you before you did) then they would be let in and you would be locked out.
As you can see, it appears that there might not be an effective solution at this level.  It may simply be that Wordpress does the best it can (using cookies and source IP address) and leave it up to other technologies to provide a comprehensive security solution: e.g. SSL to stop anyone else from eavesdropping on the data sent back and forth.  Perhaps even having Wordpress run its admin functions on a restricted IP port which requires SSL client side authentication to establish the HTTPS connection.  At some point you need to ask yourself, what is the value of the website (asset) I&#039;m protecting? what is the likely investment a typical hacker will make to gain control of that asset?, and is my security system&#039;s cost inline with these values?</description> <content:encoded><![CDATA[<p>I've implemented nonces for the Admin pages of my plugin, but after thinking about this for a while I'm of the opinion that its really not an adequate solution.  Specifically, there are two short comings with this whole approach:<br
/> 1.  Its NOT a number used once.  Its a number that can be used as many times as you want in 24 hours.  Does this make a difference? Yes!  The whole problem thats trying to be solved is someone hijacking a session (originally, this was just the cookie, but now its the nonce as well).  A 24hr window of opportunity is ridiculous.  A competent hacker would need about 2minutes in your Wordpress installation (if they were organized) to setup a back door: probably less if they had rehearsed it.  Hence my biggest gripe with this types of solutions: a false sense of security.  Nonces only marginally increase your protection, but if you read the way people rave about this principle you would think that all threats have been eliminated.<br
/> 2.  Its intrusive.  Its a royal pain in the a$$ to mutilate your URLs with this stuff - and even worse when it doesn't provide effective security.  At least cookies are transparent to URLs!  I can't count the number of times clients of mine have said "our theme doesn't use widgets so we want to embed your plugin-generated URLs directly in our theme".  Sounds like a reasonable request.  But wait!  I need to tell them that those URLs contains nonces and hence you need to fetch them a-new everytime you want to display them.  In effect, they're dynamic URLs.  That requires them to write PHP code; and over 50% of my clients aren't PHP programmers.  My point is that this approach takes away some existing flexibility but doesn't really improve the security of the system in return.<br
/> Now that I've got that out, I'm going to propose an alternative, just so I won't be accused of being a whiner.<br
/> Go back to the threat and work within the existing constraints.<br
/> The threat is session hijacking.  Existing constraints are static URLs.  Proposals:<br
/> 1. augment session authentication (i.e. cookies) with IP address filtering.  Have Wordpress not only require a valid cookie but a cookie that came from the same IP address it was issued to and was received from.  I know IP addresses can be spoofed but nonce sessions can be spoofed too with far greater ease.  At least with this approach you don't have to mangle your URLs.<br
/> 2. Update the cookie value on every request.  Although this sounds good in theory, in practice it would probably cause a lot of false-positive lock-outs which would require the user to log back in again.  And fundamentally, it actually doesn't resolve the problem: its just reduces the window of opportunity to an incredibly short time.  If a hacker were fast enough (i.e. submitted the next page as you before you did) then they would be let in and you would be locked out.<br
/> As you can see, it appears that there might not be an effective solution at this level.  It may simply be that Wordpress does the best it can (using cookies and source IP address) and leave it up to other technologies to provide a comprehensive security solution: e.g. SSL to stop anyone else from eavesdropping on the data sent back and forth.  Perhaps even having Wordpress run its admin functions on a restricted IP port which requires SSL client side authentication to establish the HTTPS connection.  At some point you need to ask yourself, what is the value of the website (asset) I'm protecting? what is the likely investment a typical hacker will make to gain control of that asset?, and is my security system's cost inline with these values?</p> ]]></content:encoded> </item> <item><title>By: Old WordPress Versions Under Attack &#124; WordpressWizard</title><link>http://www.prelovac.com/vladimir/improving-security-in-wordpress-plugins-using-nonces/comment-page-1#comment-16725</link> <dc:creator>Old WordPress Versions Under Attack &#124; WordpressWizard</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=803#comment-16725</guid> <description>[...] Vladimir Prelovac – Improving security in WordPress Plugins using Nonces [...]</description> <content:encoded><![CDATA[<p>[...] Vladimir Prelovac – Improving security in WordPress Plugins using Nonces [...]</p> ]]></content:encoded> </item> <item><title>By: Vladimir</title><link>http://www.prelovac.com/vladimir/improving-security-in-wordpress-plugins-using-nonces/comment-page-1#comment-16307</link> <dc:creator>Vladimir</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=803#comment-16307</guid> <description>Well luckily it wasn&#039;t me who came up with the expression :)</description> <content:encoded><![CDATA[<p>Well luckily it wasn't me who came up with the expression :)</p> ]]></content:encoded> </item> <item><title>By: Tom</title><link>http://www.prelovac.com/vladimir/improving-security-in-wordpress-plugins-using-nonces/comment-page-1#comment-16276</link> <dc:creator>Tom</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=803#comment-16276</guid> <description>Someone had to point out that for us UK readers &quot;nonce&quot; is an extremely widely used and understood slang for a paedophile, which makes virtually every statement above extremely &quot;humorous&quot;. Sorry to be childish, but I assure you it&#039;s true. http://www.google.es/search?hl=en&amp;rlz=1B3GGGL_en-GBES329ES329&amp;q=nonce+uk&amp;btnG=Search</description> <content:encoded><![CDATA[<p>Someone had to point out that for us UK readers "nonce" is an extremely widely used and understood slang for a paedophile, which makes virtually every statement above extremely "humorous". Sorry to be childish, but I assure you it's true. <a
href="http://www.google.es/search?hl=en&amp;rlz=1B3GGGL_en-GBES329ES329&amp;q=nonce+uk&amp;btnG=Search" rel="nofollow">http://www.google.es/search?hl=en&amp;rlz=1B3GGGL_en-GBES329ES329&amp;q=nonce+uk&amp;btnG=Search</a></p> ]]></content:encoded> </item> <item><title>By: Oude WordPress installaties worden aangevallen : WordPress Dimensie</title><link>http://www.prelovac.com/vladimir/improving-security-in-wordpress-plugins-using-nonces/comment-page-1#comment-15165</link> <dc:creator>Oude WordPress installaties worden aangevallen : WordPress Dimensie</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=803#comment-15165</guid> <description>[...] Vladimir Prelovac – Improving security in WordPress Plugins using Nonces [...]</description> <content:encoded><![CDATA[<p>[...] Vladimir Prelovac – Improving security in WordPress Plugins using Nonces [...]</p> ]]></content:encoded> </item> <item><title>By: Hangman</title><link>http://www.prelovac.com/vladimir/improving-security-in-wordpress-plugins-using-nonces/comment-page-1#comment-14138</link> <dc:creator>Hangman</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=803#comment-14138</guid> <description>Thanks a lot for this!</description> <content:encoded><![CDATA[<p>Thanks a lot for this!</p> ]]></content:encoded> </item> <item><title>By: Lukas</title><link>http://www.prelovac.com/vladimir/improving-security-in-wordpress-plugins-using-nonces/comment-page-1#comment-13976</link> <dc:creator>Lukas</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=803#comment-13976</guid> <description>Exactly what I was looking for! Thanks.</description> <content:encoded><![CDATA[<p>Exactly what I was looking for! Thanks.</p> ]]></content:encoded> </item> <item><title>By: iamduyu</title><link>http://www.prelovac.com/vladimir/improving-security-in-wordpress-plugins-using-nonces/comment-page-1#comment-13902</link> <dc:creator>iamduyu</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=803#comment-13902</guid> <description>thanks, it&#039;s just what i&#039;m looking for.</description> <content:encoded><![CDATA[<p>thanks, it's just what i'm looking for.</p> ]]></content:encoded> </item> <item><title>By: Naomi</title><link>http://www.prelovac.com/vladimir/improving-security-in-wordpress-plugins-using-nonces/comment-page-1#comment-11076</link> <dc:creator>Naomi</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=803#comment-11076</guid> <description>Does this still reign true for Wordpress 2.7 and above?</description> <content:encoded><![CDATA[<p>Does this still reign true for Wordpress 2.7 and above?</p> ]]></content:encoded> </item> <item><title>By: Firewalling and Hack Proofing Your WordPress Blog &#171; Lorelle on WordPress</title><link>http://www.prelovac.com/vladimir/improving-security-in-wordpress-plugins-using-nonces/comment-page-1#comment-10694</link> <dc:creator>Firewalling and Hack Proofing Your WordPress Blog &#171; Lorelle on WordPress</dc:creator> <pubDate></pubDate> <guid
isPermaLink="false">http://www.prelovac.com/vladimir/?p=803#comment-10694</guid> <description>[...] Vladimir Prelovac - Improving security in WordPress Plugins using Nonces [...]</description> <content:encoded><![CDATA[<p>[...] Vladimir Prelovac - Improving security in WordPress Plugins using Nonces [...]</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Served from: 67.222.145.100 @ 2009-11-21 10:46:50 by W3 Total Cache -->