Skip to content

Commit f438282

Browse files
Jami CogswellJami Cogswell
authored andcommitted
Java: rewrite qhelp overview section; aligns with overview section used by Python and Ruby
1 parent 283c3b1 commit f438282

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

java/ql/src/Security/CWE/CWE-352/CsrfUnprotectedRequestType.qhelp

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,29 @@
22
<qhelp>
33

44
<overview>
5-
<p>When you set up a web server to receive a request from a client without any mechanism
6-
for verifying that it was intentionally sent, then it is vulnerable to a Cross-Site Request
7-
Forgery (CSRF) attack. An attacker can trick a client into making an unintended request
8-
to the web server that will be treated as an authentic request. This can be done via a URL,
9-
image load, XMLHttpRequest, etc. and can result in exposure of data or unintended code execution.</p>
5+
<p>
6+
Cross-site request forgery (CSRF) is a type of vulnerability in which an
7+
attacker is able to force a user to carry out an action that the user did
8+
not intend.
9+
</p>
10+
11+
<p>
12+
The attacker tricks an authenticated user into submitting a request to the
13+
web application. Typically this request will result in a state change on
14+
the server, such as changing the user's password. The request can be
15+
initiated when the user visits a site controlled by the attacker. If the
16+
web application relies only on cookies for authentication, or on other
17+
credentials that are automatically included in the request, then this
18+
request will appear as legitimate to the server.
19+
</p>
20+
21+
<p>
22+
A common countermeasure for CSRF is to generate a unique token to be
23+
included in the HTML sent from the server to a user. This token can be
24+
used as a hidden field to be sent back with requests to the server, where
25+
the server can then check that the token is valid and associated with the
26+
relevant user session.
27+
</p>
1028
</overview>
1129

1230
<recommendation>

0 commit comments

Comments
 (0)