Skip to content

Commit

Permalink
Merge pull request #18692 from jcogs33/jcogs33/spring-csrf-qhelp-update
Browse files Browse the repository at this point in the history
Java: update `java/spring-disabled-csrf-protection` QHelp
  • Loading branch information
jcogs33 authored Feb 19, 2025
2 parents bc6ce32 + dce89c5 commit 485ee5c
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions java/ql/src/Security/CWE/CWE-352/SpringCSRFProtection.qhelp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@
<qhelp>

<overview>
<p>When you set up a web server to receive a request from a client without any mechanism
for verifying that it was intentionally sent, then it is vulnerable to attack. An attacker can
trick a client into making an unintended request to the web server that will be treated as
an authentic request. This can be done via a URL, image load, XMLHttpRequest, etc. and can
result in exposure of data or unintended code execution.</p>
<p>
Cross-site request forgery (CSRF) is a type of vulnerability in which an
attacker is able to force a user to carry out an action that the user did
not intend.
</p>

<p>
The attacker tricks an authenticated user into submitting a request to the
web application. Typically, this request will result in a state change on
the server, such as changing the user's password. The request can be
initiated when the user visits a site controlled by the attacker. If the
web application relies only on cookies for authentication, or on other
credentials that are automatically included in the request, then this
request will appear as legitimate to the server.
</p>
</overview>

<recommendation>
Expand All @@ -26,7 +36,7 @@ by non-browser clients.</p>
<references>
<li>
OWASP:
<a href="https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)">Cross-Site Request Forgery (CSRF)</a>.
<a href="https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)">Cross Site Request Forgery (CSRF)</a>.
</li>
<li>
Spring Security Reference:
Expand Down

0 comments on commit 485ee5c

Please sign in to comment.