The OWASP CSRFGuard is one of the world’s most popular free security tools and is actively maintained by a pool of international volunteers*. It can help you automatically find security vulnerabilities in your web applications while you are developing and testing your applications. Its also a great tool for experienced pentesters to use for manual security testing.
Welcome to the home of the OWASP CSRFGuard Project! OWASP CSRFGuard is a library that implements a variant of the synchronizer token pattern to mitigate the risk of Cross-Site Request Forgery (CSRF) attacks.
The OWASP CSRFGuard library is integrated through the use of a JavaEE Filter and exposes various automated and manual ways to integrate per-session or pseudo-per-request tokens into HTML. When a user interacts with this HTML, CSRF prevention tokens (i.e. cryptographically random synchronizer tokens) are submitted with the corresponding HTTP request.
It is the responsibility of OWASP CSRFGuard to ensure the token is present and is valid for the current HTTP request.
Any attempt to submit a request to a protected resource without the correct corresponding token is viewed as a CSRF attack in progress and is discarded. Prior to discarding the request, CSRFGuard can be configured to take one or more actions such as logging aspects of the request and redirecting the user to a landing page. The latest release enhances this strategy to support the optional verification of HTTP requests submitted using Ajax as well as the optional verification of referrer headers.
Put whatever you like here: news, screenshots, features, supporters, or remove this file and don’t use tabs at all.
OWASP CSRFGuard 3.1.0
Some CSRGuard features
<img src=“https://bank.com/fn?param=1”> <iframe src=“https://bank.com/fn?param=1”> <script src=“https://bank.com/fn?param=1”>
<body onload="document.forms.submit()"> <form method="POST" action=“https://bank.com/fn”> <input type="hidden" name="sp" value="8109"/> </form>
Subject to same origin policy
How Does CSRF Work?
What is CSRF (Cross-Site Request Forgery) Attacks
CSRFGuard In Action
We are working on new version of CSRFGuard including a lot of merge request with goood proposals and also a new code to fix known issues on XSS attacks that bypass CSRFGuard. See “CSFRGuard 4.0” tab for more information.
Target date for the new relase 4.0 : end of Q4 2021
We need your help. If you want to give few hours of your time to help us please contact me.
Important Security Fix
An important security fix has been applied to the CSRFGuard version 3.0.
Do a token pre-fetch on every page.
Instead of hard coding the CSRF token, we send a POST request to fetch the token and populate the JS variable.
Thanks to Ahamed Nafeez [email protected] for this fix.
CSRFGuard is developed by a worldwide of volunteers in Morocco, France, India, China, Singapore, Indonesia, Canada and more.
Thanks to Trent Schmidt and Joel Orlina (JIRA) for there help.
CSRFGuard integration with a JSF application
Yi SONG create for CSRFGuard project a simple example to demostrate the CSRFGuard integration with a JSF application.
The original JSF project is taken from https://mkyong.com/jsf2/jsf-2-0-hello-world-example/
After integrating with csrfguard, the project has been tested on netbean 8.2 with glassfish 4.1.1
Yi SONG Bio: Yi SONG received my master of engineering in China in 2006. Then I start work for Axalto, then Gemalto and then Thales till now. He has 3 years experience on smartcard development, 10 years experience on cryptography and hardware security module. Since end of 2018, his work is focusing on web application and cloud.
Documentations for various Web Application Servers
We need first to create a complete set of installation guide for various Java Application Server.
CSRFGuard 4.0 features
CSRFGuard 4.0 is under developpement. If you are Java développer and want to help as OWASP voloneteer please contact the project leader. We will remove all CSRFGuard 3.1.0 limitations and release CSRFGuard 4.0
The following roadmap will remove the following CSRFGuard 3.1.0 limitations:
- CSRF Guard utilizes the external interface of Tomcat web server; it may not provide adequate protection for other web server applications (e.g. Internet Information Server IIS).
- CSRF Guard can provide adequate protection against CSRF attacks; however, it can be compromised by server side vulnerabilities such as cross site scripting or client side vulnerabilities (session hijacking or clickjacking) or unintentional leverage token by unauthorized parties.
- CSRF Guard makes the connection between a token and a session id to check the token validity, Because of this dependency on the session identifiers; it cannot defend against login CSRF attacks.
- CSRF Guard filters input HTTP request by token pattern; therefore, it cannot check the input validation error, to effectively protect against CSRF attack, the developer needs to ensure the web application implements countermeasures to defense against cross scripting attacks.
- Enhance Token Injection Process
- Add protection against Clickjacking
- Add protection against Session Hijacking bypassing CSRFGuard
- Add protection against XSS by passing CSFRGuard