Skip to content

Commit

Permalink
Update Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.md
Browse files Browse the repository at this point in the history
small link fix
  • Loading branch information
jmanico committed Dec 3, 2023
1 parent d88932f commit 96dad60
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ CSRF tokens should be:

CSRF tokens prevent CSRF because without a CSRF token, an attacker cannot create valid requests to the backend server.

**In Synchronized patterns, CSRF tokens should not be transmitted using cookies**
#### Transmissing CSRF tokens In Synchronized Patterns

The CSRF token can be transmitted to the client as part of a response payload, such as a HTML or JSON response, then it can be transmitted back to the server as a hidden field on a form submission or via an AJAX request as a custom header value or part of a JSON payload. A CSRF token must not be leaked in the server logs or in the URL. GET requests can potentially leak CSRF tokens at several locations, such as the browser history, log files, network utilities that log the first line of a HTTP request, and Referer headers if the protected site links to an external site.
The CSRF token can be transmitted to the client as part of a response payload, such as a HTML or JSON response, then it can be transmitted back to the server as a hidden field on a form submission or via an AJAX request as a custom header value or part of a JSON payload. a CSRF token should not be transmitted in a cookie for synchronized patterns. A CSRF token must not be leaked in the server logs or in the URL. GET requests can potentially leak CSRF tokens at several locations, such as the browser history, log files, network utilities that log the first line of a HTTP request, and Referer headers if the protected site links to an external site.

For example:

Expand Down

0 comments on commit 96dad60

Please sign in to comment.