What is going on
CSRF attacks succeed despite enabled CSRF protection. Malicious sites can perform unauthorized actions.
CSRF tokens not properly validated or exempt endpoints allow attacks.
Error messages you might see
Common causes
- CSRF exemption too broad (e.g., /api/**)
- Token not validated on POST/PUT/DELETE
- Cookie-based sessions with permissive domain
- Token not included in form or header
- SameSite cookie attribute not set
How to fix it
Keep CSRF enabled by default, exempt only /webhook paths if needed. Use httpOnly cookies for CSRF tokens. Set SameSite=Strict: Set-Cookie: ...; SameSite=Strict. Include token in forms: . Validate referer header for sensitive operations.
Getting help takes about a minute
No hiring, no back and forth. A real person looks at your app.
-
1
Describe it
Tell us what you need in plain words. You don't have to be technical or have an account to start.
-
2
Free 15-minute call
A verified developer calls you. Many tasks are sorted right there, and it costs nothing.
-
3
Pay after you approve
If there is more to do, you get one fixed price up front. You pay only once you are happy.
Real people, reviewed by hand
Developers who do this every day
Every developer is approved by our team before they can take a task. Describe yours and the first one who is free picks it up.
Get helpQuestions
How do I include CSRF token in Thymeleaf?
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}">
Which endpoints need CSRF protection?
All POST/PUT/DELETE that modify data. GET is read-only and doesn't need token