<?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: RESTful Programming and CSRF</title>
	<atom:link href="http://dmiessler.com/blog/restful-programming-and-csrf/feed" rel="self" type="application/rss+xml" />
	<link>http://dmiessler.com/blog/restful-programming-and-csrf</link>
	<description>in search of intervals</description>
	<pubDate>Mon, 01 Dec 2008 18:47:02 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7-bleeding</generator>
		<item>
		<title>By: court3nay</title>
		<link>http://dmiessler.com/blog/restful-programming-and-csrf#comment-132168</link>
		<dc:creator>court3nay</dc:creator>
		<pubDate>Sun, 30 Mar 2008 02:27:16 +0000</pubDate>
		<guid isPermaLink="false">http://dmiessler.com/blog/restful-programming-and-csrf#comment-132168</guid>
		<description>&lt;p&gt;It's a dirty little secret of rails apps that many of them are susceptible to csrf attacks.  However, if you designed your rails app correctly (i.e. GET actions only show data, to delete you have to post with DELETE) it makes it a little more difficult, because you need a POST to change any data.&lt;/p&gt;

&lt;p&gt;There was a twitter 'virus' a few months that we discovered and destroyed that essentially created a form which created a tweet and POSTed the form automatically with javascript.&lt;/p&gt;

&lt;p&gt;My colleague Rick Olson wrote CSRF_killer plugin which automatically puts some hidden form variables into all of your forms, and effectively squashes any such attacks.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>It&#8217;s a dirty little secret of rails apps that many of them are susceptible to csrf attacks.  However, if you designed your rails app correctly (i.e. GET actions only show data, to delete you have to post with DELETE) it makes it a little more difficult, because you need a POST to change any data.</p>

<p>There was a twitter &#8216;virus&#8217; a few months that we discovered and destroyed that essentially created a form which created a tweet and POSTed the form automatically with javascript.</p>

<p>My colleague Rick Olson wrote CSRF_killer plugin which automatically puts some hidden form variables into all of your forms, and effectively squashes any such attacks.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Miessler</title>
		<link>http://dmiessler.com/blog/restful-programming-and-csrf#comment-132167</link>
		<dc:creator>Daniel Miessler</dc:creator>
		<pubDate>Sun, 30 Mar 2008 02:26:13 +0000</pubDate>
		<guid isPermaLink="false">http://dmiessler.com/blog/restful-programming-and-csrf#comment-132167</guid>
		<description>&lt;p&gt;Ah, yes, I remember this now. Well, as I said, I wasn't claiming expertise, and I did in fact get a crucial piece wrong in this flash of "insight". The URLs were right, up until the action piece - the point of REST is to have the HTTP verb be the action. Not for the URL to indicate the action.&lt;/p&gt;

&lt;p&gt;Right.&lt;/p&gt;

&lt;p&gt;Thanks for the reminder, guys. That'll teach me to make 5 minute posts on a whim.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Ah, yes, I remember this now. Well, as I said, I wasn&#8217;t claiming expertise, and I did in fact get a crucial piece wrong in this flash of &#8220;insight&#8221;. The URLs were right, up until the action piece - the point of REST is to have the HTTP verb be the action. Not for the URL to indicate the action.</p>

<p>Right.</p>

<p>Thanks for the reminder, guys. That&#8217;ll teach me to make 5 minute posts on a whim.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Vinoski</title>
		<link>http://dmiessler.com/blog/restful-programming-and-csrf#comment-132157</link>
		<dc:creator>Steve Vinoski</dc:creator>
		<pubDate>Sun, 30 Mar 2008 01:27:37 +0000</pubDate>
		<guid isPermaLink="false">http://dmiessler.com/blog/restful-programming-and-csrf#comment-132157</guid>
		<description>&lt;p&gt;RESTful URIs are associated with resources, not actions. URIs specifying actions are not RESTful. For RESTful web applications, HTTP verbs -- GET, PUT, POST, DELETE -- provide the actions.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>RESTful URIs are associated with resources, not actions. URIs specifying actions are not RESTful. For RESTful web applications, HTTP verbs &#8212; GET, PUT, POST, DELETE &#8212; provide the actions.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Ingram</title>
		<link>http://dmiessler.com/blog/restful-programming-and-csrf#comment-132085</link>
		<dc:creator>Andrew Ingram</dc:creator>
		<pubDate>Sat, 29 Mar 2008 20:16:23 +0000</pubDate>
		<guid isPermaLink="false">http://dmiessler.com/blog/restful-programming-and-csrf#comment-132085</guid>
		<description>&lt;p&gt;Your examples don't look like REST to me.&lt;/p&gt;

&lt;p&gt;My understanding as as follows:&lt;/p&gt;

&lt;p&gt;http://acme.com/products/cart/display isn't RESTful
but http://acme.com/products/cart/ with a action of GET is&lt;/p&gt;

&lt;p&gt;http://acme.com/account/delete isn't RESTful
but http://acme.com/account/ with an action of DELETE is&lt;/p&gt;

&lt;p&gt;Your other examples seem wrong too&lt;/p&gt;

&lt;p&gt;You wouldn't have http://somesite.com/product/1234/purchase
You'd have http://somesite.com/basket/ and to purchase a product you'd access it with POST and the product id&lt;/p&gt;

&lt;p&gt;http://somecause.com/campaign/donate is the same deal, you'd do a POST on http://somecause.com/campaign/ to update it with a new donation&lt;/p&gt;

&lt;p&gt;Any RESTful URL should be completely harmless when accessed via GET.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Your examples don&#8217;t look like REST to me.</p>

<p>My understanding as as follows:</p>

<p><a href="http://acme.com/products/cart/display" rel="nofollow">http://acme.com/products/cart/display</a> isn&#8217;t RESTful
but <a href="http://acme.com/products/cart/" rel="nofollow">http://acme.com/products/cart/</a> with a action of GET is</p>

<p><a href="http://acme.com/account/delete" rel="nofollow">http://acme.com/account/delete</a> isn&#8217;t RESTful
but <a href="http://acme.com/account/" rel="nofollow">http://acme.com/account/</a> with an action of DELETE is</p>

<p>Your other examples seem wrong too</p>

<p>You wouldn&#8217;t have <a href="http://somesite.com/product/1234/purchase" rel="nofollow">http://somesite.com/product/1234/purchase</a>
You&#8217;d have <a href="http://somesite.com/basket/" rel="nofollow">http://somesite.com/basket/</a> and to purchase a product you&#8217;d access it with POST and the product id</p>

<p><a href="http://somecause.com/campaign/donate" rel="nofollow">http://somecause.com/campaign/donate</a> is the same deal, you&#8217;d do a POST on <a href="http://somecause.com/campaign/" rel="nofollow">http://somecause.com/campaign/</a> to update it with a new donation</p>

<p>Any RESTful URL should be completely harmless when accessed via GET.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Schmoe</title>
		<link>http://dmiessler.com/blog/restful-programming-and-csrf#comment-132067</link>
		<dc:creator>Joe Schmoe</dc:creator>
		<pubDate>Sat, 29 Mar 2008 19:25:06 +0000</pubDate>
		<guid isPermaLink="false">http://dmiessler.com/blog/restful-programming-and-csrf#comment-132067</guid>
		<description>&lt;p&gt;Actions are still actions regardless of whether they are performed via RESTful URLs or not.  &lt;/p&gt;

&lt;p&gt;Your example:
http://somesite.com/product/1234/purchase&lt;/p&gt;

&lt;p&gt;is no easier/harder to abuse with CSRF than something like:&lt;/p&gt;

&lt;p&gt;http://somesite.com/cgi-bin/purchase.cgi?product=1234&lt;/p&gt;

&lt;p&gt;When dealing with CSRF, you just need to remember that any major actions need to be verified by making the user re-login (or equivalent).  Use of timeouts can also be helpful: "Hey, this user last visited 5 days ago and now the first page he/she is hitting is a checkout page?"&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Actions are still actions regardless of whether they are performed via RESTful URLs or not.  </p>

<p>Your example:
<a href="http://somesite.com/product/1234/purchase" rel="nofollow">http://somesite.com/product/1234/purchase</a></p>

<p>is no easier/harder to abuse with CSRF than something like:</p>

<p><a href="http://somesite.com/cgi-bin/purchase.cgi?product=1234" rel="nofollow">http://somesite.com/cgi-bin/purchase.cgi?product=1234</a></p>

<p>When dealing with CSRF, you just need to remember that any major actions need to be verified by making the user re-login (or equivalent).  Use of timeouts can also be helpful: &#8220;Hey, this user last visited 5 days ago and now the first page he/she is hitting is a checkout page?&#8221;</p>]]></content:encoded>
	</item>
</channel>
</rss>
