OWASP CSFRGuard

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.


Example

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

OWASP CSRFGuard 3.1.0

Some CSRGuard features

Tags

  <img src=“https://bank.com/fn?param=1”>
  <iframe src=“https://bank.com/fn?param=1”>
  <script src=“https://bank.com/fn?param=1”>

Autoposting Forms

  <body onload="document.forms[0].submit()">
  <form method="POST" action=“https://bank.com/fn”>
     <input type="hidden" name="sp" value="8109"/>
  </form>

XmlHttpRequest

Subject to same origin policy

Credentials Included

Credentials Included

How Does CSRF Work?

What is CSRF (Cross-Site Request Forgery) Attacks

How Does CSRF Work How Does CSRF Work How Does CSRF Work How Does CSRF Work How Does CSRF Work How Does CSRF Work How Does CSRF Work


CSRFGuard In Action

CSRFGuard in action


Latest News

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.

Target date for the new relase 4.0 : end of Q2 2020

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 ahamednafeez@gmail.com for this fix.


Supporters

CSRFGuard is developed by a worldwide of volunteers in Morocco, France, India, China, Singapore, Indonesia, Canada and more.

Special Thanks

Thanks to Trent Schmidt and Joel Orlina (JIRA) for there help.