Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 8f99972

Browse files
committed
OAuth2 CSRF query: improve documentation
1 parent 0ba42f7 commit 8f99972

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

ql/src/Security/CWE-352/ConstantOauth2State.qhelp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<overview>
66
<p>
77
OAuth 2.0 clients must implement CSRF protection for the redirection URI, which is typically accomplished by including a "state" value that binds the request to
8-
the user's authenticated state. The Go OAuth 2.0 library allows to specify a "state" value which is then included in the auth code URL, and then provided back by the remote authentication server in the redirect callback, from where it must be validated; failure to do so makes the client susceptible to an CSRF attack.
8+
the user's authenticated state. The Go OAuth 2.0 library allows you to specify a "state" value which is then included in the auth code URL. That state is then provided back by the remote authentication server in the redirect callback, from where it must be validated. Failure to do so makes the client susceptible to an CSRF attack.
99
</p>
1010
</overview>
1111
<recommendation>
@@ -23,4 +23,8 @@
2323
</p>
2424
<sample src="ConstantOauth2StateBetter.go" />
2525
</example>
26+
<references>
27+
<li>IETF: <a href="https://tools.ietf.org/html/rfc6749#section-10.12">The OAuth 2.0 Authorization Framework</a></li>
28+
<li>IETF: <a href="https://tools.ietf.org/html/draft-ietf-oauth-security-topics-15#section-2.1">OAuth 2.0 Security Best Current Practice</a></li>
29+
</references>
2630
</qhelp>

ql/src/Security/CWE-352/ConstantOauth2State.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @name Use of constant `state` value in OAuth 2.0 URL.
2+
* @name Use of constant `state` value in OAuth 2.0 URL
33
* @description Using a constant value for the `state` in the OAuth 2.0 URL makes the application
44
* susceptible to CSRF attacks.
55
* @kind path-problem

0 commit comments

Comments
 (0)