Skip to content

Commit 7f5d56e

Browse files
committed
Enable forgery protection on sessions#create
This line has existed since 2008, and yet I can determine no justification for it. It seems to me that we *would* want CSRF protection on `session#create`. On its own, skipping CSRF protection in just this single action doesn't seem particularly useful to an attacker. Additional vectors (such as an overly-permissive CORS header) would have to be present to make use of this, but at that point far more interesting attacks would be possible on any cookie-based auth system.
1 parent c983fe2 commit 7f5d56e

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

app/controllers/clearance/sessions_controller.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ class Clearance::SessionsController < Clearance::BaseController
22
before_filter :redirect_signed_in_users, only: [:new]
33
skip_before_filter :require_login, only: [:create, :new, :destroy]
44
skip_before_filter :authorize, only: [:create, :new, :destroy]
5-
protect_from_forgery except: :create
65

76
def create
87
@user = authenticate(params)

0 commit comments

Comments
 (0)