|
2 | 2 | <qhelp> |
3 | 3 |
|
4 | 4 | <overview> |
5 | | -<p>When a web server is designed to receive a request from a client without any mechanism |
6 | | -for verifying that it was intentionally sent, then it might be possible for an attacker |
7 | | -to trick a client into making an unintentional request to the web server which will be treated |
8 | | -as an authentic request. This can be done via a URL, image load, XMLHttpRequest, etc. and can |
| 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 attack. An attacker can |
| 7 | +trick a client into making an unintended request to the web server that will be treated as |
| 8 | +an authentic request. This can be done via a URL, image load, XMLHttpRequest, etc. and can |
9 | 9 | result in exposure of data or unintended code execution.</p> |
10 | 10 | </overview> |
11 | 11 |
|
12 | 12 | <recommendation> |
13 | | -<p>Cross-Site Request Forgery (CSRF) protection is enabled by default in Spring with Java |
14 | | -configuration. It's recommended to not disable this.</p> |
| 13 | +<p>Cross-Site Request Forgery (CSRF) protection is enabled by default. Spring's recommendation |
| 14 | +is to use CSRF protection for any request that could be processed by a browser client by normal |
| 15 | +users.</p> |
15 | 16 | </recommendation> |
16 | 17 |
|
17 | 18 | <example> |
18 | | -<p>The following example shows the Spring Java configuration with CSRF protection disabled.</p> |
| 19 | +<p>The following example shows the Spring Java configuration with CSRF protection disabled. |
| 20 | +This type of configuration should only be used if you are creating a service that is used only |
| 21 | +by non-browser clients.</p> |
19 | 22 |
|
20 | 23 | <sample src="SpringCSRFProtection.java" /> |
21 | 24 | </example> |
22 | 25 |
|
23 | 26 | <references> |
24 | 27 | <li> |
25 | | -CWE: |
26 | | -<a href="https://cwe.mitre.org/data/definitions/352.html">CWE-352: Cross-Site Request Forgery (CSRF)</a>. |
27 | | -</li> |
28 | | -<li> |
29 | 28 | OWASP: |
30 | 29 | <a href="https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)">Cross-Site Request Forgery (CSRF)</a>. |
31 | 30 | </li> |
|
0 commit comments