Commit 9af8b50
Address review: use resume_session and add forgery protection test
Use resume_session instead of authenticated? in the skip_forgery_protection
condition so the session is established before the forgery check runs,
regardless of callback ordering.
Add a test with forgery protection explicitly enabled to prove the CSRF
bypass works in production, not just in test mode where CSRF is disabled
by default.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 0708f4c commit 9af8b50
2 files changed
Lines changed: 22 additions & 1 deletion
File tree
- config/initializers
- test/controllers/active_storage
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
48 | 61 | | |
49 | 62 | | |
50 | 63 | | |
| |||
104 | 117 | | |
105 | 118 | | |
106 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
107 | 128 | | |
0 commit comments