Ruby: Make CSRF query more sensitive

Generate an alert for every controller class that doesn't have or
inherity a `protect_from_forgery` setting.
This commit is contained in:
Harry Maclean
2023-09-25 13:46:50 +01:00
parent 49d826f667
commit 6d6f8ba512
4 changed files with 21 additions and 7 deletions

View File

@@ -1 +1,2 @@
| railsapp/app/controllers/alternative_root_controller.rb:1:1:3:3 | AlternativeRootController | Potential CSRF vulnerability due to forgery protection not being enabled |
| railsapp/app/controllers/alternative_root_controller.rb:1:1:3:3 | AlternativeRootController | Potential CSRF vulnerability due to forgery protection not being enabled. |
| railsapp/app/controllers/tags_controller.rb:1:1:2:3 | TagsController | Potential CSRF vulnerability due to forgery protection not being enabled. |

View File

@@ -0,0 +1,3 @@
class SubscriptionsController < AlternativeRootController
protect_from_forgery with: :exception
end

View File

@@ -0,0 +1,2 @@
class TagsController < AlternativeRootController
end