<?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: Security issue in CakePHP code documentation</title>
	<atom:link href="http://spacebug.com/security_issue_in_cakephp_code_documentation/feed/" rel="self" type="application/rss+xml" />
	<link>http://spacebug.com/security_issue_in_cakephp_code_documentation/</link>
	<description>Keeping Software Simple, Open and Pragmatic.</description>
	<lastBuildDate>Wed, 11 Jan 2012 01:15:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: anonymous</title>
		<link>http://spacebug.com/security_issue_in_cakephp_code_documentation/comment-page-1/#comment-105</link>
		<dc:creator>anonymous</dc:creator>
		<pubDate>Sat, 06 Mar 2010 20:47:20 +0000</pubDate>
		<guid isPermaLink="false">#comment-105</guid>
		<description>Totally agree, developers will see this example and will probably write less secure code as a result. isAuthorized should be written like Auth-&gt;allow(...)</description>
		<content:encoded><![CDATA[<p>Totally agree, developers will see this example and will probably write less secure code as a result. isAuthorized should be written like Auth->allow(&#8230;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amir Shevat</title>
		<link>http://spacebug.com/security_issue_in_cakephp_code_documentation/comment-page-1/#comment-104</link>
		<dc:creator>Amir Shevat</dc:creator>
		<pubDate>Sat, 06 Mar 2010 10:13:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-104</guid>
		<description>The whole point of examples is to demonstrate best practices, developers use the example to develop their application and rarely diverge from the example. 
My point in this post is that an authorization method that returns â€œauthorisedâ€ by default is not best practice.

Look at how auth-&gt;allow() works in cakePHP examples:

$this-&gt;Auth-&gt;allow(&#039;foo&#039;, &#039;bar&#039;, &#039;baz&#039;);

It works in a white list fashion â€“ you specify the methods you want to provide public access to, and all the rest are blocked by default.

The isAuthorized methods should demonstrate the same consistency and use a white list to allow privileges to specific roles and block all the rest.

Security examples should drive security best practices and be secure by default. 
</description>
		<content:encoded><![CDATA[<p>The whole point of examples is to demonstrate best practices, developers use the example to develop their application and rarely diverge from the example.<br />
My point in this post is that an authorization method that returns â€œauthorisedâ€ by default is not best practice.</p>
<p>Look at how auth->allow() works in cakePHP examples:</p>
<p>$this->Auth->allow(&#8216;foo&#8217;, &#8216;bar&#8217;, &#8216;baz&#8217;);</p>
<p>It works in a white list fashion â€“ you specify the methods you want to provide public access to, and all the rest are blocked by default.</p>
<p>The isAuthorized methods should demonstrate the same consistency and use a white list to allow privileges to specific roles and block all the rest.</p>
<p>Security examples should drive security best practices and be secure by default.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anonymous</title>
		<link>http://spacebug.com/security_issue_in_cakephp_code_documentation/comment-page-1/#comment-103</link>
		<dc:creator>anonymous</dc:creator>
		<pubDate>Sat, 06 Mar 2010 08:01:39 +0000</pubDate>
		<guid isPermaLink="false">#comment-103</guid>
		<description>So? That&#039;s the point of the AuthComponent in the first place. The developer in the example has decided that the only action requiring escalated privileges (&lt;em&gt;aside from already being logged in&lt;/em&gt;) is the delete function; they&#039;ve decided that the others are available to authenticated users.

Furthermore, why should it be the case for all functions? You&#039;re applying your requirements on an example, you don&#039;t know their needs or requirements, &lt;strong&gt;it&#039;s just an example&lt;/strong&gt;.

</description>
		<content:encoded><![CDATA[<p>So? That&#8217;s the point of the AuthComponent in the first place. The developer in the example has decided that the only action requiring escalated privileges (<em>aside from already being logged in</em>) is the delete function; they&#8217;ve decided that the others are available to authenticated users.</p>
<p>Furthermore, why should it be the case for all functions? You&#8217;re applying your requirements on an example, you don&#8217;t know their needs or requirements, <strong>it&#8217;s just an example</strong>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amir Shevat</title>
		<link>http://spacebug.com/security_issue_in_cakephp_code_documentation/comment-page-1/#comment-101</link>
		<dc:creator>Amir Shevat</dc:creator>
		<pubDate>Fri, 05 Mar 2010 08:59:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-101</guid>
		<description>But the issue is that the isAuthorized method protects all methods in a controller - not only the delete function.

Look at the code of the isAuthorized that handles the delete function.  It checks if you are an admin in defaults to unauthorized if you are not admin - this should be the case for all functions

Even if you only want to protect a single method right now you should explicitly allow access methods and return unauthorized by default. You simply cannot return authorized by default.
</description>
		<content:encoded><![CDATA[<p>But the issue is that the isAuthorized method protects all methods in a controller &#8211; not only the delete function.</p>
<p>Look at the code of the isAuthorized that handles the delete function.  It checks if you are an admin in defaults to unauthorized if you are not admin &#8211; this should be the case for all functions</p>
<p>Even if you only want to protect a single method right now you should explicitly allow access methods and return unauthorized by default. You simply cannot return authorized by default.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anonymous</title>
		<link>http://spacebug.com/security_issue_in_cakephp_code_documentation/comment-page-1/#comment-67</link>
		<dc:creator>anonymous</dc:creator>
		<pubDate>Fri, 05 Mar 2010 08:51:29 +0000</pubDate>
		<guid isPermaLink="false">#comment-67</guid>
		<description>That&#039;s not the case here though. It seems the intention of the example is to only delineate access when performing deletes and that the act of deleting should only be performed by &quot;admin&quot; users.</description>
		<content:encoded><![CDATA[<p>That&#8217;s not the case here though. It seems the intention of the example is to only delineate access when performing deletes and that the act of deleting should only be performed by &#8220;admin&#8221; users.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

