Skip to content

Latest commit

 

History

History
107 lines (77 loc) · 6.8 KB

info.md

File metadata and controls

107 lines (77 loc) · 6.8 KB

Project Classification

Flagship Project

Builders Breakers

Tool Project

CSRFGuard 4.0 released in April 2021

https://owasp.org/www-project-csrfguard/

BSD License, All rights reserved.

Overview

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.

Project Leads

The CSRFGuard project is run by Azzeddine RAMRAMI and Istvan ALBERT-TOTH.

License

OWASP CSRFGuard 4.x is offered under the BSD license.

Using with Maven

Add the following dependencies to your Maven POM file to use the library:
Note: for the Jakarta releases use the -jakarta suffix in the version.

<dependency>
    <groupId>org.owasp</groupId>
    <artifactId>csrfguard</artifactId>
    <version>4.4.0</version>
</dependency>

<!-- Stateful web application support -->
<dependency>
    <groupId>org.owasp</groupId>
    <artifactId>csrfguard-extension-session</artifactId>
    <version>4.4.0</version>
</dependency>

<!-- JSP TAG support -->
<dependency>
    <groupId>org.owasp</groupId>
    <artifactId>csrfguard-jsp-tags</artifactId>
    <version>4.4.0</version>
</dependency>

Building the code

  1. Make sure you have Apache Maven 3.6.3+ and JDK 11+ installed
  2. Clone this repository locally
  3. Build the project by running mvn clean install in the project root directory
  4. Build and run the test JSP web application by running mvn pre-integration-test -Pdeploy-jsp-webapp -pl csrfguard-test/csrfguard-test-jsp or mvn -Pdeploy-jsp-webapp -pl csrfguard-test/csrfguard-test-jsp tomcat7:run
  5. Optional: you can use mvnDebug to enable remote debugging, then connect your IDE to it (default port is 8000)
  6. Use a web browser to access http://localhost:8080 to open the home page of the test project

Uploading to the Maven Central repository

  1. Follow the Sonatype Open-Source Project Maven Repository Usage Guide to create a Sonatype user account;
  2. Next, open a support request to get your newly created username added to the Maven groupId org.owasp;
  3. Once the support request has been completed, follow the instructions in the Sonatype Maven repository usage guide mentioned above to upload new versions to the Maven Central repository.

Maven Central repository

You can download pre-compiled versions from:

Discussions and Email list

If you have questions, would like to share or discuss ideas, please use the official discussions page (preferred). You can also sign up for the OWASP CSRFGuard email list here.

CSRFGuard 4.0 Release Notes: