Skip to content

Commit f123935

Browse files
authored
Note issue in related query
1 parent 18c5cb1 commit f123935

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ruby/ql/src/queries/security/cwe-352/CSRFProtectionNotEnabled.qhelp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@
4242
vulnerability - for example if parts of the session are memoized. Calling
4343
<code>protect_from_forgery with: :exception</code> can help to avoid this
4444
by raising an exception on an invalid CSRF token instead.
45+
46+
Note that Rails version 5 and later
47+
automatically run <code>protect_from_forgery with: :exception</code>
48+
by default, but manually calling <code>protect_from_forgery</code> with
49+
no <code>with</code> argument will downgrade protection to null the
50+
session rather than raise an exception.
4551
</p>
4652
</recommendation>
4753

0 commit comments

Comments
 (0)