Clean up trailing and leading whitespace
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
<pre class="ruby">
|
||||
<%= %q{
|
||||
class AdminController < ApplicationController
|
||||
|
||||
|
||||
before_filter :administrative, :if => :admin_param
|
||||
|
||||
...
|
||||
@@ -45,8 +45,8 @@
|
||||
params[:id] == '1'
|
||||
end
|
||||
} %>
|
||||
</pre>
|
||||
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -63,7 +63,7 @@
|
||||
<p><b>Failure to Restrict URL Access - ATTACK</b></p>
|
||||
<p class="desc">
|
||||
Request the following URL: /admin/1/dashboard and have fun :-)
|
||||
</p>
|
||||
</p>
|
||||
<p><b>Failure to Restrict URL Access - SOLUTION</b></p>
|
||||
<p class="desc">
|
||||
The code is already available to restrict access to the admin controller by role within app/controllers/application_controller.rb. The additional condition that if the admin_id param equals 1 means the filter can be circumvented by an attacker. The way to fix this issue is to remove the conditional and enforce the filter on all access requests to the admin dashboard as follows:
|
||||
@@ -71,7 +71,7 @@
|
||||
<pre class="ruby">
|
||||
<%= %q{
|
||||
class AdminController < ApplicationController
|
||||
|
||||
|
||||
before_filter :administrative
|
||||
} %>
|
||||
</pre>
|
||||
|
||||
Reference in New Issue
Block a user