3
3
4
4
<overview >
5
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
6
+ for verifying that it was intentionally sent, then it is vulnerable to a Cross- Site Request
7
7
Forgery (CSRF) attack. An attacker can trick a client into making an unintended request
8
8
to the web server that will be treated as an authentic request. This can be done via a URL,
9
9
image load, XMLHttpRequest, etc. and can result in exposure of data or unintended code execution.</p >
@@ -17,21 +17,21 @@ should only perform read-only operations and should not be used for actions that
17
17
state.</p >
18
18
19
19
<p >This query currently supports the Spring and Stapler web frameworks. Spring provides default CSRF protection
20
- for all unsafe HTTP methods. Stapler provides default CSRF protection for the <code >POST</code > method.</p >
20
+ for all unsafe HTTP methods whereas Stapler provides default CSRF protection for the <code >POST</code > method.</p >
21
21
</recommendation >
22
22
23
23
<example >
24
24
<p > The following examples show Spring request handlers allowing safe HTTP request methods for state-changing actions.
25
25
Since safe HTTP request methods do not have default CSRF protection in Spring, they should not be used when modifying
26
- application state. Instead use one of the unsafe HTTP methods which Spring default-protects from CSRF.</p >
26
+ application state. Instead, use one of the unsafe HTTP methods which Spring default-protects from CSRF.</p >
27
27
28
28
<sample src =" CsrfUnprotectedRequestTypeBadSpring.java" />
29
29
30
30
<sample src =" CsrfUnprotectedRequestTypeGoodSpring.java" />
31
31
32
32
<p > The following examples show Stapler web methods allowing safe HTTP request methods for state-changing actions.
33
33
Since safe HTTP request methods do not have default CSRF protection in Stapler, they should not be used when modifying
34
- application state. Instead use the <code >POST</code > method which Stapler default-protects from CSRF.</p >
34
+ application state. Instead, use the <code >POST</code > method which Stapler default-protects from CSRF.</p >
35
35
36
36
<sample src =" CsrfUnprotectedRequestTypeBadStapler.java" />
37
37
0 commit comments