File tree Expand file tree Collapse file tree 1 file changed +23
-5
lines changed
java/ql/src/Security/CWE/CWE-352 Expand file tree Collapse file tree 1 file changed +23
-5
lines changed Original file line number Diff line number Diff line change 2
2
<qhelp >
3
3
4
4
<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 >
10
28
</overview >
11
29
12
30
<recommendation >
You can’t perform that action at this time.
0 commit comments