<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Esheridan</id>
		<title>OWASP - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Esheridan"/>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php/Special:Contributions/Esheridan"/>
		<updated>2026-05-09T03:08:39Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.2</generator>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=161563</id>
		<title>Category:OWASP CSRFGuard Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=161563"/>
				<updated>2013-10-25T13:50:34Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!---==== Main  ====---&amp;gt;&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the home of the OWASP CSRFGuard Project! OWASP CSRFGuard is a library that implements a variant of the [http://www.corej2eepatterns.com/Design/PresoDesign.htm 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.&lt;br /&gt;
&lt;br /&gt;
== Project Lead ==&lt;br /&gt;
&lt;br /&gt;
THE PROJECT IS IN NEED OF LEADERSHIP! Contact Samantha Groves (samantha.groves@owasp.org) if you are interested!&lt;br /&gt;
&lt;br /&gt;
== License ==&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard is offered under the [http://www.opensource.org/licenses/bsd-license.php BSD] license. For further information on OWASP licenses, please consult the [[OWASP Licenses]] page.&lt;br /&gt;
&lt;br /&gt;
== Email List ==&lt;br /&gt;
&lt;br /&gt;
You can sign up for the OWASP CSRFGuard email list at [https://lists.owasp.org/mailman/listinfo/owasp-csrfguard https://lists.owasp.org/mailman/listinfo/owasp-csrfguard]&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
You can access the Git repository online at https://github.com/esheri3/OWASP-CSRFGuard&lt;br /&gt;
&lt;br /&gt;
== Downloads ==&lt;br /&gt;
&lt;br /&gt;
Download and build the latest source code from GitHub - https://github.com/esheri3/OWASP-CSRFGuard&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_Deprecated_Releases | Deprecated Releases]] - article containing several download references to deprecated and officially unsupported releases&lt;br /&gt;
&lt;br /&gt;
== User Manual(s) ==&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_User_Manual | OWASP CSRFGuard v3 ]] - series of articles describing the installation, configuration, and deployment of OWASP CSRFGuard v3.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
:*[http://www.owasp.org/index.php/Category:OWASP_CSRFTester_Project OWASP CSRFTester ] - utility to assist in the testing and generating PoC for CSRF attacks.&lt;br /&gt;
:*[[Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet | OWASP CSRF Prevention Cheat Sheet]] - provides a more holistic overview of CSRF prevention strategies and associated frameworks.&lt;br /&gt;
:*http://www.owasp.org/index.php/PHP_CSRF_Guard - project implementing CSRFGuard style solution for PHP.&lt;br /&gt;
:*http://www.thespanner.co.uk/2007/10/19/jsck/ - project implementing CSRFGuard style solution for PHP and JavaScript.&lt;br /&gt;
:*http://www.owasp.org/index.php/.Net_CSRF_Guard - project implementing CSRFGuard style solution for ASP.NET.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!---==== Project About ====&lt;br /&gt;
{{:Projects/OWASP CSRFGuard Project| Project About}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &amp;lt;headertabs /&amp;gt;----&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Validation_Project]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:OWASP_Project|CSRFGuard Project]]&lt;br /&gt;
[[Category:OWASP_Java_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=161562</id>
		<title>Category:OWASP CSRFGuard Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=161562"/>
				<updated>2013-10-25T13:50:12Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Project Lead */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!---==== Main  ====---&amp;gt;&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the home of the OWASP CSRFGuard Project! OWASP CSRFGuard is a library that implements a variant of the [http://www.corej2eepatterns.com/Design/PresoDesign.htm 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.&lt;br /&gt;
&lt;br /&gt;
== Project Lead ==&lt;br /&gt;
&lt;br /&gt;
THE PROJECT IS IN NEED OF LEADERSHIP! Contact Samantha Groves (samantha.groves@owasp.org) if you are interested!&lt;br /&gt;
&lt;br /&gt;
== License ==&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard is offered under the [http://www.opensource.org/licenses/bsd-license.php BSD] license. For further information on OWASP licenses, please consult the [[OWASP Licenses]] page.&lt;br /&gt;
&lt;br /&gt;
== Email List ==&lt;br /&gt;
&lt;br /&gt;
You can sign up for the OWASP CSRFGuard email list at [https://lists.owasp.org/mailman/listinfo/owasp-csrfguard https://lists.owasp.org/mailman/listinfo/owasp-csrfguard]&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
You can access the Git repository online at https://github.com/esheri3/OWASP-CSRFGuard&lt;br /&gt;
&lt;br /&gt;
== Downloads ==&lt;br /&gt;
&lt;br /&gt;
Download and build the latest source code from GitHub - https://github.com/esheri3/OWASP-CSRFGuard&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_Deprecated_Releases | Deprecated Releases]] - article containing several download references to deprecated and officially unsupported releases&lt;br /&gt;
&lt;br /&gt;
== User Manual(s) ==&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_User_Manual | OWASP CSRFGuard v3 ]] - series of articles describing the installation, configuration, and deployment of OWASP CSRFGuard v3.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
:*[http://www.owasp.org/index.php/Category:OWASP_CSRFTester_Project OWASP CSRFTester ] - utility to assist in the testing and generating PoC for CSRF attacks.&lt;br /&gt;
:*[[Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet | OWASP CSRF Prevention Cheat Sheet]] - provides a more holistic overview of CSRF prevention strategies and associated frameworks.&lt;br /&gt;
:*http://www.owasp.org/index.php/PHP_CSRF_Guard - project implementing CSRFGuard style solution for PHP.&lt;br /&gt;
:*http://www.thespanner.co.uk/2007/10/19/jsck/ - project implementing CSRFGuard style solution for PHP and JavaScript.&lt;br /&gt;
:*http://www.owasp.org/index.php/.Net_CSRF_Guard - project implementing CSRFGuard style solution for ASP.NET.&lt;br /&gt;
&lt;br /&gt;
== Project Sponsors == &lt;br /&gt;
&lt;br /&gt;
[[File:Infrared-logo-small.png | link=http://www.infraredsecurity.com]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!---==== Project About ====&lt;br /&gt;
{{:Projects/OWASP CSRFGuard Project| Project About}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &amp;lt;headertabs /&amp;gt;----&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Validation_Project]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:OWASP_Project|CSRFGuard Project]]&lt;br /&gt;
[[Category:OWASP_Java_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CSRFGuard_3_User_Manual&amp;diff=154359</id>
		<title>CSRFGuard 3 User Manual</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CSRFGuard_3_User_Manual&amp;diff=154359"/>
				<updated>2013-06-24T12:41:09Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
Welcome to the OWASP CSRFGuard 3 User Manual! The purpose of this article is to provide the user with guidance on obtaining, installing, deploying, and developing with the OWASP CSRFGuard library. The author's goal was to keep the User Manual informative, use to understand, and concise. If you find that one or more aspects of this document does not adhere to these goals, please me know at eric dot sheridan at owasp dot org.&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
Users can download the latest release of OWASP CSRFGuard using one of the following links:&lt;br /&gt;
&lt;br /&gt;
Download and build the source at - https://github.com/esheri3/OWASP-CSRFGuard&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
Installation of OWASP CSRFGuard 3 is very straight forward requiring three simple steps:&lt;br /&gt;
&lt;br /&gt;
:# Copy the Owasp.CsrfGuard.jar file to your application's classpath&lt;br /&gt;
:# Declare CsrfGuard in your application's deployment descriptor (web.xml)&lt;br /&gt;
:# Configure the Owasp.CsrfGuard.properties file as you see fit&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Installation | Click here]] for more detailed information regarding the installation of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
&lt;br /&gt;
The minimum configuration settings that users should review include:&lt;br /&gt;
&lt;br /&gt;
:* Default new token landing page (org.owasp.csrfguard.NewTokenLandingPage)&lt;br /&gt;
:* Support for Ajax and XMLHttpRequest (org.owasp.csrfguard.Ajax)&lt;br /&gt;
:* URI resources that should not be protected (org.owasp.csrfguard.unprotected.*)&lt;br /&gt;
:* Actions executed when an attack is detected (org.owasp.csrfguard.action.*)&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Configuration | Click here]] for more information regarding the configuration of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
= Token Injection =&lt;br /&gt;
&lt;br /&gt;
Users of OWASP CSRFGuard can inject prevention tokens into HTML using two strategies:&lt;br /&gt;
&lt;br /&gt;
:* JavaScript DOM Manipulation - largely automated process requiring minimal effort and is ideal for most web applications&lt;br /&gt;
:* JSP Tag Library - provides fine grained strategy ideal for situations where automated DOM manipulation is insufficient.&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Token_Injection | Click here]] for more information regarding the injection of CSRF prevention tokens within your application.&lt;br /&gt;
&lt;br /&gt;
= Known Issues =&lt;br /&gt;
&lt;br /&gt;
The following is a quick bulleted list of known issues within the current release:&lt;br /&gt;
&lt;br /&gt;
:* No known way to inject CSRF prevention tokens into setters of document.location (ex: document.location=&amp;quot;http://www.owasp.org&amp;quot;;)&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_CSRFGuard_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=154358</id>
		<title>Category:OWASP CSRFGuard Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=154358"/>
				<updated>2013-06-24T12:40:45Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Downloads */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!---==== Main  ====---&amp;gt;&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the home of the OWASP CSRFGuard Project! OWASP CSRFGuard is a library that implements a variant of the [http://www.corej2eepatterns.com/Design/PresoDesign.htm 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.&lt;br /&gt;
&lt;br /&gt;
== Project Lead ==&lt;br /&gt;
&lt;br /&gt;
[mailto:eric@infraredsecurity.com Eric Sheridan] is the lead and primary developer of the OWASP CSRFGuard project and a Managing Partner at [http://www.infraredsecurity.com Infrared Security]. Aside from leading up CSRFGuard, Eric has contributed to or provided guidance on numerous other OWASP projects including CSRF Prevention Cheat Sheet, WebGoat, Stinger, CSRFTester, and Enterprise Security API (ESAPI). As Managing Partner at Infrared Security, Eric Sheridan specializes in a wide variety of application security activities including static analysis, penetration tests, code reviews, and threat modeling. In his personal time... wait, what is that?&lt;br /&gt;
&lt;br /&gt;
== License ==&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard is offered under the [http://www.opensource.org/licenses/bsd-license.php BSD] license. For further information on OWASP licenses, please consult the [[OWASP Licenses]] page.&lt;br /&gt;
&lt;br /&gt;
== Email List ==&lt;br /&gt;
&lt;br /&gt;
You can sign up for the OWASP CSRFGuard email list at [https://lists.owasp.org/mailman/listinfo/owasp-csrfguard https://lists.owasp.org/mailman/listinfo/owasp-csrfguard]&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
You can access the Git repository online at https://github.com/esheri3/OWASP-CSRFGuard&lt;br /&gt;
&lt;br /&gt;
== Downloads ==&lt;br /&gt;
&lt;br /&gt;
Download and build the latest source code from GitHub - https://github.com/esheri3/OWASP-CSRFGuard&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_Deprecated_Releases | Deprecated Releases]] - article containing several download references to deprecated and officially unsupported releases&lt;br /&gt;
&lt;br /&gt;
== User Manual(s) ==&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_User_Manual | OWASP CSRFGuard v3 ]] - series of articles describing the installation, configuration, and deployment of OWASP CSRFGuard v3.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
:*[http://www.owasp.org/index.php/Category:OWASP_CSRFTester_Project OWASP CSRFTester ] - utility to assist in the testing and generating PoC for CSRF attacks.&lt;br /&gt;
:*[[Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet | OWASP CSRF Prevention Cheat Sheet]] - provides a more holistic overview of CSRF prevention strategies and associated frameworks.&lt;br /&gt;
:*http://www.owasp.org/index.php/PHP_CSRF_Guard - project implementing CSRFGuard style solution for PHP.&lt;br /&gt;
:*http://www.thespanner.co.uk/2007/10/19/jsck/ - project implementing CSRFGuard style solution for PHP and JavaScript.&lt;br /&gt;
:*http://www.owasp.org/index.php/.Net_CSRF_Guard - project implementing CSRFGuard style solution for ASP.NET.&lt;br /&gt;
&lt;br /&gt;
== Project Sponsors == &lt;br /&gt;
&lt;br /&gt;
[[File:Infrared-logo-small.png | link=http://www.infraredsecurity.com]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!---==== Project About ====&lt;br /&gt;
{{:Projects/OWASP CSRFGuard Project| Project About}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &amp;lt;headertabs /&amp;gt;----&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Validation_Project]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:OWASP_Project|CSRFGuard Project]]&lt;br /&gt;
[[Category:OWASP_Java_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet&amp;diff=136936</id>
		<title>Cross-Site Request Forgery (CSRF) Prevention Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet&amp;diff=136936"/>
				<updated>2012-10-02T17:50:53Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Cross-Site Request Forgery (CSRF) is a type of attack that occurs when a malicious Web site, email, blog, instant message, or program causes a user’s Web browser to perform an unwanted action on a trusted site for which the user is currently authenticated. The impact of a successful cross-site request forgery attack is limited to the capabilities exposed by the vulnerable application. For example, this attack could result in a transfer of funds, changing a password, or purchasing an item in the user's context. In affect, CSRF attacks are used by an attacker to make a target system perform a function (funds Transfer, form submission etc.) via the target's browser without knowledge of the target user, at least until the unauthorized function has been committed.&lt;br /&gt;
&lt;br /&gt;
Impacts of successful CSRF exploits vary greatly based on the role of the victim. When targeting a normal user, a successful CSRF attack can compromise end-user data and their associated functions. If the targeted end user is an administrator account, a CSRF attack can compromise the entire Web application. The sites that are more likely to be attacked are community Websites (social networking, email) or sites that have high dollar value accounts associated with them (banks, stock brokerages, bill pay services). This attack can happen even if the user is logged into a Web site using strong encryption (HTTPS). Utilizing social engineering, an attacker will embed malicious HTML or JavaScript code into an email or Website to request a specific 'task url'. The task then executes with or without the user's knowledge, either directly or by utilizing a Cross-site Scripting flaw (ex: Samy MySpace Worm).&lt;br /&gt;
&lt;br /&gt;
For more information on CSRF, please see the OWASP [[Cross-Site Request Forgery (CSRF)]] page.&lt;br /&gt;
&lt;br /&gt;
= Prevention Measures That Do NOT Work =&lt;br /&gt;
&lt;br /&gt;
'''Using a Secret Cookie'''&lt;br /&gt;
&lt;br /&gt;
Remember that all cookies, even the secret ones, will be submitted with every request. All authentication tokens will be submitted regardless of whether or not the end-user was tricked into submitting the request. Furthermore, session identifiers are simply used by the application container to associate the request with a specific session object. The session identifier does not verify that the end-user intended to submit the request. &lt;br /&gt;
&lt;br /&gt;
'''Only Accepting POST Requests'''&lt;br /&gt;
&lt;br /&gt;
Applications can be developed to only accept POST requests for the execution of business logic. The misconception is that since the attacker cannot construct a malicious link, a CSRF attack cannot be executed. Unfortunately, this logic is incorrect. There are numerous methods in which an attacker can trick a victim into submitting a forged POST request, such as a simple form hosted in an attacker's Website with hidden values. This form can be triggered automatically by JavaScript or can be triggered by the victim who thinks the form will do something else.&lt;br /&gt;
&lt;br /&gt;
'''Multi-Step Transactions'''&lt;br /&gt;
&lt;br /&gt;
Multi-Step transactions are not an adequate prevention of CSRF. As long as an attacker can predict or deduce each step of the completed transaction, then CSRF is possible.&lt;br /&gt;
&lt;br /&gt;
'''URL Rewriting'''&lt;br /&gt;
&lt;br /&gt;
This might be seen as a useful CSRF prevention technique as the attacker can not guess the victim's session ID. However, the user’s credential is exposed over the URL.&lt;br /&gt;
&lt;br /&gt;
= General Recommendation: Synchronizer Token Pattern =&lt;br /&gt;
&lt;br /&gt;
In order to facilitate a &amp;quot;transparent but visible&amp;quot; CSRF solution, developers are encouraged to adopt the Synchronizer Token Pattern (http://www.corej2eepatterns.com/Design/PresoDesign.htm). The synchronizer token pattern requires the generating of random &amp;quot;challenge&amp;quot; tokens that are associated with the user's current session. These challenge tokens are the inserted within the HTML forms and links associated with sensitive server-side operations. When the user wishes to invoke these sensitive operations, the HTTP request should include this challenge token. It is then the responsibility of the server application to verify the existence and correctness of this token. By including a challenge token with each request, the developer has a strong control to verify that the user actually intended to submit the desired requests. Inclusion of a required security token in HTTP requests associated with sensitive business functions helps mitigate CSRF attacks as successful exploitation assumes the attacker knows the randomly generated token for the target victim's session. This is analogous to the attacker being able to guess the target victim's session identifier. The following synopsis describes a general approach to incorporate challenge tokens within the request.&lt;br /&gt;
&lt;br /&gt;
When a Web application formulates a request (by generating a link or form that causes a request when submitted or clicked by the user), the application should include a hidden input parameter with a common name such as &amp;quot;CSRFToken&amp;quot;. The value of this token must be randomly generated such that it cannot be guessed by an attacker. Consider leveraging the java.security.SecureRandom class for Java applications to generate a sufficiently long random token. Alternative generation algorithms include the use of 256-bit BASE64 encoded hashes. Developers that choose this generation algorithm must make sure that there is randomness and uniqueness utilized in the data that is hashed to generate the random token.&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;form action=&amp;quot;/transfer.do&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;CSRFToken&amp;quot; value=&amp;quot;OWY4NmQwODE4ODRjN2Q2NTlhMmZlYWEwYzU1YWQwMTVhM2JmNGYxYjJiMGI4MjJjZDE1ZDZjMTVi&lt;br /&gt;
   MGYwMGEwOA==&amp;quot;&amp;gt;&lt;br /&gt;
   …&lt;br /&gt;
   &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In general, developers need only generate this token once for the current session. After initial generation of this token, the value is stored in the session and is utilized for each subsequent request until the session expires. When a request is issued by the end-user, the server-side component must verify the existence and validity of the token in the request as compared to the token found in the session. If the token was not found within the request or the value provided does not match the value within the session, then the request should be aborted, token should be reset and the event logged as a potential CSRF attack in progress.&lt;br /&gt;
&lt;br /&gt;
To further enhance the security of this proposed design, consider randomizing the CSRF token parameter name and or value for each request. Implementing this approach results in the generation of per-request tokens as opposed to per-session tokens. Note, however, that this may result in usability concerns. For example, the &amp;quot;Back&amp;quot; button browser capability is often hindered as the previous page may contain a token that is no longer valid. Interaction with this previous page will result in a CSRF false positive security event at the server. Regardless of the approach taken, developers are encouraged to protect the CSRF token the same way they protect authenticated session identifiers, such as the use of SSLv3/TLS.&lt;br /&gt;
&lt;br /&gt;
=== Disclosure of Token in URL ===&lt;br /&gt;
&lt;br /&gt;
Many implementations of this control include the challenge token in GET (URL) requests as well as POST requests. This often implemented as a result of sensitive server-side operations being invoked as a result of embedded links in the page or other general design patterns. These patterns are often implemented without knowledge of CSRF and an understanding of CSRF prevention design strategies. While this control does help mitigate the risk of CSRF attacks, the unique per-session token is being exposed for GET requests. CSRF tokens in GET requests are potentially leaked at several locations: browser history, HTTP log files, network appliances that make a point to log the first line of an HTTP request, and Referrer headers if the protected site links to an external site.&lt;br /&gt;
&lt;br /&gt;
In the latter case (leaked CSRF token due to the Referer header being parsed by a linked site), it is trivially easy for the linked site to launch a CSRF attack on the protected site, and they will be able to target this attack very effectively, since the Referer header tells them the site as well as the CSRF token. The attack could be run entirely from javascript, so that a simple addition of a script tag to the HTML of a site can launch an attack (whether on an originally malicious site or on a hacked site). Timeouts on CSRF tokens are very unlikely to help this attack scenario.&lt;br /&gt;
&lt;br /&gt;
The ideal solution is to only include the CSRF token in POST requests and modify server-side actions that have state changing affect to only respond to POST requests. This is in fact what the [http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1.1 RFC 2616] requires for GET requests. If sensitive server-side actions are guaranteed to only ever respond to POST requests, then there is no need to include the token in GET requests.&lt;br /&gt;
&lt;br /&gt;
In most JavaEE web applications, however, HTTP method scoping is rarely ever utilized when retrieving HTTP parameters from a request. Calls to &amp;quot;HttpServletRequest.getParameter&amp;quot; will return a parameter value regardless if it was a GET or POST. This is not to say HTTP method scoping cannot be enforced. It can be achieved if a developer explicitly overrides doPost() in the HttpServlet class or leverages framework specific capabilities such as the AbstractFormController class in Spring.&lt;br /&gt;
&lt;br /&gt;
For these cases, attempting to retrofit this pattern in existing applications requires significant development time and cost, and as a temporary measure it may be better to pass CSRF tokens in the URL. Once the application has been fixed to respond to HTTP GET and POST verbs correctly, CSRF tokens for GET requests should be turned off.&lt;br /&gt;
&lt;br /&gt;
=== Viewstate (ASP.NET) ===&lt;br /&gt;
&lt;br /&gt;
ASP.NET has an option to maintain your ViewState. The ViewState indicates the status of a page when submitted to the server. The status is defined through a hidden field placed on each page with a &amp;lt;form runat=&amp;quot;server&amp;quot;&amp;gt; control. Viewstate can be used as a CSRF defense, as it is difficult for an attacker to forge a valid Viewstate. It is not impossible to forge a valid Viewstate since it is feasible that parameter values could be obtained or guessed by the attacker. However, if the current session ID is added to the ViewState, it then makes each Viewstate unique, and thus immune to CSRF. &lt;br /&gt;
&lt;br /&gt;
To use the ViewStateUserKey property within the Viewstate to protect against spoofed post backs. Add the following in the OnInit virtual method of the Page-derived class (This property must be set in the Page.Init event)&lt;br /&gt;
&lt;br /&gt;
   protected override OnInit(EventArgs e) {&lt;br /&gt;
      base.OnInit(e); &lt;br /&gt;
      if (User.Identity.IsAuthenticated)&lt;br /&gt;
         ViewStateUserKey = Session.SessionID; }&lt;br /&gt;
&lt;br /&gt;
The following keys the Viewstate to an individual using a unique value of your choice.&lt;br /&gt;
&lt;br /&gt;
    (Page.ViewStateUserKey)&lt;br /&gt;
&lt;br /&gt;
This must be applied in Page_Init because the key has to be provided to ASP.NET before Viewstate is loaded. This option has been available since ASP.NET 1.1.&lt;br /&gt;
&lt;br /&gt;
However, there are [http://keepitlocked.net/archive/2008/05/29/viewstateuserkey-doesn-t-prevent-cross-site-request-forgery.aspx limitations] on this mechanism.  Such as, ViewState MACs are only checked on POSTback, so any other application requests not using postbacks will happily allow CSRF.&lt;br /&gt;
&lt;br /&gt;
=== Double Submit Cookies ===&lt;br /&gt;
&lt;br /&gt;
Double submitting cookies is defined as sending the session ID cookie in two different ways for every form request. First as a traditional header value, and again as a hidden form value. When a user visits a site, the site should generate a (cryptographically strong) pseudorandom value and set it as a cookie on the user's machine. This is typically referred to as the session ID. The site should require every form submission to include this pseudorandom value as a hidden form value and also as a cookie value. When a POST request is sent to the site, the request should only be considered valid if the form value and the cookie value are the same. When an attacker submits a form on behalf of a user, he can only modify the values of the form. An attacker cannot read any data sent from the server or modify cookie values, per the same-origin policy. This means that while an attacker can send any value he wants with the form, the attacker will be unable to modify or read the value stored in the cookie. Since the cookie value and the form value must be the same, the attacker will be unable to successfully submit a form unless he is able to guess the session ID value.&lt;br /&gt;
&lt;br /&gt;
While this approach is effective in mitigating the risk of cross-site request forgery, including authenticated session identifiers in HTTP parameters may increase the overall risk of session hijacking. Architects and developers must ensure that no network appliances or custom application code or modules explicitly log or otherwise disclose HTTP POST parameters. An attacker that is able to obtain access to repositories or channels that leak HTTP POST parameters will be able to replay the tokens and perform session hijacking attacks. Note, however, that transparently logging all HTTP POST parameters is a rare occurrence across network systems and web applications as doing so will expose significant sensitive data aside from session identifiers including passwords, credit card numbers, and or social security numbers. Inclusion of the session identifier within HTML can also be leveraged by cross-site scripting attacks to bypass HTTPOnly protections. Most modern browsers prevent client-side script from accessing HTTPOnly cookies. However, this protection is lost if HTTPOnly session identifiers are placed within HTML as client-side script can easily traverse and extract the identifier from the DOM. Developers are still encouraged to implement the synchronizer token pattern as described in this article.&lt;br /&gt;
&lt;br /&gt;
[http://directwebremoting.org Direct Web Remoting (DWR)] Java library version 2.0 has CSRF protection built in as it implements the double cookie submission transparently.&lt;br /&gt;
&lt;br /&gt;
=== Prevention Frameworks ===&lt;br /&gt;
&lt;br /&gt;
There are CSRF prevention modules available for J2EE, .Net, and PHP.&lt;br /&gt;
&lt;br /&gt;
[[:Category:OWASP_CSRFGuard_Project | OWASP CSRF Guard (For Java)]]&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard Project makes use of a unique per-session token verification pattern using a JavaEE filter to mitigate the risk of CSRF attacks. When an HttpSession is first instantiated, CSRFGuard will generate a cryptographically random token using the SecureRandom class to be stored in the session. &lt;br /&gt;
&lt;br /&gt;
'''Similar Projects'''&lt;br /&gt;
&lt;br /&gt;
CSRFGuard has been implemented in other languages besides Java. They are: &lt;br /&gt;
&lt;br /&gt;
*[[PHP CSRF Guard]]&lt;br /&gt;
*[[.Net CSRF Guard]]&lt;br /&gt;
&lt;br /&gt;
== Challenge-Response ==&lt;br /&gt;
&lt;br /&gt;
Challenge-Response is another defense option for CSRF. The following are some examples of challenge-response options.&lt;br /&gt;
 &lt;br /&gt;
*CAPTCHA&lt;br /&gt;
*Re-Authentication (password)&lt;br /&gt;
*One-time Token&lt;br /&gt;
&lt;br /&gt;
While challenge-response is a very strong defense to CSRF (assuming proper implementation), it does impact user experience. For applications in need of high security, tokens (transparent) and challenge-response should be used on high risk functions.&lt;br /&gt;
&lt;br /&gt;
= Checking The Referer Header =&lt;br /&gt;
Although it is trivial to spoof the referer header on your own browser,  it is impossible to do so in a CSRF attack.  Checking the referer is a commonly used method of preventing CSRF on embedded network devices because it does not require a per-user state.  This makes a referer a useful method of CSRF prevention when memory is scarce.&lt;br /&gt;
&lt;br /&gt;
However, checking the referer is considered to be a weaker from of CSRF protection.  For example,  open redirect vulnerabilities can be used to exploit GET-based requests that are protected with a referer check.  It should be noted that GET requests should never incur a state change as this is a violation of the HTTP specification. &lt;br /&gt;
&lt;br /&gt;
There are also common implementation mistakes with referer checks.  For example if the CSRF attack originates from an HTTPS domain then the referer will be omitted.  In this case the lack of a referer should be considered to be an attack when the request is performing a state change.   Also note that the attacker has limited influence over the referer.   For example,  if the victim's domain is &amp;quot;site.com&amp;quot; then an attacker have the CSRF exploit originate from &amp;quot;site.com.attacker.com&amp;quot; which may fool a broken referer check implementation.  XSS can be used to bypass a referer check. &lt;br /&gt;
&lt;br /&gt;
= Checking The Origin Header =&lt;br /&gt;
The [https://wiki.mozilla.org/Security/Origin Origin HTTP Header] was introduced as a method of defending against CSRF and other Cross-Domain attacks.  Unlike the referer, the origin will be present in HTTP request that originates from an HTTPS url.&lt;br /&gt;
&lt;br /&gt;
If the origin header is present,  then it should be checked for consistency.&lt;br /&gt;
&lt;br /&gt;
= Client/User Prevention =&lt;br /&gt;
&lt;br /&gt;
Since CSRF vulnerabilities are reportedly widespread, it is recommended to follow best practices to mitigate risk. Some mitigating include: &lt;br /&gt;
&lt;br /&gt;
* Logoff immediately after using a Web application &lt;br /&gt;
* Do not allow your browser to save username/passwords, and do not allow sites to “remember” your login &lt;br /&gt;
* Do not use the same browser to access sensitive applications and to surf the Internet freely (tabbed browsing). &lt;br /&gt;
* The use of plugins such as No-Script makes POST based CSRF vulnerabilities difficult to exploit.  This is because JavaScript is used to automatically submit the form when the exploit is loaded. Without JavaScript the attacker would have to trick the user into submitting the form manually. &lt;br /&gt;
&lt;br /&gt;
Integrated HTML-enabled mail/browser and newsreader/browser environments pose additional risks since simply viewing a mail message or a news message might lead to the execution of an attack. &lt;br /&gt;
&lt;br /&gt;
= No Cross-Site Scripting (XSS) Vulnerabilities =&lt;br /&gt;
&lt;br /&gt;
Cross-Site Scripting is not necessary for CSRF to work. However, all stored cross-site scripting attacks can be used to defeat token, referer and origin based CSRF defenses,  This is because an XSS payload can simply read any page on the site using a XMLHttpRequest and obtain the generated token from the response, and include that token with a forged request. This technique is exactly how the [http://en.wikipedia.org/wiki/Samy_(XSS) MySpace (Samy) worm] defeated MySpace's anti CSRF defenses in 2005, which enabled the worm to propagate. XSS cannot defeat challenge-response defenses such as Captcha, re-authentication or one-time passwords. It is imperative that no XSS vulnerabilities are present to ensure that CSRF defenses can't be circumvented. Please see the OWASP [[XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet | XSS Prevention Cheat Sheet]] for detailed guidance on how to prevent XSS flaws.&lt;br /&gt;
&lt;br /&gt;
= Related Articles =&lt;br /&gt;
&lt;br /&gt;
'''Cross-Site Request Forgery (CSRF)'''&lt;br /&gt;
&lt;br /&gt;
For more information on CSRF please see the OWASP [[Cross-Site Request Forgery (CSRF)]] page.&lt;br /&gt;
&lt;br /&gt;
'''How to Review Code for CSRF Vulnerabilities'''&lt;br /&gt;
&lt;br /&gt;
See the [[:Category:OWASP_Code_Review_Project | OWASP Code Review Guide]] article on how to [[Reviewing code for Cross-Site Request Forgery issues]]. &lt;br /&gt;
&lt;br /&gt;
'''How to Test for CSRF Vulnerabilities'''&lt;br /&gt;
&lt;br /&gt;
See the [[:Category:OWASP_Testing_Project | OWASP Testing Guide]] article on how to [[Testing_for_CSRF_(OWASP-SM-005) | Test for CSRF Vulnerabilities]]. &lt;br /&gt;
&lt;br /&gt;
'''CSRF Testing Tool'''&lt;br /&gt;
&lt;br /&gt;
Check out the [[:Category:OWASP_CSRFTester_Project | OWASP CSRF Tester]] tool which allows you to test for CSRF vulnerabilities. This tool is also written in Java. &lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
[http://www.isecpartners.com/files/XSRF_Paper_0.pdf Cross Site Reference Forgery: An introduction to a common web application weakness]&lt;br /&gt;
&lt;br /&gt;
[http://www.freedom-to-tinker.com/sites/default/files/csrf.pdf Cross-Site Request Forgeries: Exploitation and Prevention]&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
Paul Petefish - paulpetefish[at]solutionary.com&amp;lt;br/&amp;gt;&lt;br /&gt;
Eric Sheridan - eric[at]infraredsecurity.com&amp;lt;br/&amp;gt;&lt;br /&gt;
Dave Wichers - dave.wichers[at]aspectsecurity.com &lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
{{Cheatsheet_Navigation}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Appsec_Tutorial_Series&amp;diff=125014</id>
		<title>OWASP Appsec Tutorial Series</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Appsec_Tutorial_Series&amp;diff=125014"/>
				<updated>2012-02-24T18:50:45Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview  =&lt;br /&gt;
&lt;br /&gt;
Welcome to the home of the OWASP AppSec Tutorial Series project! The OWASP AppSec Tutorial Series project provides a video based means of conveying complex application security concepts in an easily accessible and understandable way. Each video is approximately 5-10 minutes long and highlights one or more specific application security concepts, tools, or methodologies. The goal of the project is quite simple and yet quite audacious - provide top notch application security video based training... for free!&lt;br /&gt;
&lt;br /&gt;
= Project Goals  =&lt;br /&gt;
&lt;br /&gt;
While there are a significant number of objectives we hope to achieve, the OWASP AppSec Tutorial Series is focused on the following goals:&lt;br /&gt;
&lt;br /&gt;
* Create top notch application security video based training materials&lt;br /&gt;
* Convey complex application security topics in a fun and informative way&lt;br /&gt;
* MAKE APPSEC MORE VISIBLE!&lt;br /&gt;
&lt;br /&gt;
= Episode List  =&lt;br /&gt;
&lt;br /&gt;
*[http://www.youtube.com/watch?v=CDbWvEwBBxo Episode 1 - Introduction]&lt;br /&gt;
*[http://www.youtube.com/watch?v=pypTYPaU7mM Episode 2 - Injection Attacks]&lt;br /&gt;
*[http://www.youtube.com/watch?v=_Z9RQSnf8-g Episode 3 - Cross Site Scripting]&lt;br /&gt;
&lt;br /&gt;
= Project Lead =&lt;br /&gt;
&lt;br /&gt;
[mailto:jerry@owasp.org Jerry Hoff] is the lead of the OWASP AppSec Tutorial Series project, is VP of the Static Code Analysis division at WhiteHat Security and is a Managing Partner at Infrared Security. Having performed code reviews and penetration tests of hundreds of applications for Fortune 500 companies, Jerry Hoff is an experienced application security practitioner. He also has over a decade of professional training experience at an advanced degree level. His application security experience coupled with his training experience helps ensure the OWASP AppSec Tutorial Series project continues to deliver exceptional episodes free for the community!&lt;br /&gt;
&lt;br /&gt;
= License = &lt;br /&gt;
&lt;br /&gt;
The OWASP Appsec Tutorial Series is released under the [http://creativecommons.org/licenses/by-nc/3.0/ Attribution-NonCommercial license].&lt;br /&gt;
&lt;br /&gt;
= Project Sponsor =&lt;br /&gt;
&lt;br /&gt;
The OWASP Appsec Tutorial Series is sponsored by [http://www.infraredsecurity.com Infrared Security].&lt;br /&gt;
&lt;br /&gt;
[[File:Infrared-logo-small.png | link=http://www.infraredsecurity.com]]&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Appsec_Tutorial_Series&amp;diff=120004</id>
		<title>OWASP Appsec Tutorial Series</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Appsec_Tutorial_Series&amp;diff=120004"/>
				<updated>2011-11-11T13:53:46Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview  =&lt;br /&gt;
&lt;br /&gt;
Welcome to the home of the OWASP AppSec Tutorial Series project! The OWASP AppSec Tutorial Series project provides a video based means of conveying complex application security concepts in an easily accessible and understandable way. Each video is approximately 5-10 minutes long and highlights one or more specific application security concepts, tools, or methodologies. The goal of the project is quite simple and yet quite audacious - provide top notch application security video based training... for free! It is our hope that the community&lt;br /&gt;
&lt;br /&gt;
= Project Goals  =&lt;br /&gt;
&lt;br /&gt;
While there are a significant number of objectives we hope to achieve, the OWASP AppSec Tutorial Series is focused on the following audacious goals:&lt;br /&gt;
&lt;br /&gt;
* Create top notch application security video based training materials&lt;br /&gt;
* Convey complex application security topics in a fun and informative way&lt;br /&gt;
* Be able to deliver the material for free!&lt;br /&gt;
&lt;br /&gt;
= Episode List  =&lt;br /&gt;
&lt;br /&gt;
*[http://www.youtube.com/watch?v=CDbWvEwBBxo Episode 1 - Introduction]&lt;br /&gt;
*[http://www.youtube.com/watch?v=pypTYPaU7mM Episode 2 - Injection Attacks]&lt;br /&gt;
*[http://www.youtube.com/watch?v=_Z9RQSnf8-g Episode 3 - Cross Site Scripting]&lt;br /&gt;
&lt;br /&gt;
= Project Lead =&lt;br /&gt;
&lt;br /&gt;
[mailto:jerry@owasp.org Jerry Hoff] is the lead of the OWASP AppSec Tutorial Series project and is a Managing Partner at [http://www.infraredsecurity.com Infrared Security]. Having performed code reviews and penetration tests of hundreds of applications for Fortune 500 companies, Jerry Hoff is an experienced application security practitioner. He also has over a decade of professional training experience at an advanced degree level. His application security experience coupled with his training experience helps ensure the OWASP AppSec Tutorial Series project continues to deliver exceptional episodes free for the community!&lt;br /&gt;
&lt;br /&gt;
= License = &lt;br /&gt;
&lt;br /&gt;
The OWASP Appsec Tutorial Series is released under the [http://creativecommons.org/licenses/by-nc/3.0/ Attribution-NonCommercial license].&lt;br /&gt;
&lt;br /&gt;
=Project Sponsor=&lt;br /&gt;
&lt;br /&gt;
[[File:Infrared-logo-small.png | link=http://www.infraredsecurity.com]]&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Appsec_Tutorial_Series&amp;diff=120003</id>
		<title>OWASP Appsec Tutorial Series</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Appsec_Tutorial_Series&amp;diff=120003"/>
				<updated>2011-11-11T13:53:17Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview  =&lt;br /&gt;
&lt;br /&gt;
Welcome to the home of the OWASP AppSec Tutorial Series project! The OWASP AppSec Tutorial Series project provides a video based means of conveying complex application security concepts in an easily accessible and understandable way. Each video is approximately 5-10 minutes long and highlights one or more specific application security concepts, tools, or methodologies. The goal of the project is quite simple and yet quite audacious - provide top notch application security video based training... for free! It is our hope that the community&lt;br /&gt;
&lt;br /&gt;
= Project Goals  =&lt;br /&gt;
&lt;br /&gt;
While there are a significant number of objectives we hope to achieve, the OWASP AppSec Tutorial Series is focused on the following audacious goals:&lt;br /&gt;
&lt;br /&gt;
* Create top notch application security video based training materials&lt;br /&gt;
* Convey complex application security topics in a fun and informative way&lt;br /&gt;
* Be able to deliver the material for free!&lt;br /&gt;
&lt;br /&gt;
= Episode List  =&lt;br /&gt;
&lt;br /&gt;
*[http://www.youtube.com/watch?v=CDbWvEwBBxo Episode 1 - Introduction]&lt;br /&gt;
*[http://www.youtube.com/watch?v=pypTYPaU7mM Episode 2 - Injection Attacks]&lt;br /&gt;
*[http://www.youtube.com/watch?v=_Z9RQSnf8-g Episode 3 - Cross Site Scripting]&lt;br /&gt;
&lt;br /&gt;
= Project Lead =&lt;br /&gt;
&lt;br /&gt;
[mailto:jerry@owasp.org Jerry Hoff] is the lead of the OWASP AppSec Tutorial Series project and is a Managing Partner at [http://www.infraredsecurity.com Infrared Security]. Having performed code reviews and penetration tests of hundreds of applications for Fortune 500 companies, Jerry Hoff is an experienced application security practitioner. He also has over a decade of professional training experience at an advanced degree level. His application security experience coupled with his training experience helps ensure the OWASP AppSec Tutorial Series project continues to deliver exceptional episodes free for the community!&lt;br /&gt;
&lt;br /&gt;
= License = &lt;br /&gt;
&lt;br /&gt;
The OWASP Appsec Tutorial Series is released under the [http://creativecommons.org/licenses/by-nc/3.0/ Attribution-NonCommercial license].&lt;br /&gt;
&lt;br /&gt;
=Project Sponsor=&lt;br /&gt;
&lt;br /&gt;
[[File:Infrared-logo-small.png | link=http://www.infraredsecurity.com]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Appsec_Tutorial_Series&amp;diff=120002</id>
		<title>OWASP Appsec Tutorial Series</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Appsec_Tutorial_Series&amp;diff=120002"/>
				<updated>2011-11-11T13:34:52Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==== Main  ====&lt;br /&gt;
&lt;br /&gt;
= Overview  =&lt;br /&gt;
&lt;br /&gt;
The OWASP Appsec Tutorial Series breaks down security concepts in a easily accessible, friendly way.  Each video is 5-10 minutes long and highlights a different security concept, tool or methodology.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Project Goals  =&lt;br /&gt;
&lt;br /&gt;
The goal is to cover each major OWASP project in a fun, informative way. &lt;br /&gt;
&lt;br /&gt;
= Episode List  =&lt;br /&gt;
&lt;br /&gt;
*[http://www.youtube.com/watch?v=CDbWvEwBBxo Episode 1 - Introduction]&lt;br /&gt;
*[http://www.youtube.com/watch?v=pypTYPaU7mM Episode 2 - Injection Attacks]&lt;br /&gt;
*[http://www.youtube.com/watch?v=_Z9RQSnf8-g Episode 3 - Cross Site Scripting]&lt;br /&gt;
&lt;br /&gt;
= Participants List =&lt;br /&gt;
* Project Lead:&lt;br /&gt;
** Jerry Hoff - jerry@owasp.org&lt;br /&gt;
&lt;br /&gt;
=Project Sponsor=&lt;br /&gt;
&lt;br /&gt;
[[File:Infrared-logo-small.png | link=http://www.infraredsecurity.com]]&lt;br /&gt;
&lt;br /&gt;
= License = &lt;br /&gt;
The OWASP Appsec Tutorial Series is released under the Attribution-NonCommercial license.&lt;br /&gt;
&lt;br /&gt;
http://creativecommons.org/licenses/by-nc/3.0/&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=120001</id>
		<title>Category:OWASP CSRFGuard Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=120001"/>
				<updated>2011-11-11T13:34:09Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Project Lead */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!---==== Main  ====---&amp;gt;&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the home of the OWASP CSRFGuard Project! OWASP CSRFGuard is a library that implements a variant of the [http://www.corej2eepatterns.com/Design/PresoDesign.htm 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.&lt;br /&gt;
&lt;br /&gt;
== Project Lead ==&lt;br /&gt;
&lt;br /&gt;
[mailto:eric@infraredsecurity.com Eric Sheridan] is the lead and primary developer of the OWASP CSRFGuard project and a Managing Partner at [http://www.infraredsecurity.com Infrared Security]. Aside from leading up CSRFGuard, Eric has contributed to or provided guidance on numerous other OWASP projects including CSRF Prevention Cheat Sheet, WebGoat, Stinger, CSRFTester, and Enterprise Security API (ESAPI). As Managing Partner at Infrared Security, Eric Sheridan specializes in a wide variety of application security activities including static analysis, penetration tests, code reviews, and threat modeling. In his personal time... wait, what is that?&lt;br /&gt;
&lt;br /&gt;
== License ==&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard is offered under the [http://www.opensource.org/licenses/bsd-license.php BSD] license. For further information on OWASP licenses, please consult the [[OWASP Licenses]] page.&lt;br /&gt;
&lt;br /&gt;
== Email List ==&lt;br /&gt;
&lt;br /&gt;
You can sign up for the OWASP CSRFGuard email list at [https://lists.owasp.org/mailman/listinfo/owasp-csrfguard https://lists.owasp.org/mailman/listinfo/owasp-csrfguard]&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
You can access the Git repository online at https://github.com/esheri3/OWASP-CSRFGuard&lt;br /&gt;
&lt;br /&gt;
== Downloads ==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/downloads/esheri3/OWASP-CSRFGuard/Owasp-CsrfGuard-3.0.0.503.tar.gz OWASP CSRFGuard 3.0.0.503 (ALPHA)] - download the latest development release with binary and associated configuration files '''(recommended)'''.&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_Deprecated_Releases | Deprecated Releases]] - article containing several download references to deprecated and officially unsupported releases&lt;br /&gt;
&lt;br /&gt;
== User Manual(s) ==&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_User_Manual | OWASP CSRFGuard v3 ]] - series of articles describing the installation, configuration, and deployment of OWASP CSRFGuard v3.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
:*[http://www.owasp.org/index.php/Category:OWASP_CSRFTester_Project OWASP CSRFTester ] - utility to assist in the testing and generating PoC for CSRF attacks.&lt;br /&gt;
:*[[Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet | OWASP CSRF Prevention Cheat Sheet]] - provides a more holistic overview of CSRF prevention strategies and associated frameworks.&lt;br /&gt;
:*http://www.owasp.org/index.php/PHP_CSRF_Guard - project implementing CSRFGuard style solution for PHP.&lt;br /&gt;
:*http://www.thespanner.co.uk/2007/10/19/jsck/ - project implementing CSRFGuard style solution for PHP and JavaScript.&lt;br /&gt;
:*http://www.owasp.org/index.php/.Net_CSRF_Guard - project implementing CSRFGuard style solution for ASP.NET.&lt;br /&gt;
&lt;br /&gt;
== Project Sponsors == &lt;br /&gt;
&lt;br /&gt;
[[File:Infrared-logo-small.png | link=http://www.infraredsecurity.com]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!---==== Project About ====&lt;br /&gt;
{{:Projects/OWASP CSRFGuard Project| Project About}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &amp;lt;headertabs /&amp;gt;----&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Validation_Project]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:OWASP_Project|CSRFGuard Project]]&lt;br /&gt;
[[Category:OWASP_Java_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=120000</id>
		<title>Category:OWASP CSRFGuard Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=120000"/>
				<updated>2011-11-11T13:33:20Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Project Lead */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!---==== Main  ====---&amp;gt;&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the home of the OWASP CSRFGuard Project! OWASP CSRFGuard is a library that implements a variant of the [http://www.corej2eepatterns.com/Design/PresoDesign.htm 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.&lt;br /&gt;
&lt;br /&gt;
== Project Lead ==&lt;br /&gt;
&lt;br /&gt;
Eric Sheridan (mailto:eric@infraredsecurity.com) is the lead and primary developer of the OWASP CSRFGuard project and a Managing Partner at Infrared Security (http://www.infraredsecurity.com). Aside from leading up CSRFGuard, Eric has contributed to or provided guidance on numerous other OWASP projects including CSRF Prevention Cheat Sheet, WebGoat, Stinger, CSRFTester, and Enterprise Security API (ESAPI). As Managing Partner at Infrared Security, Eric Sheridan specializes in a wide variety of application security activities including static analysis, penetration tests, code reviews, and threat modeling. In his personal time... wait, what is that?&lt;br /&gt;
&lt;br /&gt;
== License ==&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard is offered under the [http://www.opensource.org/licenses/bsd-license.php BSD] license. For further information on OWASP licenses, please consult the [[OWASP Licenses]] page.&lt;br /&gt;
&lt;br /&gt;
== Email List ==&lt;br /&gt;
&lt;br /&gt;
You can sign up for the OWASP CSRFGuard email list at [https://lists.owasp.org/mailman/listinfo/owasp-csrfguard https://lists.owasp.org/mailman/listinfo/owasp-csrfguard]&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
You can access the Git repository online at https://github.com/esheri3/OWASP-CSRFGuard&lt;br /&gt;
&lt;br /&gt;
== Downloads ==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/downloads/esheri3/OWASP-CSRFGuard/Owasp-CsrfGuard-3.0.0.503.tar.gz OWASP CSRFGuard 3.0.0.503 (ALPHA)] - download the latest development release with binary and associated configuration files '''(recommended)'''.&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_Deprecated_Releases | Deprecated Releases]] - article containing several download references to deprecated and officially unsupported releases&lt;br /&gt;
&lt;br /&gt;
== User Manual(s) ==&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_User_Manual | OWASP CSRFGuard v3 ]] - series of articles describing the installation, configuration, and deployment of OWASP CSRFGuard v3.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
:*[http://www.owasp.org/index.php/Category:OWASP_CSRFTester_Project OWASP CSRFTester ] - utility to assist in the testing and generating PoC for CSRF attacks.&lt;br /&gt;
:*[[Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet | OWASP CSRF Prevention Cheat Sheet]] - provides a more holistic overview of CSRF prevention strategies and associated frameworks.&lt;br /&gt;
:*http://www.owasp.org/index.php/PHP_CSRF_Guard - project implementing CSRFGuard style solution for PHP.&lt;br /&gt;
:*http://www.thespanner.co.uk/2007/10/19/jsck/ - project implementing CSRFGuard style solution for PHP and JavaScript.&lt;br /&gt;
:*http://www.owasp.org/index.php/.Net_CSRF_Guard - project implementing CSRFGuard style solution for ASP.NET.&lt;br /&gt;
&lt;br /&gt;
== Project Sponsors == &lt;br /&gt;
&lt;br /&gt;
[[File:Infrared-logo-small.png | link=http://www.infraredsecurity.com]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!---==== Project About ====&lt;br /&gt;
{{:Projects/OWASP CSRFGuard Project| Project About}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &amp;lt;headertabs /&amp;gt;----&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Validation_Project]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:OWASP_Project|CSRFGuard Project]]&lt;br /&gt;
[[Category:OWASP_Java_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=119999</id>
		<title>Category:OWASP CSRFGuard Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=119999"/>
				<updated>2011-11-11T13:33:01Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Project Lead */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!---==== Main  ====---&amp;gt;&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the home of the OWASP CSRFGuard Project! OWASP CSRFGuard is a library that implements a variant of the [http://www.corej2eepatterns.com/Design/PresoDesign.htm 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.&lt;br /&gt;
&lt;br /&gt;
== Project Lead ==&lt;br /&gt;
&lt;br /&gt;
Eric Sheridan [(eric@infraredsecurity.com)](mailto:eric@infraredsecurity.com) is the lead and primary developer of the OWASP CSRFGuard project and a Managing Partner at Infrared Security (http://www.infraredsecurity.com). Aside from leading up CSRFGuard, Eric has contributed to or provided guidance on numerous other OWASP projects including CSRF Prevention Cheat Sheet, WebGoat, Stinger, CSRFTester, and Enterprise Security API (ESAPI). As Managing Partner at Infrared Security, Eric Sheridan specializes in a wide variety of application security activities including static analysis, penetration tests, code reviews, and threat modeling. In his personal time... wait, what is that?&lt;br /&gt;
&lt;br /&gt;
== License ==&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard is offered under the [http://www.opensource.org/licenses/bsd-license.php BSD] license. For further information on OWASP licenses, please consult the [[OWASP Licenses]] page.&lt;br /&gt;
&lt;br /&gt;
== Email List ==&lt;br /&gt;
&lt;br /&gt;
You can sign up for the OWASP CSRFGuard email list at [https://lists.owasp.org/mailman/listinfo/owasp-csrfguard https://lists.owasp.org/mailman/listinfo/owasp-csrfguard]&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
You can access the Git repository online at https://github.com/esheri3/OWASP-CSRFGuard&lt;br /&gt;
&lt;br /&gt;
== Downloads ==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/downloads/esheri3/OWASP-CSRFGuard/Owasp-CsrfGuard-3.0.0.503.tar.gz OWASP CSRFGuard 3.0.0.503 (ALPHA)] - download the latest development release with binary and associated configuration files '''(recommended)'''.&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_Deprecated_Releases | Deprecated Releases]] - article containing several download references to deprecated and officially unsupported releases&lt;br /&gt;
&lt;br /&gt;
== User Manual(s) ==&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_User_Manual | OWASP CSRFGuard v3 ]] - series of articles describing the installation, configuration, and deployment of OWASP CSRFGuard v3.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
:*[http://www.owasp.org/index.php/Category:OWASP_CSRFTester_Project OWASP CSRFTester ] - utility to assist in the testing and generating PoC for CSRF attacks.&lt;br /&gt;
:*[[Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet | OWASP CSRF Prevention Cheat Sheet]] - provides a more holistic overview of CSRF prevention strategies and associated frameworks.&lt;br /&gt;
:*http://www.owasp.org/index.php/PHP_CSRF_Guard - project implementing CSRFGuard style solution for PHP.&lt;br /&gt;
:*http://www.thespanner.co.uk/2007/10/19/jsck/ - project implementing CSRFGuard style solution for PHP and JavaScript.&lt;br /&gt;
:*http://www.owasp.org/index.php/.Net_CSRF_Guard - project implementing CSRFGuard style solution for ASP.NET.&lt;br /&gt;
&lt;br /&gt;
== Project Sponsors == &lt;br /&gt;
&lt;br /&gt;
[[File:Infrared-logo-small.png | link=http://www.infraredsecurity.com]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!---==== Project About ====&lt;br /&gt;
{{:Projects/OWASP CSRFGuard Project| Project About}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &amp;lt;headertabs /&amp;gt;----&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Validation_Project]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:OWASP_Project|CSRFGuard Project]]&lt;br /&gt;
[[Category:OWASP_Java_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CSRFGuard_3_User_Manual&amp;diff=119998</id>
		<title>CSRFGuard 3 User Manual</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CSRFGuard_3_User_Manual&amp;diff=119998"/>
				<updated>2011-11-11T13:30:36Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
Welcome to the OWASP CSRFGuard 3 User Manual! The purpose of this article is to provide the user with guidance on obtaining, installing, deploying, and developing with the OWASP CSRFGuard library. The author's goal was to keep the User Manual informative, use to understand, and concise. If you find that one or more aspects of this document does not adhere to these goals, please me know at eric dot sheridan at owasp dot org.&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
Users can download the latest release of OWASP CSRFGuard using one of the following links:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/downloads/esheri3/OWASP-CSRFGuard/Owasp-CsrfGuard-3.0.0.503.tar.gz OWASP CSRFGuard 3.0.0.503 (ALPHA)] - download the latest development release with binary and associated configuration files '''(recommended)'''.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
Installation of OWASP CSRFGuard 3 is very straight forward requiring three simple steps:&lt;br /&gt;
&lt;br /&gt;
:# Copy the Owasp.CsrfGuard.jar file to your application's classpath&lt;br /&gt;
:# Declare CsrfGuard in your application's deployment descriptor (web.xml)&lt;br /&gt;
:# Configure the Owasp.CsrfGuard.properties file as you see fit&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Installation | Click here]] for more detailed information regarding the installation of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
&lt;br /&gt;
The minimum configuration settings that users should review include:&lt;br /&gt;
&lt;br /&gt;
:* Default new token landing page (org.owasp.csrfguard.NewTokenLandingPage)&lt;br /&gt;
:* Support for Ajax and XMLHttpRequest (org.owasp.csrfguard.Ajax)&lt;br /&gt;
:* URI resources that should not be protected (org.owasp.csrfguard.unprotected.*)&lt;br /&gt;
:* Actions executed when an attack is detected (org.owasp.csrfguard.action.*)&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Configuration | Click here]] for more information regarding the configuration of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
= Token Injection =&lt;br /&gt;
&lt;br /&gt;
Users of OWASP CSRFGuard can inject prevention tokens into HTML using two strategies:&lt;br /&gt;
&lt;br /&gt;
:* JavaScript DOM Manipulation - largely automated process requiring minimal effort and is ideal for most web applications&lt;br /&gt;
:* JSP Tag Library - provides fine grained strategy ideal for situations where automated DOM manipulation is insufficient.&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Token_Injection | Click here]] for more information regarding the injection of CSRF prevention tokens within your application.&lt;br /&gt;
&lt;br /&gt;
= Known Issues =&lt;br /&gt;
&lt;br /&gt;
The following is a quick bulleted list of known issues within the current release:&lt;br /&gt;
&lt;br /&gt;
:* No known way to inject CSRF prevention tokens into setters of document.location (ex: document.location=&amp;quot;http://www.owasp.org&amp;quot;;)&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_CSRFGuard_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=119864</id>
		<title>Category:OWASP CSRFGuard Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=119864"/>
				<updated>2011-11-07T21:42:28Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Project Sponsors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!---==== Main  ====---&amp;gt;&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the home of the OWASP CSRFGuard Project! OWASP CSRFGuard is a library that implements a variant of the [http://www.corej2eepatterns.com/Design/PresoDesign.htm 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.&lt;br /&gt;
&lt;br /&gt;
== Project Lead ==&lt;br /&gt;
&lt;br /&gt;
[http://ericsheridan.blogspot.com/ Eric Sheridan] (eric dot sheridan at owasp dot org) is the lead and primary developer of the OWASP CSRFGuard project. Aside from leading up CSRFGuard, Eric has contributed to or provided guidance on numerous other OWASP projects including the Cross-Site Request Forgery Prevention Cheat Sheet, WebGoat, Stinger, CSRFTester, and Enterprise Security API (ESAPI). He is an Independent Application Security Consultant specializing in a wide variety of application security activities including static analysis, penetration tests, code reviews, and threat modeling. In his personal time... wait, what is that?&lt;br /&gt;
&lt;br /&gt;
== License ==&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard is offered under the [http://www.opensource.org/licenses/bsd-license.php BSD] license. For further information on OWASP licenses, please consult the [[OWASP Licenses]] page.&lt;br /&gt;
&lt;br /&gt;
== Email List ==&lt;br /&gt;
&lt;br /&gt;
You can sign up for the OWASP CSRFGuard email list at [https://lists.owasp.org/mailman/listinfo/owasp-csrfguard https://lists.owasp.org/mailman/listinfo/owasp-csrfguard]&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
You can access the Git repository online at https://github.com/esheri3/OWASP-CSRFGuard&lt;br /&gt;
&lt;br /&gt;
== Downloads ==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/downloads/esheri3/OWASP-CSRFGuard/Owasp-CsrfGuard-3.0.0.503.tar.gz OWASP CSRFGuard 3.0.0.503 (ALPHA)] - download the latest development release with binary and associated configuration files '''(recommended)'''.&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_Deprecated_Releases | Deprecated Releases]] - article containing several download references to deprecated and officially unsupported releases&lt;br /&gt;
&lt;br /&gt;
== User Manual(s) ==&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_User_Manual | OWASP CSRFGuard v3 ]] - series of articles describing the installation, configuration, and deployment of OWASP CSRFGuard v3.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
:*[http://www.owasp.org/index.php/Category:OWASP_CSRFTester_Project OWASP CSRFTester ] - utility to assist in the testing and generating PoC for CSRF attacks.&lt;br /&gt;
:*[[Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet | OWASP CSRF Prevention Cheat Sheet]] - provides a more holistic overview of CSRF prevention strategies and associated frameworks.&lt;br /&gt;
:*http://www.owasp.org/index.php/PHP_CSRF_Guard - project implementing CSRFGuard style solution for PHP.&lt;br /&gt;
:*http://www.thespanner.co.uk/2007/10/19/jsck/ - project implementing CSRFGuard style solution for PHP and JavaScript.&lt;br /&gt;
:*http://www.owasp.org/index.php/.Net_CSRF_Guard - project implementing CSRFGuard style solution for ASP.NET.&lt;br /&gt;
&lt;br /&gt;
== Project Sponsors == &lt;br /&gt;
&lt;br /&gt;
[[File:Infrared-logo-small.png | link=http://www.infraredsecurity.com]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!---==== Project About ====&lt;br /&gt;
{{:Projects/OWASP CSRFGuard Project| Project About}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &amp;lt;headertabs /&amp;gt;----&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Validation_Project]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:OWASP_Project|CSRFGuard Project]]&lt;br /&gt;
[[Category:OWASP_Java_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=119863</id>
		<title>Category:OWASP CSRFGuard Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=119863"/>
				<updated>2011-11-07T21:40:37Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Project Sponsors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!---==== Main  ====---&amp;gt;&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the home of the OWASP CSRFGuard Project! OWASP CSRFGuard is a library that implements a variant of the [http://www.corej2eepatterns.com/Design/PresoDesign.htm 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.&lt;br /&gt;
&lt;br /&gt;
== Project Lead ==&lt;br /&gt;
&lt;br /&gt;
[http://ericsheridan.blogspot.com/ Eric Sheridan] (eric dot sheridan at owasp dot org) is the lead and primary developer of the OWASP CSRFGuard project. Aside from leading up CSRFGuard, Eric has contributed to or provided guidance on numerous other OWASP projects including the Cross-Site Request Forgery Prevention Cheat Sheet, WebGoat, Stinger, CSRFTester, and Enterprise Security API (ESAPI). He is an Independent Application Security Consultant specializing in a wide variety of application security activities including static analysis, penetration tests, code reviews, and threat modeling. In his personal time... wait, what is that?&lt;br /&gt;
&lt;br /&gt;
== License ==&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard is offered under the [http://www.opensource.org/licenses/bsd-license.php BSD] license. For further information on OWASP licenses, please consult the [[OWASP Licenses]] page.&lt;br /&gt;
&lt;br /&gt;
== Email List ==&lt;br /&gt;
&lt;br /&gt;
You can sign up for the OWASP CSRFGuard email list at [https://lists.owasp.org/mailman/listinfo/owasp-csrfguard https://lists.owasp.org/mailman/listinfo/owasp-csrfguard]&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
You can access the Git repository online at https://github.com/esheri3/OWASP-CSRFGuard&lt;br /&gt;
&lt;br /&gt;
== Downloads ==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/downloads/esheri3/OWASP-CSRFGuard/Owasp-CsrfGuard-3.0.0.503.tar.gz OWASP CSRFGuard 3.0.0.503 (ALPHA)] - download the latest development release with binary and associated configuration files '''(recommended)'''.&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_Deprecated_Releases | Deprecated Releases]] - article containing several download references to deprecated and officially unsupported releases&lt;br /&gt;
&lt;br /&gt;
== User Manual(s) ==&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_User_Manual | OWASP CSRFGuard v3 ]] - series of articles describing the installation, configuration, and deployment of OWASP CSRFGuard v3.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
:*[http://www.owasp.org/index.php/Category:OWASP_CSRFTester_Project OWASP CSRFTester ] - utility to assist in the testing and generating PoC for CSRF attacks.&lt;br /&gt;
:*[[Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet | OWASP CSRF Prevention Cheat Sheet]] - provides a more holistic overview of CSRF prevention strategies and associated frameworks.&lt;br /&gt;
:*http://www.owasp.org/index.php/PHP_CSRF_Guard - project implementing CSRFGuard style solution for PHP.&lt;br /&gt;
:*http://www.thespanner.co.uk/2007/10/19/jsck/ - project implementing CSRFGuard style solution for PHP and JavaScript.&lt;br /&gt;
:*http://www.owasp.org/index.php/.Net_CSRF_Guard - project implementing CSRFGuard style solution for ASP.NET.&lt;br /&gt;
&lt;br /&gt;
== Project Sponsors == &lt;br /&gt;
&lt;br /&gt;
[[File:Infrared-logo-small.png | http://www.infraredsecurity.com]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!---==== Project About ====&lt;br /&gt;
{{:Projects/OWASP CSRFGuard Project| Project About}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &amp;lt;headertabs /&amp;gt;----&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Validation_Project]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:OWASP_Project|CSRFGuard Project]]&lt;br /&gt;
[[Category:OWASP_Java_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=File:Infrared-logo-small.png&amp;diff=119862</id>
		<title>File:Infrared-logo-small.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=File:Infrared-logo-small.png&amp;diff=119862"/>
				<updated>2011-11-07T21:39:09Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:Synapse&amp;diff=111213</id>
		<title>Category:Synapse</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:Synapse&amp;diff=111213"/>
				<updated>2011-05-30T22:14:44Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!---==== Main  ====---&amp;gt;&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the home of the Synapse project! Synapse is a code analysis tool inspired by other static analysis tools such as OWASP LAPSE, OWASP Orizon, and FlawFinder. The project &amp;quot;compiles&amp;quot; source code into an intermediate format called Common Abstract Syntax Tree (CAST) which is then analyzed for security problems. &lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
It is developed almost entirely using C# (.NET 3.5 or greater) with minimal Java for the aforementioned &amp;quot;compilation&amp;quot; support. The project is currently in development form with hopes of achieving release status in the near future. A more formal project roadmap is under construction.&lt;br /&gt;
&lt;br /&gt;
== Project Lead ==&lt;br /&gt;
&lt;br /&gt;
[http://ericsheridan.blogspot.com/ Eric Sheridan] (eric dot sheridan at owasp dot org) is the owner, chief architect, and lead developer of the Synapse project. Aside from leading up Synapse, Eric has contributed to or provided guidance on numerous other OWASP projects including the Cross-Site Request Forgery Prevention Cheat Sheet, WebGoat, Stinger, CSRFTester, and Enterprise Security API (ESAPI).&lt;br /&gt;
&lt;br /&gt;
== License ==&lt;br /&gt;
&lt;br /&gt;
Synapse is offered under the [http://www.gnu.org/licenses/gpl-3.0.html GPLv3] license. For further information on OWASP licenses, please consult the [[OWASP Licenses]] page.&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
The source code is currently hosted on Sourceforge in a single zip archive. Synapse will leverage the SVN capabilities of Sourceforge once the project layout and structure becomes more stable. The following links can be used to access the source code.&lt;br /&gt;
&lt;br /&gt;
[https://sourceforge.net/projects/synapsesca/ Synapse 0.1 (ALPHA)]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
:* [https://www.owasp.org/index.php/Category:OWASP_Orizon_Project OWASP Orizon]&lt;br /&gt;
:* [https://www.owasp.org/index.php/OWASP_LAPSE_Project OWASP LAPSE]&lt;br /&gt;
:* [http://www.dwheeler.com/flawfinder/ Flaw Finder]&lt;br /&gt;
&lt;br /&gt;
== Project Sponsors == &lt;br /&gt;
&lt;br /&gt;
Looking for Sponsors...&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:Synapse&amp;diff=111212</id>
		<title>Category:Synapse</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:Synapse&amp;diff=111212"/>
				<updated>2011-05-30T22:07:19Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: Created page with &amp;quot;&amp;lt;!---==== Main  ====---&amp;gt; == Overview ==  Welcome to the home of the Synapse project! Synapse is a Source Code Analysis (SCA) tool inspired by other static analysis tools such as ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!---==== Main  ====---&amp;gt;&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the home of the Synapse project! Synapse is a Source Code Analysis (SCA) tool inspired by other static analysis tools such as OWASP LAPSE, OWASP Orizon, and FlawFinder. The project &amp;quot;compiles&amp;quot; source code into an intermediate format called Common Abstract Syntax Tree (CAST) which is then analyzed for security problems. It is developed almost entirely using C# (.NET 3.5 or greater) with minimal Java for the aforementioned &amp;quot;compilation&amp;quot; support. The project is currently in development form with hopes of achieving release status in the near future. A more formal project roadmap is under construction.&lt;br /&gt;
&lt;br /&gt;
== Project Lead ==&lt;br /&gt;
&lt;br /&gt;
[http://ericsheridan.blogspot.com/ Eric Sheridan] (eric dot sheridan at owasp dot org) is the owner, chief architect, and lead developer of the Synapse project. Aside from leading up Synapse, Eric has contributed to or provided guidance on numerous other OWASP projects including the Cross-Site Request Forgery Prevention Cheat Sheet, WebGoat, Stinger, CSRFTester, and Enterprise Security API (ESAPI).&lt;br /&gt;
&lt;br /&gt;
== License ==&lt;br /&gt;
&lt;br /&gt;
Synapse is offered under the [http://www.gnu.org/licenses/gpl-3.0.html GPLv3] license. For further information on OWASP licenses, please consult the [[OWASP Licenses]] page.&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
The source code is currently hosted on Sourceforge in a single zip archive. Synapse will leverage the SVN capabilities of Sourceforge once the project layout and structure becomes more stable.&lt;br /&gt;
&lt;br /&gt;
[https://sourceforge.net/projects/synapsesca/ Click here] to download the Synapse source code!&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
:* [https://www.owasp.org/index.php/Category:OWASP_Orizon_Project OWASP Orizon]&lt;br /&gt;
:* [https://www.owasp.org/index.php/OWASP_LAPSE_Project OWASP LAPSE]&lt;br /&gt;
:* [http://www.dwheeler.com/flawfinder/ Flaw Finder]&lt;br /&gt;
&lt;br /&gt;
== Project Sponsors == &lt;br /&gt;
&lt;br /&gt;
Looking for Sponsors...&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=111055</id>
		<title>Category:OWASP CSRFGuard Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=111055"/>
				<updated>2011-05-25T02:11:19Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!---==== Main  ====---&amp;gt;&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the home of the OWASP CSRFGuard Project! OWASP CSRFGuard is a library that implements a variant of the [http://www.corej2eepatterns.com/Design/PresoDesign.htm 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.&lt;br /&gt;
&lt;br /&gt;
== Project Lead ==&lt;br /&gt;
&lt;br /&gt;
[http://ericsheridan.blogspot.com/ Eric Sheridan] (eric dot sheridan at owasp dot org) is the lead and primary developer of the OWASP CSRFGuard project. Aside from leading up CSRFGuard, Eric has contributed to or provided guidance on numerous other OWASP projects including the Cross-Site Request Forgery Prevention Cheat Sheet, WebGoat, Stinger, CSRFTester, and Enterprise Security API (ESAPI). He is an Independent Application Security Consultant specializing in a wide variety of application security activities including static analysis, penetration tests, code reviews, and threat modeling. In his personal time... wait, what is that?&lt;br /&gt;
&lt;br /&gt;
== License ==&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard is offered under the [http://www.opensource.org/licenses/bsd-license.php BSD] license. For further information on OWASP licenses, please consult the [[OWASP Licenses]] page.&lt;br /&gt;
&lt;br /&gt;
== Email List ==&lt;br /&gt;
&lt;br /&gt;
You can sign up for the OWASP CSRFGuard email list at [https://lists.owasp.org/mailman/listinfo/owasp-csrfguard https://lists.owasp.org/mailman/listinfo/owasp-csrfguard]&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
You can access the Git repository online at https://github.com/esheri3/OWASP-CSRFGuard&lt;br /&gt;
&lt;br /&gt;
== Downloads ==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/downloads/esheri3/OWASP-CSRFGuard/Owasp-CsrfGuard-3.0.0.503.tar.gz OWASP CSRFGuard 3.0.0.503 (ALPHA)] - download the latest development release with binary and associated configuration files '''(recommended)'''.&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_Deprecated_Releases | Deprecated Releases]] - article containing several download references to deprecated and officially unsupported releases&lt;br /&gt;
&lt;br /&gt;
== User Manual(s) ==&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_User_Manual | OWASP CSRFGuard v3 ]] - series of articles describing the installation, configuration, and deployment of OWASP CSRFGuard v3.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
:*[http://www.owasp.org/index.php/Category:OWASP_CSRFTester_Project OWASP CSRFTester ] - utility to assist in the testing and generating PoC for CSRF attacks.&lt;br /&gt;
:*[[Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet | OWASP CSRF Prevention Cheat Sheet]] - provides a more holistic overview of CSRF prevention strategies and associated frameworks.&lt;br /&gt;
:*http://www.owasp.org/index.php/PHP_CSRF_Guard - project implementing CSRFGuard style solution for PHP.&lt;br /&gt;
:*http://www.thespanner.co.uk/2007/10/19/jsck/ - project implementing CSRFGuard style solution for PHP and JavaScript.&lt;br /&gt;
:*http://www.owasp.org/index.php/.Net_CSRF_Guard - project implementing CSRFGuard style solution for ASP.NET.&lt;br /&gt;
&lt;br /&gt;
== Project Sponsors == &lt;br /&gt;
&lt;br /&gt;
Looking for Sponsors...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!---==== Project About ====&lt;br /&gt;
{{:Projects/OWASP CSRFGuard Project| Project About}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &amp;lt;headertabs /&amp;gt;----&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Validation_Project]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:OWASP_Project|CSRFGuard Project]]&lt;br /&gt;
[[Category:OWASP_Java_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Connections_Committee_-_Application_6&amp;diff=107793</id>
		<title>OWASP Connections Committee - Application 6</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Connections_Committee_-_Application_6&amp;diff=107793"/>
				<updated>2011-03-28T23:38:17Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[How to Join a Committee|Click here to return to 'How to Join a Committee' page]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
{| style=&amp;quot;width:100%&amp;quot; border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#4058A0; color:white&amp;quot;|&amp;lt;font color=&amp;quot;white&amp;quot;&amp;gt;'''COMMITTEE APPLICATION FORM''' &lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;|'''Applicant's Name'''&lt;br /&gt;
 | colspan=&amp;quot;1&amp;quot; style=&amp;quot;width:85%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;Doug Wilson&lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;| '''Current and past OWASP Roles''' &lt;br /&gt;
 | colspan=&amp;quot;1&amp;quot; style=&amp;quot;width:85%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|OWASP DC co-chair, Organizer of AppSecDC, representative of OWASP at various US Government organizations&lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:25%; background:#7B8ABD&amp;quot; align=&amp;quot;center&amp;quot;| '''Committee Applying for''' &lt;br /&gt;
 | colspan=&amp;quot;1&amp;quot; style=&amp;quot;width:85%; background:#cccccc&amp;quot; align=&amp;quot;left&amp;quot;|OWASP Connection Committee&lt;br /&gt;
 |}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Please be aware that for an application to be considered by the board, '''you MUST have 5 recommendations'''.  &lt;br /&gt;
An incomplete application will not be considered for vote.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
{| style=&amp;quot;width:100%&amp;quot; border=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;8&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;background:#4058A0; color:white&amp;quot;|&amp;lt;font color=&amp;quot;white&amp;quot;&amp;gt;'''COMMITTEE RECOMMENDATIONS''' &lt;br /&gt;
 |- &lt;br /&gt;
 ! align=&amp;quot;center&amp;quot; style=&amp;quot;background:white; color:white&amp;quot;|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;&lt;br /&gt;
 ! align=&amp;quot;center&amp;quot; style=&amp;quot;background:#7B8ABD; color:white&amp;quot;|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;'''Who Recommends/Name''' &lt;br /&gt;
 ! align=&amp;quot;center&amp;quot; style=&amp;quot;background:#7B8ABD; color:white&amp;quot;|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;'''Role in OWASP'''&lt;br /&gt;
 ! align=&amp;quot;center&amp;quot; style=&amp;quot;background:#7B8ABD; color:white&amp;quot;|&amp;lt;font color=&amp;quot;black&amp;quot;&amp;gt;'''Recommendation Content''' &lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:3%; background:#cccccc&amp;quot; align=&amp;quot;center&amp;quot;|'''1'''&lt;br /&gt;
 | style=&amp;quot;width:20%; background:#cccccc&amp;quot; align=&amp;quot;center&amp;quot;| Mark Bristow&lt;br /&gt;
 | style=&amp;quot;width:20%; background:#cccccc&amp;quot; align=&amp;quot;center&amp;quot;| Global Conferences Committee Chair, DC Chapter Lead, AppSec DC Organizer&lt;br /&gt;
 | style=&amp;quot;width:57%; background:#cccccc&amp;quot; align=&amp;quot;center&amp;quot;| I can't think of a better person to join the Connections Committee.  Doug is already spearheading government outreach, OWASP social media, and other actions to promote the organization.  Would buy again A+++++++&lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:3%; background:#cccccc&amp;quot; align=&amp;quot;center&amp;quot;|'''2'''&lt;br /&gt;
 | style=&amp;quot;width:20%; background:#cccccc&amp;quot; align=&amp;quot;center&amp;quot;| Lorna Alamri&lt;br /&gt;
 | style=&amp;quot;width:20%; background:#cccccc&amp;quot; align=&amp;quot;center&amp;quot;| Global Industry Committee, AppSec USA 2011 Organizer&lt;br /&gt;
 | style=&amp;quot;width:57%; background:#cccccc&amp;quot; align=&amp;quot;center&amp;quot;| Doug would be a great addition to the Connections Committee. He's shown that he will jump in and make things happen and promote OWASP as an Organization.&lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:3%; background:#cccccc&amp;quot; align=&amp;quot;center&amp;quot;|'''3'''&lt;br /&gt;
 | style=&amp;quot;width:20%; background:#cccccc&amp;quot; align=&amp;quot;center&amp;quot;| Jim Manico&lt;br /&gt;
 | style=&amp;quot;width:20%; background:#cccccc&amp;quot; align=&amp;quot;center&amp;quot;| Connection Committee Chair, &lt;br /&gt;
 | style=&amp;quot;width:57%; background:#cccccc&amp;quot; align=&amp;quot;center&amp;quot;| We need Dougs help!&lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:3%; background:#cccccc&amp;quot; align=&amp;quot;center&amp;quot;|'''4'''&lt;br /&gt;
 | style=&amp;quot;width:20%; background:#cccccc&amp;quot; align=&amp;quot;center&amp;quot;| Eric Sheridan&lt;br /&gt;
 | style=&amp;quot;width:20%; background:#cccccc&amp;quot; align=&amp;quot;center&amp;quot;| Various Projects (CSRFGuard, CSRFTester, CSRF CheatSheet, etc.)&lt;br /&gt;
 | style=&amp;quot;width:57%; background:#cccccc&amp;quot; align=&amp;quot;center&amp;quot;| Doug has the ability to get things done right!&lt;br /&gt;
 |-&lt;br /&gt;
 | style=&amp;quot;width:3%; background:#cccccc&amp;quot; align=&amp;quot;center&amp;quot;|'''5'''&lt;br /&gt;
 | style=&amp;quot;width:20%; background:#cccccc&amp;quot; align=&amp;quot;center&amp;quot;|&lt;br /&gt;
 | style=&amp;quot;width:20%; background:#cccccc&amp;quot; align=&amp;quot;center&amp;quot;|&lt;br /&gt;
 | style=&amp;quot;width:57%; background:#cccccc&amp;quot; align=&amp;quot;center&amp;quot;|&lt;br /&gt;
 |}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CSRFGuard_3_User_Manual&amp;diff=105349</id>
		<title>CSRFGuard 3 User Manual</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CSRFGuard_3_User_Manual&amp;diff=105349"/>
				<updated>2011-02-17T17:43:53Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
Welcome to the OWASP CSRFGuard 3 User Manual! The purpose of this article is to provide the user with guidance on obtaining, installing, deploying, and developing with the OWASP CSRFGuard library. The author's goal was to keep the User Manual informative, use to understand, and concise. If you find that one or more aspects of this document does not adhere to these goals, please me know at eric dot sheridan at owasp dot org.&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
Users can download the latest release of OWASP CSRFGuard using one of the following links:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/downloads/esheri3/OWASP-CSRFGuard/Owasp-CsrfGuard-3.0.0.503.tar.gz OWASP CSRFGuard 3.0.0.503 (ALPHA)] - download the latest development release with binary and associated configuration files '''(recommended)'''.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
Installation of OWASP CSRFGuard 3 is very straight forward requiring three simple steps:&lt;br /&gt;
&lt;br /&gt;
:# Copy the Owasp.CsrfGuard.jar file to your application's classpath&lt;br /&gt;
:# Declare CsrfGuard in your application's deployment descriptor (web.xml)&lt;br /&gt;
:# Configure the Owasp.CsrfGuard.properties file as you see fit&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Installation | Click here]] for more detailed information regarding the installation of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
&lt;br /&gt;
The minimum configuration settings that users should review include:&lt;br /&gt;
&lt;br /&gt;
:* Default new token landing page (org.owasp.csrfguard.NewTokenLandingPage)&lt;br /&gt;
:* Support for Ajax and XMLHttpRequest (org.owasp.csrfguard.Ajax)&lt;br /&gt;
:* URI resources that should not be protected (org.owasp.csrfguard.unprotected.*)&lt;br /&gt;
:* Actions executed when an attack is detected (org.owasp.csrfguard.action.*)&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Configuration | Click here]] for more information regarding the configuration of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
= Token Injection =&lt;br /&gt;
&lt;br /&gt;
Users of OWASP CSRFGuard can inject prevention tokens into HTML using two strategies:&lt;br /&gt;
&lt;br /&gt;
:* JavaScript DOM Manipulation - largely automated process requiring minimal effort and is ideal for most web applications&lt;br /&gt;
:* JSP Tag Library - provides fine grained strategy ideal for situations where automated DOM manipulation is insufficient.&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Token_Injection | Click here]] for more information regarding the injection of CSRF prevention tokens within your application.&lt;br /&gt;
&lt;br /&gt;
= Known Issues =&lt;br /&gt;
&lt;br /&gt;
The following is a quick bulleted list of known issues within the current release:&lt;br /&gt;
&lt;br /&gt;
:* No known way to inject CSRF prevention tokens into setters of document.location (ex: document.location=&amp;quot;http://www.owasp.org&amp;quot;;)&lt;br /&gt;
:* Tokens are not injected into HTML elements dynamically generated using JavaScript &amp;quot;createElement&amp;quot; and &amp;quot;setAttribute&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_CSRFGuard_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=105347</id>
		<title>Category:OWASP CSRFGuard Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=105347"/>
				<updated>2011-02-17T17:43:30Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Downloads */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the home of the OWASP CSRFGuard Project! OWASP CSRFGuard is a library that implements a variant of the [http://www.corej2eepatterns.com/Design/PresoDesign.htm 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.&lt;br /&gt;
&lt;br /&gt;
== Project Lead ==&lt;br /&gt;
&lt;br /&gt;
[http://ericsheridan.blogspot.com/ Eric Sheridan] (eric dot sheridan at owasp dot org) is the lead and primary developer of the OWASP CSRFGuard project. Aside from leading up CSRFGuard, Eric has contributed to or provided guidance on numerous other OWASP projects including the Cross-Site Request Forgery Prevention Cheat Sheet, WebGoat, Stinger, CSRFTester, and Enterprise Security API (ESAPI). He is an Independent Application Security Consultant specializing in a wide variety of application security activities including static analysis, penetration tests, code reviews, and threat modeling. In his personal time... wait, what is that?&lt;br /&gt;
&lt;br /&gt;
== License ==&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard is offered under the [http://www.opensource.org/licenses/bsd-license.php BSD] license. For further information on OWASP licenses, please consult the [[OWASP Licenses]] page.&lt;br /&gt;
&lt;br /&gt;
== Email List ==&lt;br /&gt;
&lt;br /&gt;
You can sign up for the OWASP CSRFGuard email list at [https://lists.owasp.org/mailman/listinfo/owasp-csrfguard https://lists.owasp.org/mailman/listinfo/owasp-csrfguard]&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
You can access the Git repository online at https://github.com/esheri3/OWASP-CSRFGuard&lt;br /&gt;
&lt;br /&gt;
== Downloads ==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/downloads/esheri3/OWASP-CSRFGuard/Owasp-CsrfGuard-3.0.0.503.tar.gz OWASP CSRFGuard 3.0.0.503 (ALPHA)] - download the latest development release with binary and associated configuration files '''(recommended)'''.&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_Deprecated_Releases | Deprecated Releases]] - article containing several download references to deprecated and officially unsupported releases&lt;br /&gt;
&lt;br /&gt;
== User Manual(s) ==&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_User_Manual | OWASP CSRFGuard v3 ]] - series of articles describing the installation, configuration, and deployment of OWASP CSRFGuard v3.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
:*[http://www.owasp.org/index.php/Category:OWASP_CSRFTester_Project OWASP CSRFTester ] - utility to assist in the testing and generating PoC for CSRF attacks.&lt;br /&gt;
:*[[Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet | OWASP CSRF Prevention Cheat Sheet]] - provides a more holistic overview of CSRF prevention strategies and associated frameworks.&lt;br /&gt;
:*http://www.owasp.org/index.php/PHP_CSRF_Guard - project implementing CSRFGuard style solution for PHP.&lt;br /&gt;
:*http://www.thespanner.co.uk/2007/10/19/jsck/ - project implementing CSRFGuard style solution for PHP and JavaScript.&lt;br /&gt;
:*http://www.owasp.org/index.php/.Net_CSRF_Guard - project implementing CSRFGuard style solution for ASP.NET.&lt;br /&gt;
&lt;br /&gt;
== Project Sponsors == &lt;br /&gt;
&lt;br /&gt;
[http://www.aspectsecurity.com https://www.owasp.org/images/d/d1/Aspect_logo.gif].&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Validation_Project]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:OWASP_Project|CSRFGuard Project]]&lt;br /&gt;
[[Category:OWASP_Java_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CSRFGuard_3_Configuration&amp;diff=104953</id>
		<title>CSRFGuard 3 Configuration</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CSRFGuard_3_Configuration&amp;diff=104953"/>
				<updated>2011-02-12T17:47:59Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* New Token Landing Page */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
The most important aspect of deploying OWASP CSRFGuard is configuration of the Owasp.CsrfGuard.properties file. There are a minimum number of configuration settings that users should review and specify before running an instance of OWASP CSRFGuard. Such configurations include specifying the new token landing page, enabling Ajax support for applications making use of XMLHttpRequest, capturing pages that should not be protected, as well as configuring one or more actions that should be invoked when a CSRF attack is identified. The purpose of this article is to provide an overview of key OWASP CSRFGuard configuration settings.&lt;br /&gt;
&lt;br /&gt;
= Logger =&lt;br /&gt;
&lt;br /&gt;
The logger property (org.owasp.csrfguard.Logger) defines the qualified class name of the object responsible for processing all log messages produced by CSRFGuard. The default CSRFGuard logger is org.owasp.csrfguard.log.ConsoleLogger. This class logs all messages to System.out which JavaEE application servers redirect to a vendor specific log file. Developers can customize the logging behavior of CSRFGuard by implementing the org.owasp.csrfguard.log.ILogger interface and setting the logger property to the new logger's qualified class name. The following configuration snippet instructs OWASP CSRFGuard to capture all log messages to the console:&lt;br /&gt;
&lt;br /&gt;
 org.owasp.csrfguard.Logger=org.owasp.csrfguard.log.ConsoleLogger&lt;br /&gt;
&lt;br /&gt;
= New Token Landing Page =&lt;br /&gt;
&lt;br /&gt;
The new token landing page property (org.owasp.csrfguard.NewTokenLandingPage) defines where to send a user if the token is being generated for the first time. This request is generated using auto-posting forms and will only contain the CSRF prevention token parameter, if applicable. All query-string or form parameters sent with the original request will be discarded. If this property is not defined, CSRFGuard will instead auto-post the user to the original context and servlet path. The following configuration snippet instructs OWASP CSRFGuard to redirect the user to /Owasp.CsrfGuard.Test/index.html when the user visits a protected resource without having a corresponding CSRF token present in the HttpSession object:&lt;br /&gt;
&lt;br /&gt;
 org.owasp.csrfguard.NewTokenLandingPage=/Owasp.CsrfGuard.Test/index.html&lt;br /&gt;
&lt;br /&gt;
= Unique Token Per Page =&lt;br /&gt;
&lt;br /&gt;
The unique token per-page property (org.owasp.csrfguard.TokenPerPage) is a boolean value that determines if CSRFGuard should make use of unique per-page (i.e. URI) prevention tokens as opposed to unique per-session prevention tokens. When a user requests a protected resource, CSRFGuard will determine if a page specific token has been previously generated. If a page specific token has not yet been previously generated, CSRFGuard will verify the request was submitted with the per-session token intact. After verifying the presence of the per-session token, CSRFGuard will create a page specific token that is required for all subsequent requests to the associated resource. The per-session CSRF token can only be used when requesting a resource for the first time. All subsequent requests must have the per-page token intact or the request will be treated as a CSRF attack. Use of the unique token per page property is currently experimental but provides a significant amount of improved security. Consider the exposure of a CSRF token using the legacy unique per-session model. Exposure of this token facilitates the attacker's ability to carry out a CSRF attack against the victim's active session for any resource exposed by the web application. Now consider the exposure of a CSRF token using the experimental unique token per-page model. Exposure of this token would only allow the attacker to carry out a CSRF attack against the victim's active session for a small subset of resources exposed by the web application. Use of the unique token per-page property is a strong defense in depth strategy significantly reducing the impact of exposed CSRF prevention tokens. The following configuration snippet instructs OWASP CSRFGuard to utilize the unique token per-page model:&lt;br /&gt;
&lt;br /&gt;
 org.owasp.csrfguard.TokenPerPage=true&lt;br /&gt;
&lt;br /&gt;
= Token Rotation =&lt;br /&gt;
&lt;br /&gt;
The rotate token property (org.owasp.csrfguard.Rotate) is a boolean value that determines if CSRFGuard should generate and utilize a new token after verifying the previous token. Rotation helps minimize the window of opportunity an attacker has to leverage the victim's stolen token in a targeted CSRF attack. However, this functionality generally causes navigation problems in most applications. Specifically, the 'Back' button in the browser will often cease to function properly. When a user hits the 'Back' button and interacts with the HTML, the browser may submit an old token causing CSRFGuard to incorrectly believe this request is a CSRF attack in progress (i.e. a 'false positive'). Users can prevent this scenario by preventing the caching of HTML pages containing FORM submissions using the cache-control header. However, this may also introduce performance problems as the browser will have to request HTML on a more frequent basis. The following configuration snippet disables token rotation:&lt;br /&gt;
 org.owasp.csrfguard.Rotate=false&lt;br /&gt;
&lt;br /&gt;
= Ajax and XMLHttpRequest Support =&lt;br /&gt;
&lt;br /&gt;
The Ajax property (org.owasp.csrfguard.Ajax) is a boolean value that indicates whether or not OWASP CSRFGuard should support the injection and verification of unique per-session prevention tokens for XMLHttpRequests. To leverage Ajax support, the user must not only set this property to true but must also reference the [[CSRFGuard_3_Token_Injection#JavaScript_DOM_Manipulation | JavaScript DOM Manipulation]] code using a script element. This dynamic script will override the send method of the XMLHttpRequest object to ensure the submission of an X-Requested-With header name value pair coupled with the submission of a custom header name value pair for each request. The name of the custom header is the value of the token name property and the value of the header is always the unique per-session token value. This custom header is analogous to the HTTP parameter name value pairs submitted via traditional GET and POST requests. If the X-Requested-With header was sent in the HTTP request, then CSRFGuard will look for the presence and ensure the validity of the unique per-session token in the custom header name value pair. Note that verification of these headers takes precedence over verification of the CSRF token supplied as an HTTP parameter. More specifically, CSRFGuard does not verify the presence of the CSRF token if the Ajax support property is enabled and the corresponding X-Requested-With and custom headers are embedded within the request. The following configuration snippet instructs OWASP CSRFGuard to support Ajax requests by verifying the presence and correctness of the X-Requested-With and custom headers:&lt;br /&gt;
&lt;br /&gt;
 org.owasp.csrfguard.Ajax=true&lt;br /&gt;
&lt;br /&gt;
= Unprotected Pages =&lt;br /&gt;
&lt;br /&gt;
The unprotected pages property (org.owasp.csrfguard.unprotected.*) defines a series of pages that should not be protected by CSRFGuard. Such configurations are useful when the CsrfGuardFilter is aggressively mapped (ex: /*). The syntax of the property name is org.owasp.csrfguard.unprotected.[PageName], where PageName is some arbitrary identifier that can be used to reference a resource. The syntax of defining the uri of unprotected pages is the same as the syntax used by the JavaEE container for uri mapping. Specifically, CSRFGuard will identify the first match (if any) between the requested uri and an unprotected page in order of declaration. Match criteria is as follows:&lt;br /&gt;
&lt;br /&gt;
:Case 1: exact match between request uri and unprotected page&lt;br /&gt;
:Case 2: longest path prefix match, beginning / and ending /*&lt;br /&gt;
:Case 3: extension match, beginning *.&lt;br /&gt;
:Default: requested resource must be validated by CSRFGuard&lt;br /&gt;
&lt;br /&gt;
The following code snippet illustrates the three use cases over four examples. The first two examples (Tag and JavaScriptServlet) look for direct URI matches. The third example (Html) looks for all resources ending in a .html extension. The last example (Public) looks for all resources prefixed with the URI path /MySite/Public/*.&lt;br /&gt;
&lt;br /&gt;
 org.owasp.csrfguard.unprotected.Tag=/Owasp.CsrfGuard.Test/tag.jsp&lt;br /&gt;
 org.owasp.csrfguard.unprotected.JavaScriptServlet=/Owasp.CsrfGuard.Test/JavaScriptServlet&lt;br /&gt;
 org.owasp.csrfguard.unprotected.Html=*.html&lt;br /&gt;
 org.owasp.csrfguard.unprotected.Public=/MySite/Public/*&lt;br /&gt;
&lt;br /&gt;
= Actions: Responding to Attacks =&lt;br /&gt;
&lt;br /&gt;
The actions directive (org.owasp.csrfguard.action.*) gives the user the ability to specify one or more actions that should be invoked when a CSRF attack is detected. Every action must implement the org.owasp.csrfguard.action.IAction interface either directly or indirectly through the org.owasp.csrfguard.action.AbstractAction helper class. Many actions accept parameters that can be specified along with the action class declaration. These parameters are consumed at runtime and impact the behavior of the associated action.&lt;br /&gt;
&lt;br /&gt;
The syntax for defining and configuring CSRFGuard actions is relatively straight forward. Let us assume we wish to redirect the user to a default page when a CSRF attack is detected. A redirect action already exists within the CSRFGuard bundle and is available via the class name org.owasp.csrfguard.actions.Redirect. In order to enable this action, we capture the following declaration in the Owasp.CsrfGuard.properties file:&lt;br /&gt;
&lt;br /&gt;
 '''syntax:''' org.owasp.csrfguard.action.[actionName]=[className]&lt;br /&gt;
 '''example:''' org.owasp.csrfguard.action.class.Redirect=org.owasp.csrfguard.actions.Redirect&lt;br /&gt;
&lt;br /&gt;
The aforementioned directive declares an action called &amp;quot;Redirect&amp;quot; (i.e. [actionName]) referencing the Java class &amp;quot;org.owasp.csrfguard.actions.Redirect&amp;quot; (i.e. [className]). Anytime a CSRF attack is detected, the Redirect action will be executed. You may be asking yourself, &amp;quot;but how do I specify where the user is redirected?&amp;quot;; this is where action parameters come into play. In order to specify the redirect location, we capture the following declaration in the Owasp.CsrfGuard.properties file:&lt;br /&gt;
&lt;br /&gt;
 '''syntax:''' org.owasp.csrfguard.action.[actionName].[parameterName]=[parameterValue]&lt;br /&gt;
 '''example:''' org.owasp.csrfguard.action.Redirect.ErrorPage=/Owasp.CsrfGuard.Test/error.html&lt;br /&gt;
&lt;br /&gt;
The aforementioned directive declares an action parameter called &amp;quot;ErrorPage&amp;quot; (i.e. [parameterName]) with the value of &amp;quot;/Owasp.CsrfGuard.Test/error.html&amp;quot; (i.e. [parameterValue]) for the action &amp;quot;Redirect&amp;quot; (i.e. [actionName]). The Redirect action expects the &amp;quot;ErrorPage&amp;quot; parameter to be defined and will redirect the user to this location when an attack is detected.&lt;br /&gt;
&lt;br /&gt;
There are several &amp;quot;out of the box&amp;quot; actions made available with the OWASP CSRFGuard distributable. &lt;br /&gt;
&lt;br /&gt;
== org.owasp.csrfguard.action.Log ==&lt;br /&gt;
&lt;br /&gt;
Creates a customized log message whenever a CSRF attack is detected by OWASP CSRFGuard. The log message is captured using the logger mechanism defined by the ''org.owasp.csrfguard.Logger'' directive in the Owasp.CsrfGuard.properties file. Log accepts the following action parameters:&lt;br /&gt;
&lt;br /&gt;
'''org.owasp.csrfguard.action.Log.Message'''&lt;br /&gt;
&lt;br /&gt;
Allows the user to define the format of the log message to be recorded. The Message parameter supports several formatting options to aide in the customization of the message to the particular attack. The following formatting options are supported:&lt;br /&gt;
&lt;br /&gt;
 '''%exception%''' - String representation of the CsrfGuardException thrown by the CsrfGuard class.&lt;br /&gt;
 '''%exception_message%''' - Localized exception message of the class CsrfGuardException thrown by the CsrfGuard class.&lt;br /&gt;
 '''%remote_ip%''' - Remote IP address of the client that sent the CSRF attack to the server.&lt;br /&gt;
 '''%remote_host%''' - Remote host name of the client that sent the CSRF attack to the server.&lt;br /&gt;
 '''%remote_port%''' - Remote port of the client that sent the CSRF attack to the server.&lt;br /&gt;
 '''%local_ip%''' - Local IP address of the server that detected the CSRF attack.&lt;br /&gt;
 '''%local_host%''' - Local host name of the server that detected the CSRF attack.&lt;br /&gt;
 '''%local_port%''' - Local port of the server that detected the CSRF attack.&lt;br /&gt;
 '''%request_uri%''' - Request URI for which the CSRF attack was targeting.&lt;br /&gt;
 '''%request_url%''' - Request URL for which the CSRF attack was targeting.&lt;br /&gt;
 '''%user%''' - User information as made available by the javax.servlet.http.HttpServletRequest.getRemoteUser() method invocation.&lt;br /&gt;
&lt;br /&gt;
== org.owasp.csrfguard.action.Invalidate ==&lt;br /&gt;
&lt;br /&gt;
Invalidate any existing HttpSession associated with the current HttpServletRequest. Note that this is the session of the victim for which the CSRF attack was targeting. Invalidating the JavaEE container's session generally results in the user having to re-authenticate. There are no parameters associated with this action.&lt;br /&gt;
&lt;br /&gt;
== org.owasp.csrfguard.action.Redirect ==&lt;br /&gt;
&lt;br /&gt;
Redirects the user to the URI specified in the Page action parameter. Attempting to utilize this action in combination with Forward will generally result in the JavaEE container throwing IllegalStateException. The action accepts the following action parameters:&lt;br /&gt;
&lt;br /&gt;
'''org.owasp.csrfguard.action.Redirect.Page'''&lt;br /&gt;
&lt;br /&gt;
Defines the URI for which the user is redirected when a CSRF attack is detected.&lt;br /&gt;
&lt;br /&gt;
== org.owasp.csrfguard.action.Forward ==&lt;br /&gt;
&lt;br /&gt;
Forwards the user to the URI specified in the Page action parameter. Attempting to utilize this action in combination with Redirect will generally result in the JavaEE container throwing IllegalStateException. The action accepts the following action parameters:&lt;br /&gt;
&lt;br /&gt;
'''org.owasp.csrfguard.action.Forward.Page'''&lt;br /&gt;
&lt;br /&gt;
Defines the URI for which the user is forwarded when a CSRF attack is detected.&lt;br /&gt;
&lt;br /&gt;
== org.owasp.csrfguard.action.RequestAttribute ==&lt;br /&gt;
&lt;br /&gt;
Makes the CsrfGuardException thrown by the CsrfGuard class when an attack is detected programmatically available as an attribute in the HttpServletRequest object. The action accepts the following action parameters:&lt;br /&gt;
&lt;br /&gt;
'''org.owasp.csrfguard.action.RequestAttribute.AttributeName'''&lt;br /&gt;
&lt;br /&gt;
Defines the attribute name that should be used when placing the CsrfGuardException in the HttpServletRequest attributes collection.&lt;br /&gt;
&lt;br /&gt;
== org.owasp.csrfguard.action.SessionAttribute ==&lt;br /&gt;
&lt;br /&gt;
Makes the CsrfGuardException thrown by the CsrfGuard class when an attack is detected programmatically available as an attribute in the HttpSession object. The action accepts the following action parameters:&lt;br /&gt;
&lt;br /&gt;
'''org.owasp.csrfguard.action.SessionAttribute.AttributeName'''&lt;br /&gt;
&lt;br /&gt;
Defines the attribute name that should be used when placing the CsrfGuardException in the HttpSession attributes collection.&lt;br /&gt;
&lt;br /&gt;
== org.owasp.csrfguard.action.Rotate ==&lt;br /&gt;
&lt;br /&gt;
Invalidates and re-generates any existing CSRF prevention tokens associated with the current HttpSession. This action helps minimize the risk of a malicious user attempting to brute force a user's prevention tokens through timing based side channel attacks. Note that this action has no effect when used in conjunction with the Invalidate action. There are no parameters associated with this action.&lt;br /&gt;
&lt;br /&gt;
= Miscellaneous Configurations =&lt;br /&gt;
&lt;br /&gt;
== Token Name ==&lt;br /&gt;
&lt;br /&gt;
The token name property (org.owasp.csrfguard.TokenName) defines the name of the HTTP parameter to contain the value of the OWASP CSRFGuard token for each request. The following configuration snippet sets the CSRFGuard token parameter name to the value OWASP_CSRFTOKEN:&lt;br /&gt;
 org.owasp.csrfguard.TokenName=OWASP_CSRFTOKEN&lt;br /&gt;
&lt;br /&gt;
== Session Key ==&lt;br /&gt;
&lt;br /&gt;
The session key property (org.owasp.csrfguard.SessionKey) defines the string literal used to save and lookup the CSRFGuard token from the session. This value is used by the filter and the tag libraries to retrieve and set the token value in the session. Developers can use this key to programmatically lookup the token within their own code. The following configuration snippet sets the session key to the value OWASP_CSRFTOKEN:&lt;br /&gt;
 org.owasp.csrfguard.SessionKey=OWASP_CSRFTOKEN&lt;br /&gt;
&lt;br /&gt;
== Token Length ==&lt;br /&gt;
&lt;br /&gt;
The token length property (org.owasp.csrfguard.TokenLength) defines the number of characters that should be found within the CSRFGuard token. Note that characters are delimited by dashes (-) in groups of four. For cosmetic reasons, users are encourage to ensure the token length is divisible by four. The following configuration snippet sets the token length property to 32 characters:&lt;br /&gt;
 org.owasp.csrfguard.TokenLength=32&lt;br /&gt;
&lt;br /&gt;
== Pseudo-Random Number Generator ==&lt;br /&gt;
&lt;br /&gt;
The pseudo-random number generator property (org.owasp.csrfguard.PRNG) defines what PRNG should be used to generate the OWASP CSRFGuard token. Always ensure this value references a cryptographically strong pseudo-random number generator algorithm. The following configuration snippet sets the pseudo-random number generator to SHA1PRNG:&lt;br /&gt;
 org.owasp.csrfguard.PRNG=SHA1PRNG&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP CSRFGuard Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CSRFGuard_3_Token_Injection&amp;diff=104952</id>
		<title>CSRFGuard 3 Token Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CSRFGuard_3_Token_Injection&amp;diff=104952"/>
				<updated>2011-02-12T17:45:47Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard implements a variant of the synchronizer token pattern to mitigate the risk of CSRF attacks. In order to implement this pattern, CSRFGuard must offer the capability to place the CSRF prevention token within the HTML produced by the protected web application. CSRFGuard 3 provides developers more fine grain control over the injection of the token. Developers can inject the token in their HTML using either dynamic JavaScript DOM manipulation or a JSP tag library. CSRFGuard no longer intercepts and modifies the HttpServletResponse object as was done in previous releases. The currently available token injection strategies are designed to make the integration of CSRFGuard more feasible and scalable within current enterprise web applications. Developers are encouraged to make use of both the JavaScript DOM Manipulation and the JSP tag library strategies for a complete token injection strategy. The JavaScript DOM Manipulation strategy is ideal as it is automated and requires minimal effort on behalf of the developer. In the event the JavaScript solution is insufficient within a particular application context, developers should leverage the JSP tag library. The purpose of this article is to describe the token injection strategies offered by OWASP CSRFGuard 3.&lt;br /&gt;
&lt;br /&gt;
= JavaScript DOM Manipulation =&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard 3 supports the ability to dynamically inject CSRF prevention tokens throughout the DOM currently loaded in the user's browser. This strategy is extremely valuable with regards to server-side performance as it simply requires the serving of a dynamic JavaScript file. There is little to no performance hit when the fetched dynamic JavaScript updates the browser's DOM. Making use of the JavaScript token injection solution requires the developer map a Servlet and place a JavaScript HTML tag within all pages sending requests to protected application resources. Developers are strongly encouraged to leverage the JavaScript token injection strategy by default. This strategy requires minimal effort on behalf of the developer as most of the token injection logic is automated. In the event that the JavaScript automated solution may be insufficient for a specific application context, developers should leverage the OWASP CSRFGuard JSP tag library.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Use of JavaScript DOM Manipulation is required for Ajax support.&lt;br /&gt;
&lt;br /&gt;
== Declare and Configure JavaScriptServlet ==&lt;br /&gt;
&lt;br /&gt;
The JavaScript file used for token injection is dynamically generated by the JavaScriptServlet class using a template file. Ensure that the Owasp.CsrfGuard.jar file is found within the target application's classpath. Copy the Owasp.CsrfGuard.js template file from the OWASP CSRFGuard distribution folder to a non-publicly accessible directory within the target application. For the remainder of this section, we assume the Owasp.CsrfGuard.js template file was placed in the application's WEB-INF folder. Edit the deployment descriptor (web.xml) to declare the JavaScriptServlet class along with any associated initialization parameters. Consider the following configuration snippet taken from the [https://github.com/esheri3/OWASP-CSRFGuard/tree/master/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;servlet&amp;gt;&lt;br /&gt;
      &amp;lt;servlet-name&amp;gt;JavaScriptServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;
      &amp;lt;servlet-class&amp;gt;org.owasp.csrfguard.servlet.JavaScriptServlet&amp;lt;/servlet-class&amp;gt;&lt;br /&gt;
      &amp;lt;init-param&amp;gt;&lt;br /&gt;
          &amp;lt;param-name&amp;gt;source-file&amp;lt;/param-name&amp;gt;&lt;br /&gt;
          &amp;lt;param-value&amp;gt;WEB-INF/Owasp.CsrfGuard.js&amp;lt;/param-value&amp;gt;&lt;br /&gt;
      &amp;lt;/init-param&amp;gt;&lt;br /&gt;
      &amp;lt;init-param&amp;gt;&lt;br /&gt;
          &amp;lt;param-name&amp;gt;inject-into-forms&amp;lt;/param-name&amp;gt;&lt;br /&gt;
          &amp;lt;param-value&amp;gt;true&amp;lt;/param-value&amp;gt;&lt;br /&gt;
      &amp;lt;/init-param&amp;gt;&lt;br /&gt;
      &amp;lt;init-param&amp;gt;&lt;br /&gt;
          &amp;lt;param-name&amp;gt;inject-into-attributes&amp;lt;/param-name&amp;gt;&lt;br /&gt;
          &amp;lt;param-value&amp;gt;true&amp;lt;/param-value&amp;gt;&lt;br /&gt;
      &amp;lt;/init-param&amp;gt;&lt;br /&gt;
     &amp;lt;init-param&amp;gt;&lt;br /&gt;
          &amp;lt;param-name&amp;gt;domain-strict&amp;lt;/param-name&amp;gt;&lt;br /&gt;
          &amp;lt;param-value&amp;gt;false&amp;lt;/param-value&amp;gt;&lt;br /&gt;
     &amp;lt;/init-param&amp;gt;&lt;br /&gt;
     &amp;lt;init-param&amp;gt;&lt;br /&gt;
          &amp;lt;param-name&amp;gt;referer-pattern&amp;lt;/param-name&amp;gt;&lt;br /&gt;
          &amp;lt;param-value&amp;gt;.*localhost.*&amp;lt;/param-value&amp;gt;&lt;br /&gt;
     &amp;lt;/init-param&amp;gt;&lt;br /&gt;
 &amp;lt;/servlet&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The aforementioned configuration snippet declares the JavaScriptServlet class using the name &amp;quot;JavaScriptServlet&amp;quot;. JavaScriptServlet accepts various initialization parameters augmenting the behavior of the class at runtime. The provided configuration snippet instructs JavaScriptServlet to...&lt;br /&gt;
&lt;br /&gt;
#Leverage the template JavaScript file at WEB-INF/Owasp.CsrfGuard.js&lt;br /&gt;
#Inject the token into all HTML forms&lt;br /&gt;
#Inject the token into all src and href attributes&lt;br /&gt;
#Leverage loose same origin matching criteria when placing the token in URL resources&lt;br /&gt;
&lt;br /&gt;
Consider the following for a more detailed listing of the initialization parameters supported by JavaScriptServlet:&lt;br /&gt;
&lt;br /&gt;
 source-file&lt;br /&gt;
&lt;br /&gt;
Denotes the location of the JavaScript template file that should be consumed and dynamically augmented by the JavaScriptServlet class. The default value is WEB-INF/Owasp.CsrfGuard.js. Use of this property and the existence of the specified template file is required. &lt;br /&gt;
&lt;br /&gt;
 domain-strict&lt;br /&gt;
&lt;br /&gt;
Boolean value that determines whether or not the dynamic JavaScript code should be strict with regards to what links it should inject the CSRF prevention token. With a value of true, the JavaScript code will only place the token in links that point to the same exact domain from which the HTML originated. With a value of false, the JavaScript code will place the token in links that not only point to the same exact domain from which the HTML originated, but sub-domains as well.&lt;br /&gt;
&lt;br /&gt;
 referer-pattern&lt;br /&gt;
&lt;br /&gt;
Allows the developer to specify a regular expression describing the required value of the Referer header. Any attempts to access the servlet with a Referer header that does not match the captured expression is discarded. Inclusion of referer header checking is to help minimize the risk of JavaScript Hijacking attacks that attempt to steal tokens from the dynamically generated JavaScript. While the primary defenses against JavaScript Hijacking attacks are implemented within the dynamic JavaScript itself, referer header checking is implemented to achieve defense in depth.&lt;br /&gt;
&lt;br /&gt;
 cache-control&lt;br /&gt;
&lt;br /&gt;
Allows the developer to specify the value of the Cache-Control header in the HTTP response when serving the dynamic JavaScript file. The default value is private, maxage=28800. Caching of the dynamic JavaScript file is intended to minimize traffic and improve performance. Note that the Cache-Control header is always set to &amp;quot;no-store&amp;quot; when either the &amp;quot;Rotate&amp;quot; &amp;quot;TokenPerPage&amp;quot; options is set to true in Owasp.CsrfGuard.properties.&lt;br /&gt;
&lt;br /&gt;
 inject-into-forms&lt;br /&gt;
&lt;br /&gt;
Boolean value that determines whether or not the dynamic JavaScript code should inject the CSRF prevention token as a hidden field into HTML forms. The default value is true. Developers are strongly discouraged from disabling this property as most server-side state changing actions are triggered via a POST request.&lt;br /&gt;
&lt;br /&gt;
 inject-into-attributes&lt;br /&gt;
&lt;br /&gt;
Boolean value that determines whether or not the dynamic JavaScript code should inject the CSRF prevention token in the query string of src and href attributes. Injecting the CSRF prevention token in a URL resource increases its general risk of exposure to unauthorized parties. However, most JavaEE web applications respond in the exact same manner to HTTP requests and their associated parameters regardless of the HTTP method. The risk associated with not protecting GET requests in this situation is perceived greater than the risk of exposing the token in protected GET requests. As a result, the default value of this attribute is set to true. Developers that are confident their server-side state changing controllers will only respond to POST requests (i.e. discarding GET requests) are strongly encouraged to disable this property.&lt;br /&gt;
&lt;br /&gt;
== Map JavaScriptServlet ==&lt;br /&gt;
&lt;br /&gt;
Developers must map the JavaScriptServlet to a URI space such that the Servlet class can be remotely accessed by the dynamic JavaScript code. Consider the following configuration snippet taken directly from the [hhttps://github.com/esheri3/OWASP-CSRFGuard/tree/master/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;
      &amp;lt;servlet-name&amp;gt;JavaScriptServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;
      &amp;lt;url-pattern&amp;gt;/JavaScriptServlet&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;
 &amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The aforementioned configuration snippet maps the Servlet referenced by the name &amp;quot;JavaScriptServlet&amp;quot; to the URI space &amp;quot;/JavaScriptServlet&amp;quot;. Any request sent to the /JavaScriptServlet URI will produce a dynamically generated CSRFGuard JavaScript file specific to the user's current session.&lt;br /&gt;
&lt;br /&gt;
== Inject Dynamic JavaScript ==&lt;br /&gt;
&lt;br /&gt;
Developers are required to place an HTML script tag within all pages that are known to send requests to CSRF protected resources. All requests within the current HTML page are augmented to ensure they submit the correct CSRF token for the user's current session. Note that inclusion of the dynamic JavaScript does not protect the current page. Rather, the script ensures the CSRF token is transmitted within all requests generated by the current page. Consider the following code snippet taken directly from the [https://github.com/esheri3/OWASP-CSRFGuard/tree/master/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!-- OWASP CSRFGuard Support --&amp;gt;&lt;br /&gt;
 &amp;lt;script src=&amp;quot;/Owasp.CsrfGuard.Test/JavaScriptServlet&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script tag retrieves and executes the dynamically generated JavaScript from the Servlet mapped at /Owasp.CsrfGuard.Test/JavaScriptServlet. This JavaScript code will register an event handler with window.onload. Once triggered, the code will iterate over every HTML element within the DOM looking for either form tags and or tags containing href or src attributes as configured by the JavaScriptServlet initialization parameters. Forms are dynamically updated to include the CSRFGuard token via a hidden field and tags using src and href attributes are updated to include the CSRFGuard token via a query string parameter.&lt;br /&gt;
&lt;br /&gt;
= JSP Tag Library =&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard 3 exposes a JSP tag library providing developers more fine grain control over token injection. The library exposes JSP tags that allow access to the token name, the token value, and the token name value pair delimited by an equals (=) sign. In order to make use of the tag library, ensure the Owasp.CsrfGuard.jar file is found within the target application's classpath. For example, the [https://github.com/esheri3/OWASP-CSRFGuard/tree/master/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application places the OWASP CSRFGuard jar file within the WebContent/WEB-INF/lib directory. After placing the library in the classpath, developers can reference the tags in JSP pages using predefined URI reference. The following JSP code snippet imports the tag library and makes it available using the prefix &amp;quot;csrf&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%@ taglib uri=&amp;quot;http://www.owasp.org/index.php/Category:OWASP_CSRFGuard_Project/Owasp.CsrfGuard.tld&amp;quot; prefix=&amp;quot;csrf&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The benefit of using the JSP tag library to inject the CSRF prevention token is the fine grain level of control. Developers can place the token in all the correct locations within the context of their applications. This strategy is useful in application contexts where the JavaScript DOM Manipulation strategy is insufficient.&lt;br /&gt;
&lt;br /&gt;
== Display Token Name ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard token name can be obtained through the token-name tag. The token-name tag is useful when injecting the CSRFGuard token name in a non-query string context. Consider the following code snippet taken from the [https://github.com/esheri3/OWASP-CSRFGuard/tree/master/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application. This code makes use of the token-name tag to reference the token name in the name attribute of a hidden input field:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;form name=&amp;quot;test1&amp;quot; action=&amp;quot;protect.html&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; value=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;'''&amp;lt;csrf:token-name/&amp;gt;'''&amp;quot; value=&amp;quot;&amp;lt;csrf:token-value/&amp;gt;&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Display Token Value ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard token value can be obtained through the token-value tag. The token-value tag is useful when injecting the CSRFGuard token value in a non-query string context. Consider the following code snippet taken from the [https://github.com/esheri3/OWASP-CSRFGuard/tree/master/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application. This code makes use of the token-value tag to reference the token value in the value attribute of a hidden input field:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;form name=&amp;quot;test1&amp;quot; action=&amp;quot;protect.html&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; value=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;&amp;lt;csrf:token-name/&amp;gt;&amp;quot; value=&amp;quot;'''&amp;lt;csrf:token-value/&amp;gt;'''&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The token value tag must be used in conjunction with the URI attribute when using the unique token per page model (org.owasp.csrfguard.TokenPerPage). The value of the uri attribute is the URI for which the token value will be posted. Consider the following example which sets the URI to the destination of the form, &amp;quot;protect.html&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;form id=&amp;quot;formTest1&amp;quot; name=&amp;quot;formTest1&amp;quot; action=&amp;quot;protect.html&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; value=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;&amp;lt;csrf:token-name/&amp;gt;&amp;quot; value=&amp;quot;&amp;lt;csrf:token-value uri=&amp;quot;protect.html&amp;quot;/&amp;gt;&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Display Token Name Value Pair ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard token name value pair, delimited by an equals sign (=), can be obtained though the token tag. The token tag is useful when injecting the CSRFGuard token value in a query string context. Consider the following code snippet taken from the [https://github.com/esheri3/OWASP-CSRFGuard/tree/master/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application. This code makes use of the token tag to reference the token name value pair in the href attribute of an anchor tag:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;a href=&amp;quot;protect.html?&amp;lt;csrf:token/&amp;gt;&amp;quot;&amp;gt;protect.html&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The token name value pair tag must be used in conjunction with the URI attribute when using the unique token per page model (org.owasp.csrfguard.TokenPerPage). The value of the uri attribute is the URI for which the token value will be posted. Consider the following example which sets the URI to the destination of the link, &amp;quot;protect.html&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;a href=&amp;quot;protect.html?&amp;lt;csrf:token uri=&amp;quot;protect.html&amp;quot;/&amp;gt;&amp;quot;&amp;gt;protect.html&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Generate Form with Prevention Token ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard JSP library implements a tag library designed specifically to generate HTML forms with the CSRF prevention token automatically embedded as a hidden field. This strategy simplifies the integration of the CSRF token, especially when using the unique token per page model (org.owasp.csrfguard.TokenPerPage). The tag accepts dynamic attribute name value pairs and simply outputs them to the page. As a result, you are free to use the same attribute values made available in a standard HTML form. There is no special output encoding performed on these dynamic attributes. Take care to perform the appropriate validation and output encoding for all dynamic attributes used in conjunction with untrusted data. Consider the following code snippet which will produce a HTML form with an embedded CSRF token. No special care must be taken when using this flag in conjunction with the unique token per uri model:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;csrf:form id=&amp;quot;formTest2&amp;quot; name=&amp;quot;formTest2&amp;quot; action=&amp;quot;protect.html&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; value=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/csrf:form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Generate Link with Prevention Token ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard JSP library implements a tag library designed specifically to generate HTML anchor tags with the CSRF prevention token automatically embedded as a query string parameter. This strategy simplifies the integration of the CSRF token, especially when using the unique token per page model (org.owasp.csrfguard.TokenPerPage). The tag accepts dynamic attribute name value pairs and simply outputs them to the page. As a result, you are free to use the same attribute values made available in a standard HTML anchor. There is no special output encoding performed on these dynamic attributes. Take care to perform the appropriate validation and output encoding for all dynamic attributes used in conjunction with untrusted data. Consider the following code snippet which will produce a HTML anchor tag with an embedded CSRF token. No special care must be taken when using this flag in conjunction with the unique token per uri model:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;csrf:a href=&amp;quot;protect.html&amp;quot;&amp;gt;protect.html&amp;lt;/csrf:a&amp;gt;&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CSRFGuard_3_User_Manual&amp;diff=104951</id>
		<title>CSRFGuard 3 User Manual</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CSRFGuard_3_User_Manual&amp;diff=104951"/>
				<updated>2011-02-12T17:43:52Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
Welcome to the OWASP CSRFGuard 3 User Manual! The purpose of this article is to provide the user with guidance on obtaining, installing, deploying, and developing with the OWASP CSRFGuard library. The author's goal was to keep the User Manual informative, use to understand, and concise. If you find that one or more aspects of this document does not adhere to these goals, please me know at eric dot sheridan at owasp dot org.&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
Users can download the latest release of OWASP CSRFGuard using one of the following links:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/downloads/esheri3/OWASP-CSRFGuard/OWASP-CSRFGuard-3.0.0.499.tar.gz OWASP CSRFGuard 3.0.0.499 (ALPHA)] - download the latest development release with binary and associated configuration files '''(recommended)'''.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
Installation of OWASP CSRFGuard 3 is very straight forward requiring three simple steps:&lt;br /&gt;
&lt;br /&gt;
:# Copy the Owasp.CsrfGuard.jar file to your application's classpath&lt;br /&gt;
:# Declare CsrfGuard in your application's deployment descriptor (web.xml)&lt;br /&gt;
:# Configure the Owasp.CsrfGuard.properties file as you see fit&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Installation | Click here]] for more detailed information regarding the installation of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
&lt;br /&gt;
The minimum configuration settings that users should review include:&lt;br /&gt;
&lt;br /&gt;
:* Default new token landing page (org.owasp.csrfguard.NewTokenLandingPage)&lt;br /&gt;
:* Support for Ajax and XMLHttpRequest (org.owasp.csrfguard.Ajax)&lt;br /&gt;
:* URI resources that should not be protected (org.owasp.csrfguard.unprotected.*)&lt;br /&gt;
:* Actions executed when an attack is detected (org.owasp.csrfguard.action.*)&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Configuration | Click here]] for more information regarding the configuration of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
= Token Injection =&lt;br /&gt;
&lt;br /&gt;
Users of OWASP CSRFGuard can inject prevention tokens into HTML using two strategies:&lt;br /&gt;
&lt;br /&gt;
:* JavaScript DOM Manipulation - largely automated process requiring minimal effort and is ideal for most web applications&lt;br /&gt;
:* JSP Tag Library - provides fine grained strategy ideal for situations where automated DOM manipulation is insufficient.&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Token_Injection | Click here]] for more information regarding the injection of CSRF prevention tokens within your application.&lt;br /&gt;
&lt;br /&gt;
= Known Issues =&lt;br /&gt;
&lt;br /&gt;
The following is a quick bulleted list of known issues within the current release:&lt;br /&gt;
&lt;br /&gt;
:* No known way to inject CSRF prevention tokens into setters of document.location (ex: document.location=&amp;quot;http://www.owasp.org&amp;quot;;)&lt;br /&gt;
:* Tokens are not injected into HTML elements dynamically generated using JavaScript &amp;quot;createElement&amp;quot; and &amp;quot;setAttribute&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_CSRFGuard_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CSRFGuard_3_Installation&amp;diff=104950</id>
		<title>CSRFGuard 3 Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CSRFGuard_3_Installation&amp;diff=104950"/>
				<updated>2011-02-12T17:41:49Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Declare CsrfGuard in Deployment Descriptor */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
The purpose of this article is to provide guidance around the installation of OWASP CSRFGuard within a JavaEE web application. Installation of OWASP CSRFGuard 3 is very straight forward requiring three simple steps. First, you must copy the Owasp.CsrfGuard.jar file to your application's classpath. After copying over the OWASP CSRFGuard library, declare and map the CsrfGuardFilter in your application's web.xml deployment descriptor. This instructs the application server to initialize the OWASP CSRFGuard Filter protecting those resources that match the Filter mapping. Finally, customize the Owasp.CsrfGuard.properties file as you see fit. You'll need to make sure you tell CsrfGuardFilter the location of your CSRFGuard properties file via a JavaEE Filter init-param directive. Please refer to the following sub-sections for more detailed information on each of the aforementioned installation steps.&lt;br /&gt;
&lt;br /&gt;
= Copy Owasp.CsrfGuard.jar to Classpath =&lt;br /&gt;
&lt;br /&gt;
The first thing you need to do is copy the Owasp.CsrfGuard.jar library into your classpath. The most common classpath location to place Owasp.CsrfGuard.jar is within the lib directory of the web application's WEB-INF folder. OWASP CSRFGuard 3 has no additional dependencies outside of the traditional JavaEE runtime environment.&lt;br /&gt;
&lt;br /&gt;
= Declare CsrfGuard in Deployment Descriptor =&lt;br /&gt;
&lt;br /&gt;
After placing Owasp.CsrfGuard.jar in your application's classpath, you'll need to declare CsrfGuard context parameters along with a HttpSessionListener and a Filter. The following web.xml snippet was extracted from the [https://github.com/esheri3/OWASP-CSRFGuard/tree/master/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] web application:&lt;br /&gt;
&lt;br /&gt;
 	&amp;lt;context-param&amp;gt;&lt;br /&gt;
 		&amp;lt;param-name&amp;gt;Owasp.CsrfGuard.Config&amp;lt;/param-name&amp;gt;&lt;br /&gt;
 		&amp;lt;param-value&amp;gt;WEB-INF/Owasp.CsrfGuard.properties&amp;lt;/param-value&amp;gt;&lt;br /&gt;
 	&amp;lt;/context-param&amp;gt;&lt;br /&gt;
 	&lt;br /&gt;
 	&amp;lt;context-param&amp;gt;&lt;br /&gt;
 		&amp;lt;param-name&amp;gt;Owasp.CsrfGuard.Config.Print&amp;lt;/param-name&amp;gt;&lt;br /&gt;
 		&amp;lt;param-value&amp;gt;true&amp;lt;/param-value&amp;gt;&lt;br /&gt;
 	&amp;lt;/context-param&amp;gt;&lt;br /&gt;
 	&lt;br /&gt;
 	&amp;lt;listener&amp;gt;&lt;br /&gt;
 		&amp;lt;listener-class&amp;gt;org.owasp.csrfguard.CsrfGuardListener&amp;lt;/listener-class&amp;gt;&lt;br /&gt;
 	&amp;lt;/listener&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code snippet defines two context parameters: Owasp.CsrfGuard.Config and Owasp.CsrfGuard.Config.Print. The Owasp.CsrfGuard.Config parameter is required and specifies the location of the CSRFGuard properties file. CSRFGuard will search for the properties file specified by searching the following locations in order of appearance: the application's classpath, a directory accessible by the container, or an arbitrary absolute path. The Owasp.CsrfGuard.Config.Print parameter is optional and simply instructs CSRFGuard to display the parsed properties to the application server log file. Finally, we declare and enable the CSRFGuard HttpSessionListener with a class name of org.owasp.csrfguard.CsrfGuardListener. The CsrfGuardListener class is responsible for consuming context parameters and initializing CsrfGuard context for all newly created HttpSessions.&lt;br /&gt;
&lt;br /&gt;
Now that we have the CsrfGuard context initialization facilities in place, we'll need to declare and map the enforcement mechanism: CsrfGuardFilter. CsrfGuardFilter is responsible for facilitating the integration of the CsrfGuard object and associated token verification logic within the JavaEE web application. The following web.xml snippet was extracted from the [https://github.com/esheri3/OWASP-CSRFGuard/tree/master/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] web application:&lt;br /&gt;
&lt;br /&gt;
 	&amp;lt;filter&amp;gt;&lt;br /&gt;
 		&amp;lt;filter-name&amp;gt;CSRFGuard&amp;lt;/filter-name&amp;gt;&lt;br /&gt;
 		&amp;lt;filter-class&amp;gt;org.owasp.csrfguard.CsrfGuardFilter&amp;lt;/filter-class&amp;gt;&lt;br /&gt;
 	&amp;lt;/filter&amp;gt;&lt;br /&gt;
 	&amp;lt;filter-mapping&amp;gt;&lt;br /&gt;
 		&amp;lt;filter-name&amp;gt;CSRFGuard&amp;lt;/filter-name&amp;gt; &lt;br /&gt;
 		&amp;lt;url-pattern&amp;gt;/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;
 	&amp;lt;/filter-mapping&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We create a filter with the name of CSRFGuard and specify a classname of org.owasp.csrfguard.CsrfGuardFilter. At this point, we need to mapp the CSRFGuard Filter to all resources that we want to protect from attack. The following web.xml snippet was extracted from the [https://github.com/esheri3/OWASP-CSRFGuard/tree/master/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] web application:&lt;br /&gt;
&lt;br /&gt;
 	&amp;lt;filter-mapping&amp;gt;&lt;br /&gt;
 		&amp;lt;filter-name&amp;gt;CSRFGuard&amp;lt;/filter-name&amp;gt;&lt;br /&gt;
 		&amp;lt;url-pattern&amp;gt;/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;
 	&amp;lt;/filter-mapping&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The aforementioned code snippet maps CSRFGuard to every resource served by the application server. You can more specifically map the filter through the use of the &amp;quot;servlet-name&amp;quot; and &amp;quot;url-pattern&amp;quot; directives.&lt;br /&gt;
&lt;br /&gt;
= Configure Owasp.CsrfGuard.properties =&lt;br /&gt;
&lt;br /&gt;
The Owasp.CsrfGuard.properties file controls how OWASP CSRFGuard behaves at runtime. CSRFGuard looks for the file in the following locations in order: application's classpath, servlet context directory, and current directory. You are encouraged to make use of the sample Owasp.CsrfGuard.properties file bundled with CSRFGuard to help kick-start your deployment efforts. There are various properties supported by CSRFGuard. At a minimum, you'll want to configure the new token landing page and the action properties. [[CSRFGuard_3_Configuration | Click here]] for more information regarding the configuration of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP CSRFGuard Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CSRFGuard_3_Installation&amp;diff=104949</id>
		<title>CSRFGuard 3 Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CSRFGuard_3_Installation&amp;diff=104949"/>
				<updated>2011-02-12T17:41:02Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
The purpose of this article is to provide guidance around the installation of OWASP CSRFGuard within a JavaEE web application. Installation of OWASP CSRFGuard 3 is very straight forward requiring three simple steps. First, you must copy the Owasp.CsrfGuard.jar file to your application's classpath. After copying over the OWASP CSRFGuard library, declare and map the CsrfGuardFilter in your application's web.xml deployment descriptor. This instructs the application server to initialize the OWASP CSRFGuard Filter protecting those resources that match the Filter mapping. Finally, customize the Owasp.CsrfGuard.properties file as you see fit. You'll need to make sure you tell CsrfGuardFilter the location of your CSRFGuard properties file via a JavaEE Filter init-param directive. Please refer to the following sub-sections for more detailed information on each of the aforementioned installation steps.&lt;br /&gt;
&lt;br /&gt;
= Copy Owasp.CsrfGuard.jar to Classpath =&lt;br /&gt;
&lt;br /&gt;
The first thing you need to do is copy the Owasp.CsrfGuard.jar library into your classpath. The most common classpath location to place Owasp.CsrfGuard.jar is within the lib directory of the web application's WEB-INF folder. OWASP CSRFGuard 3 has no additional dependencies outside of the traditional JavaEE runtime environment.&lt;br /&gt;
&lt;br /&gt;
= Declare CsrfGuard in Deployment Descriptor =&lt;br /&gt;
&lt;br /&gt;
After placing Owasp.CsrfGuard.jar in your application's classpath, you'll need to declare CsrfGuard context parameters along with a HttpSessionListener and a Filter. The following web.xml snippet was extracted from the [https://github.com/esheri3/OWASP-CSRFGuard/tree/master/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] web application:&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;context-param&amp;gt;&lt;br /&gt;
		&amp;lt;param-name&amp;gt;Owasp.CsrfGuard.Config&amp;lt;/param-name&amp;gt;&lt;br /&gt;
		&amp;lt;param-value&amp;gt;WEB-INF/Owasp.CsrfGuard.properties&amp;lt;/param-value&amp;gt;&lt;br /&gt;
	&amp;lt;/context-param&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;context-param&amp;gt;&lt;br /&gt;
		&amp;lt;param-name&amp;gt;Owasp.CsrfGuard.Config.Print&amp;lt;/param-name&amp;gt;&lt;br /&gt;
		&amp;lt;param-value&amp;gt;true&amp;lt;/param-value&amp;gt;&lt;br /&gt;
	&amp;lt;/context-param&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;listener&amp;gt;&lt;br /&gt;
		&amp;lt;listener-class&amp;gt;org.owasp.csrfguard.CsrfGuardListener&amp;lt;/listener-class&amp;gt;&lt;br /&gt;
	&amp;lt;/listener&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code snippet defines two context parameters: Owasp.CsrfGuard.Config and Owasp.CsrfGuard.Config.Print. The Owasp.CsrfGuard.Config parameter is required and specifies the location of the CSRFGuard properties file. CSRFGuard will search for the properties file specified by searching the following locations in order of appearance: the application's classpath, a directory accessible by the container, or an arbitrary absolute path. The Owasp.CsrfGuard.Config.Print parameter is optional and simply instructs CSRFGuard to display the parsed properties to the application server log file. Finally, we declare and enable the CSRFGuard HttpSessionListener with a class name of org.owasp.csrfguard.CsrfGuardListener. The CsrfGuardListener class is responsible for consuming context parameters and initializing CsrfGuard context for all newly created HttpSessions.&lt;br /&gt;
&lt;br /&gt;
Now that we have the CsrfGuard context initialization facilities in place, we'll need to declare and map the enforcement mechanism: CsrfGuardFilter. CsrfGuardFilter is responsible for facilitating the integration of the CsrfGuard object and associated token verification logic within the JavaEE web application. The following web.xml snippet was extracted from the [https://github.com/esheri3/OWASP-CSRFGuard/tree/master/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] web application:&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;filter&amp;gt;&lt;br /&gt;
		&amp;lt;filter-name&amp;gt;CSRFGuard&amp;lt;/filter-name&amp;gt;&lt;br /&gt;
		&amp;lt;filter-class&amp;gt;org.owasp.csrfguard.CsrfGuardFilter&amp;lt;/filter-class&amp;gt;&lt;br /&gt;
	&amp;lt;/filter&amp;gt;&lt;br /&gt;
	&amp;lt;filter-mapping&amp;gt;&lt;br /&gt;
		&amp;lt;filter-name&amp;gt;CSRFGuard&amp;lt;/filter-name&amp;gt;&lt;br /&gt;
		&amp;lt;url-pattern&amp;gt;/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;
	&amp;lt;/filter-mapping&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We create a filter with the name of CSRFGuard and specify a classname of org.owasp.csrfguard.CsrfGuardFilter. At this point, we need to mapp the CSRFGuard Filter to all resources that we want to protect from attack. The following web.xml snippet was extracted from the [https://github.com/esheri3/OWASP-CSRFGuard/tree/master/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] web application:&lt;br /&gt;
&lt;br /&gt;
 	&amp;lt;filter-mapping&amp;gt;&lt;br /&gt;
 		&amp;lt;filter-name&amp;gt;CSRFGuard&amp;lt;/filter-name&amp;gt;&lt;br /&gt;
 		&amp;lt;url-pattern&amp;gt;/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;
 	&amp;lt;/filter-mapping&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The aforementioned code snippet maps CSRFGuard to every resource served by the application server. You can more specifically map the filter through the use of the &amp;quot;servlet-name&amp;quot; and &amp;quot;url-pattern&amp;quot; directives.&lt;br /&gt;
&lt;br /&gt;
= Configure Owasp.CsrfGuard.properties =&lt;br /&gt;
&lt;br /&gt;
The Owasp.CsrfGuard.properties file controls how OWASP CSRFGuard behaves at runtime. CSRFGuard looks for the file in the following locations in order: application's classpath, servlet context directory, and current directory. You are encouraged to make use of the sample Owasp.CsrfGuard.properties file bundled with CSRFGuard to help kick-start your deployment efforts. There are various properties supported by CSRFGuard. At a minimum, you'll want to configure the new token landing page and the action properties. [[CSRFGuard_3_Configuration | Click here]] for more information regarding the configuration of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP CSRFGuard Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CSRFGuard_3_User_Manual&amp;diff=104948</id>
		<title>CSRFGuard 3 User Manual</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CSRFGuard_3_User_Manual&amp;diff=104948"/>
				<updated>2011-02-12T17:25:49Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
Welcome to the OWASP CSRFGuard 3 User Manual! The purpose of this article is to provide the user with guidance on obtaining, installing, deploying, and developing with the OWASP CSRFGuard library. The author's goal was to keep the User Manual informative, use to understand, and concise. If you find that one or more aspects of this document does not adhere to these goals, please me know at eric dot sheridan at owasp dot org.&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
Users can download the latest release of OWASP CSRFGuard using one of the following links:&lt;br /&gt;
&lt;br /&gt;
[https://github.com/downloads/esheri3/OWASP-CSRFGuard/OWASP-CSRFGuard-3.0.0.499.tar.gz OWASP CSRFGuard 3.0.0.499 (ALPHA)] - download the latest development release with binary and associated configuration files '''(recommended)'''.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
Installation of OWASP CSRFGuard 3 is very straight forward requiring three simple steps:&lt;br /&gt;
&lt;br /&gt;
:# Copy the Owasp.CsrfGuard.jar file to your application's classpath&lt;br /&gt;
:# Map the CsrfGuardFilter in your application's deployment descriptor (web.xml)&lt;br /&gt;
:# Configure the Owasp.CsrfGuard.properties file as you see fit&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Installation | Click here]] for more detailed information regarding the installation of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
&lt;br /&gt;
The minimum configuration settings that users should review include:&lt;br /&gt;
&lt;br /&gt;
:* Default new token landing page (org.owasp.csrfguard.NewTokenLandingPage)&lt;br /&gt;
:* Support for Ajax and XMLHttpRequest (org.owasp.csrfguard.Ajax)&lt;br /&gt;
:* URI resources that should not be protected (org.owasp.csrfguard.unprotected.*)&lt;br /&gt;
:* Actions executed when an attack is detected (org.owasp.csrfguard.action.*)&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Configuration | Click here]] for more information regarding the configuration of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
= Token Injection =&lt;br /&gt;
&lt;br /&gt;
Users of OWASP CSRFGuard can inject prevention tokens into HTML using two strategies:&lt;br /&gt;
&lt;br /&gt;
:* JavaScript DOM Manipulation - largely automated process requiring minimal effort and is ideal for most web applications&lt;br /&gt;
:* JSP Tag Library - provides fine grained strategy ideal for situations where automated DOM manipulation is insufficient.&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Token_Injection | Click here]] for more information regarding the injection of CSRF prevention tokens within your application.&lt;br /&gt;
&lt;br /&gt;
= Known Issues =&lt;br /&gt;
&lt;br /&gt;
The following is a quick bulleted list of known issues within the current release:&lt;br /&gt;
&lt;br /&gt;
:* No known way to inject CSRF prevention tokens into setters of document.location (ex: document.location=&amp;quot;http://www.owasp.org&amp;quot;;)&lt;br /&gt;
:* Tokens are not injected into HTML elements dynamically generated using JavaScript &amp;quot;createElement&amp;quot; and &amp;quot;setAttribute&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_CSRFGuard_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=104947</id>
		<title>Category:OWASP CSRFGuard Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=104947"/>
				<updated>2011-02-12T17:24:07Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Downloads */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the home of the OWASP CSRFGuard Project! OWASP CSRFGuard is a library that implements a variant of the [http://www.corej2eepatterns.com/Design/PresoDesign.htm 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.&lt;br /&gt;
&lt;br /&gt;
== Project Lead ==&lt;br /&gt;
&lt;br /&gt;
[http://ericsheridan.blogspot.com/ Eric Sheridan] (eric dot sheridan at owasp dot org) is the lead and primary developer of the OWASP CSRFGuard project. Aside from leading up CSRFGuard, Eric has contributed to or provided guidance on numerous other OWASP projects including the Cross-Site Request Forgery Prevention Cheat Sheet, WebGoat, Stinger, CSRFTester, and Enterprise Security API (ESAPI). He is an Independent Application Security Consultant specializing in a wide variety of application security activities including static analysis, penetration tests, code reviews, and threat modeling. In his personal time... wait, what is that?&lt;br /&gt;
&lt;br /&gt;
== License ==&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard is offered under the [http://www.opensource.org/licenses/bsd-license.php BSD] license. For further information on OWASP licenses, please consult the [[OWASP Licenses]] page.&lt;br /&gt;
&lt;br /&gt;
== Email List ==&lt;br /&gt;
&lt;br /&gt;
You can sign up for the OWASP CSRFGuard email list at [https://lists.owasp.org/mailman/listinfo/owasp-csrfguard https://lists.owasp.org/mailman/listinfo/owasp-csrfguard]&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
You can access the Git repository online at https://github.com/esheri3/OWASP-CSRFGuard&lt;br /&gt;
&lt;br /&gt;
== Downloads ==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/downloads/esheri3/OWASP-CSRFGuard/OWASP-CSRFGuard-3.0.0.499.tar.gz OWASP CSRFGuard 3.0.0.499 (ALPHA)] - download the latest development release with binary and associated configuration files '''(recommended)'''.&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_Deprecated_Releases | Deprecated Releases]] - article containing several download references to deprecated and officially unsupported releases&lt;br /&gt;
&lt;br /&gt;
== User Manual(s) ==&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_User_Manual | OWASP CSRFGuard v3 ]] - series of articles describing the installation, configuration, and deployment of OWASP CSRFGuard v3.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
:*[http://www.owasp.org/index.php/Category:OWASP_CSRFTester_Project OWASP CSRFTester ] - utility to assist in the testing and generating PoC for CSRF attacks.&lt;br /&gt;
:*[[Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet | OWASP CSRF Prevention Cheat Sheet]] - provides a more holistic overview of CSRF prevention strategies and associated frameworks.&lt;br /&gt;
:*http://www.owasp.org/index.php/PHP_CSRF_Guard - project implementing CSRFGuard style solution for PHP.&lt;br /&gt;
:*http://www.thespanner.co.uk/2007/10/19/jsck/ - project implementing CSRFGuard style solution for PHP and JavaScript.&lt;br /&gt;
:*http://www.owasp.org/index.php/.Net_CSRF_Guard - project implementing CSRFGuard style solution for ASP.NET.&lt;br /&gt;
&lt;br /&gt;
== Project Sponsors == &lt;br /&gt;
&lt;br /&gt;
[http://www.aspectsecurity.com https://www.owasp.org/images/d/d1/Aspect_logo.gif].&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Validation_Project]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:OWASP_Project|CSRFGuard Project]]&lt;br /&gt;
[[Category:OWASP_Java_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Summit_2011_Working_Sessions/Session029&amp;diff=104052</id>
		<title>Summit 2011 Working Sessions/Session029</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Summit_2011_Working_Sessions/Session029&amp;diff=104052"/>
				<updated>2011-02-07T13:51:27Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:&amp;lt;includeonly&amp;gt;{{{1}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;Summit 2011 Working Sessions test tab&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| summit_session_attendee_name1 = Chris Schmidt&lt;br /&gt;
| summit_session_attendee_email1 = chris.schmidt@owasp.org&lt;br /&gt;
| summit_session_attendee_username1 = &lt;br /&gt;
| summit_session_attendee_company1=Aspect Security&lt;br /&gt;
| summit_session_attendee_notes,_reason_for_participating_and_issues_to_be discussed1=&lt;br /&gt;
&lt;br /&gt;
| summit_session_attendee_name2 = Achim Hoffmann&lt;br /&gt;
| summit_session_attendee_email2 = achim@owasp.org&lt;br /&gt;
| summit_session_attendee_username2 = Achim&lt;br /&gt;
| summit_session_attendee_company2= sic[!]sec&lt;br /&gt;
| summit_session_attendee_notes,_reason_for_participating_and_issues_to_be discussed2=capabilities of WAFs to protect against CSRF&lt;br /&gt;
&lt;br /&gt;
| summit_session_attendee_name3 = Ryan Barnett&lt;br /&gt;
| summit_session_attendee_email3 = Ryan.Barnett@owasp.org&lt;br /&gt;
| summit_session_attendee_username3 = &lt;br /&gt;
| summit_session_attendee_company3=Trustwave's SpiderLabs&lt;br /&gt;
| summit_session_attendee_notes,_reason_for_participating_and_issues_to_be discussed3=discuss how WAFs (ModSecurity) can help mitigate CSRF.  Also want to discuss/test new CSRFGuard v3 JS code&lt;br /&gt;
&lt;br /&gt;
| summit_session_attendee_name4 = &lt;br /&gt;
| summit_session_attendee_email4 = &lt;br /&gt;
| summit_session_attendee_username4 = &lt;br /&gt;
| summit_session_attendee_company4=&lt;br /&gt;
| summit_session_attendee_notes,_reason_for_participating_and_issues_to_be discussed4=&lt;br /&gt;
&lt;br /&gt;
| summit_session_attendee_name5 = Vishal Garg&lt;br /&gt;
| summit_session_attendee_email5 = vishalgrg@gmail.com&lt;br /&gt;
| summit_session_attendee_username5 = &lt;br /&gt;
| summit_session_attendee_company5= AppSecure Labs&lt;br /&gt;
| summit_session_attendee_notes,_reason_for_participating_and_issues_to_be discussed5= WAFs vs. Frameworks to protect against CSRF&lt;br /&gt;
&lt;br /&gt;
| summit_session_attendee_name6 = &lt;br /&gt;
| summit_session_attendee_email6 = &lt;br /&gt;
| summit_session_attendee_username6 = &lt;br /&gt;
| summit_session_attendee_company6=&lt;br /&gt;
| summit_session_attendee_notes,_reason_for_participating_and_issues_to_be discussed6=&lt;br /&gt;
&lt;br /&gt;
| summit_session_attendee_name7 = &lt;br /&gt;
| summit_session_attendee_email7 = &lt;br /&gt;
| summit_session_attendee_username7 = &lt;br /&gt;
| summit_session_attendee_company7=&lt;br /&gt;
| summit_session_attendee_notes,_reason_for_participating_and_issues_to_be discussed7=&lt;br /&gt;
&lt;br /&gt;
| summit_session_attendee_name8 = &lt;br /&gt;
| summit_session_attendee_email8 = &lt;br /&gt;
| summit_session_attendee_username8 = &lt;br /&gt;
| summit_session_attendee_company8=&lt;br /&gt;
| summit_session_attendee_notes,_reason_for_participating_and_issues_to_be discussed8=&lt;br /&gt;
&lt;br /&gt;
| summit_session_attendee_name9 = &lt;br /&gt;
| summit_session_attendee_email9 = &lt;br /&gt;
| summit_session_attendee_username9 = &lt;br /&gt;
| summit_session_attendee_company9=&lt;br /&gt;
| summit_session_attendee_notes,_reason_for_participating_and_issues_to_be discussed9=&lt;br /&gt;
&lt;br /&gt;
| summit_session_attendee_name10 = &lt;br /&gt;
| summit_session_attendee_email10 = &lt;br /&gt;
| summit_session_attendee_username10 = &lt;br /&gt;
| summit_session_attendee_company10=&lt;br /&gt;
| summit_session_attendee_notes,_reason_for_participating_and_issues_to_be discussed10=&lt;br /&gt;
&lt;br /&gt;
| summit_session_attendee_name11 = &lt;br /&gt;
| summit_session_attendee_email11 = &lt;br /&gt;
| summit_session_attendee_username11 = &lt;br /&gt;
| summit_session_attendee_company11=&lt;br /&gt;
| summit_session_attendee_notes,_reason_for_participating_and_issues_to_be discussed11=&lt;br /&gt;
&lt;br /&gt;
| summit_session_attendee_name12 = &lt;br /&gt;
| summit_session_attendee_email12 = &lt;br /&gt;
| summit_session_attendee_username12 = &lt;br /&gt;
| summit_session_attendee_company12=&lt;br /&gt;
| summit_session_attendee_notes,_reason_for_participating_and_issues_to_be discussed12=&lt;br /&gt;
&lt;br /&gt;
| summit_session_attendee_name13 = &lt;br /&gt;
| summit_session_attendee_email13 = &lt;br /&gt;
| summit_session_attendee_username13 = &lt;br /&gt;
| summit_session_attendee_company13=&lt;br /&gt;
| summit_session_attendee_notes,_reason_for_participating_and_issues_to_be discussed13=&lt;br /&gt;
&lt;br /&gt;
| summit_session_attendee_name14 = &lt;br /&gt;
| summit_session_attendee_email14 = &lt;br /&gt;
| summit_session_attendee_username14 = &lt;br /&gt;
| summit_session_attendee_company14=&lt;br /&gt;
| summit_session_attendee_notes,_reason_for_participating_and_issues_to_be discussed14= &lt;br /&gt;
&lt;br /&gt;
| summit_session_attendee_name15 = &lt;br /&gt;
| summit_session_attendee_email15 = &lt;br /&gt;
| summit_session_attendee_username15 = &lt;br /&gt;
| summit_session_attendee_company15=&lt;br /&gt;
| summit_session_attendee_notes,_reason_for_participating_and_issues_to_be discussed15=&lt;br /&gt;
&lt;br /&gt;
| summit_session_attendee_name16 = &lt;br /&gt;
| summit_session_attendee_email16 = &lt;br /&gt;
| summit_session_attendee_username16 = &lt;br /&gt;
| summit_session_attendee_company16=&lt;br /&gt;
| summit_session_attendee_notes,_reason_for_participating_and_issues_to_be discussed16=&lt;br /&gt;
&lt;br /&gt;
| summit_session_attendee_name17 = &lt;br /&gt;
| summit_session_attendee_email17 = &lt;br /&gt;
| summit_session_attendee_username17 = &lt;br /&gt;
| summit_session_attendee_company17=&lt;br /&gt;
| summit_session_attendee_notes,_reason_for_participating_and_issues_to_be discussed17=&lt;br /&gt;
&lt;br /&gt;
| summit_session_attendee_name18 = &lt;br /&gt;
| summit_session_attendee_email18 = &lt;br /&gt;
| summit_session_attendee_username18 = &lt;br /&gt;
| summit_session_attendee_company18=&lt;br /&gt;
| summit_session_attendee_notes,_reason_for_participating_and_issues_to_be discussed18=&lt;br /&gt;
&lt;br /&gt;
| summit_session_attendee_name19 = &lt;br /&gt;
| summit_session_attendee_email19 = &lt;br /&gt;
| summit_session_attendee_username19 = &lt;br /&gt;
| summit_session_attendee_company19=&lt;br /&gt;
| summit_session_attendee_notes,_reason_for_participating_and_issues_to_be discussed19=&lt;br /&gt;
&lt;br /&gt;
| summit_session_attendee_name20 = &lt;br /&gt;
| summit_session_attendee_email20 = &lt;br /&gt;
| summit_session_attendee_username20 = &lt;br /&gt;
| summit_session_attendee_company20=&lt;br /&gt;
| summit_session_attendee_notes,_reason_for_participating_and_issues_to_be discussed20=&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| summit_track_logo = [[Image:T._secure_coding.jpg]]&lt;br /&gt;
| summit_ws_logo = [[Image:WS._secure_coding.jpg]]&lt;br /&gt;
| summit_session_name = Protecting Against CSRF&lt;br /&gt;
| summit_session_url = http://www.owasp.org/index.php/Summit_2011_Working_Sessions/Session029&lt;br /&gt;
| mailing_list =&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| short_working_session_description = Examining different ways to build CSRF protection into web applications and web frameworks.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| related_project_name1 = ESAPI Java CSRF protection in DefaultHTTPUtilities.java&lt;br /&gt;
| related_project_url_1 = https://code.google.com/p/owasp-esapi-java/source/browse/trunk/src/main/java/org/owasp/esapi/reference/DefaultHTTPUtilities.java&lt;br /&gt;
&lt;br /&gt;
| related_project_name2 = CSRFGuard&lt;br /&gt;
| related_project_url_2 = http://www.owasp.org/index.php/Category:OWASP_CSRFGuard_Project&lt;br /&gt;
&lt;br /&gt;
| related_project_name3 = Preventing CSRF with mod_security&lt;br /&gt;
| related_project_url_3 = http://knol.google.com/k/preventing-cross-site-request-forgeries-csrf-using-modsecurity#&lt;br /&gt;
&lt;br /&gt;
| related_project_name4 = Prevent CSRF with ModSecurity v2 (Request Validation Tokens via Content Injection)&lt;br /&gt;
| related_project_url_4 = http://blog.spiderlabs.com/2011/01/detecting-malice-with-modsecurity-csrf-attacks.html&lt;br /&gt;
&lt;br /&gt;
| related_project_name5 = &lt;br /&gt;
| related_project_url_5 = &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| summit_session_objective_name1= &lt;br /&gt;
&lt;br /&gt;
| summit_session_objective_name2 = &lt;br /&gt;
&lt;br /&gt;
| summit_session_objective_name3 = &lt;br /&gt;
&lt;br /&gt;
| summit_session_objective_name4 = &lt;br /&gt;
&lt;br /&gt;
| summit_session_objective_name5 =  &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| working_session_date_and_time = &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| discussion_model = participants and attendees&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| operational_resources = Projector, whiteboards, markers, Internet connectivity, power&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| working_session_additional_details = &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|summit_session_deliverable_name1 = A practical guideline for protecting against CSRF in the real world.&lt;br /&gt;
&lt;br /&gt;
|summit_session_deliverable_name2 = A concise, clear standard for determining whether an application is vulnerable to CSRF.&lt;br /&gt;
&lt;br /&gt;
|summit_session_deliverable_name3 = &lt;br /&gt;
&lt;br /&gt;
|summit_session_deliverable_name4 = &lt;br /&gt;
&lt;br /&gt;
|summit_session_deliverable_name5 = &lt;br /&gt;
&lt;br /&gt;
|summit_session_deliverable_name6 = &lt;br /&gt;
&lt;br /&gt;
|summit_session_deliverable_name7 = &lt;br /&gt;
&lt;br /&gt;
|summit_session_deliverable_name8 = &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| summit_session_leader_name1 = &lt;br /&gt;
| summit_session_leader_email1 = &lt;br /&gt;
&lt;br /&gt;
| summit_session_leader_name2 = &lt;br /&gt;
| summit_session_leader_email2 = &lt;br /&gt;
| summit_session_leader_username2 = &lt;br /&gt;
&lt;br /&gt;
| summit_session_leader_name3 = &lt;br /&gt;
| summit_session_leader_email3 = &lt;br /&gt;
| summit_session_leader_username3 = &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| operational_leader_name1 =&lt;br /&gt;
| operational_leader_email1 =&lt;br /&gt;
| operational_leader_username1 = &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| meeting_notes = &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| session_name_mask = &amp;lt;!--Please replace DO NOT EDIT this string --&amp;gt; Session029&lt;br /&gt;
| session_home_page = &amp;lt;!--Please replace DO NOT EDIT this string --&amp;gt; Summit_2011_Working_Sessions/Session029&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=102721</id>
		<title>Category:OWASP CSRFGuard Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=102721"/>
				<updated>2011-01-31T16:33:29Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the home of the OWASP CSRFGuard Project! OWASP CSRFGuard is a library that implements a variant of the [http://www.corej2eepatterns.com/Design/PresoDesign.htm 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.&lt;br /&gt;
&lt;br /&gt;
== Project Lead ==&lt;br /&gt;
&lt;br /&gt;
[http://ericsheridan.blogspot.com/ Eric Sheridan] (eric dot sheridan at owasp dot org) is the lead and primary developer of the OWASP CSRFGuard project. Aside from leading up CSRFGuard, Eric has contributed to or provided guidance on numerous other OWASP projects including the Cross-Site Request Forgery Prevention Cheat Sheet, WebGoat, Stinger, CSRFTester, and Enterprise Security API (ESAPI). He is an Independent Application Security Consultant specializing in a wide variety of application security activities including static analysis, penetration tests, code reviews, and threat modeling. In his personal time... wait, what is that?&lt;br /&gt;
&lt;br /&gt;
== License ==&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard is offered under the [http://www.opensource.org/licenses/bsd-license.php BSD] license. For further information on OWASP licenses, please consult the [[OWASP Licenses]] page.&lt;br /&gt;
&lt;br /&gt;
== Email List ==&lt;br /&gt;
&lt;br /&gt;
You can sign up for the OWASP CSRFGuard email list at [https://lists.owasp.org/mailman/listinfo/owasp-csrfguard https://lists.owasp.org/mailman/listinfo/owasp-csrfguard]&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
You can access the Git repository online at https://github.com/esheri3/OWASP-CSRFGuard&lt;br /&gt;
&lt;br /&gt;
== Downloads ==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/downloads/esheri3/OWASP-CSRFGuard/OWASP-CSRFGuard-3.0.0.479.tar.gz OWASP CSRFGuard 3.0.0.479 (ALPHA)] - download the latest development release with binary and associated configuration files '''(recommended)'''.&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_Deprecated_Releases | Deprecated Releases]] - article containing several download references to deprecated and officially unsupported releases&lt;br /&gt;
&lt;br /&gt;
== User Manual(s) ==&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_User_Manual | OWASP CSRFGuard v3 ]] - series of articles describing the installation, configuration, and deployment of OWASP CSRFGuard v3.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
:*[http://www.owasp.org/index.php/Category:OWASP_CSRFTester_Project OWASP CSRFTester ] - utility to assist in the testing and generating PoC for CSRF attacks.&lt;br /&gt;
:*[[Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet | OWASP CSRF Prevention Cheat Sheet]] - provides a more holistic overview of CSRF prevention strategies and associated frameworks.&lt;br /&gt;
:*http://www.owasp.org/index.php/PHP_CSRF_Guard - project implementing CSRFGuard style solution for PHP.&lt;br /&gt;
:*http://www.thespanner.co.uk/2007/10/19/jsck/ - project implementing CSRFGuard style solution for PHP and JavaScript.&lt;br /&gt;
:*http://www.owasp.org/index.php/.Net_CSRF_Guard - project implementing CSRFGuard style solution for ASP.NET.&lt;br /&gt;
&lt;br /&gt;
== Project Sponsors == &lt;br /&gt;
&lt;br /&gt;
[http://www.aspectsecurity.com https://www.owasp.org/images/d/d1/Aspect_logo.gif].&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Validation_Project]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:OWASP_Project|CSRFGuard Project]]&lt;br /&gt;
[[Category:OWASP_Java_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CSRFGuard_3_User_Manual&amp;diff=102362</id>
		<title>CSRFGuard 3 User Manual</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CSRFGuard_3_User_Manual&amp;diff=102362"/>
				<updated>2011-01-28T02:40:46Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
Welcome to the OWASP CSRFGuard 3 User Manual! The purpose of this article is to provide the user with guidance on obtaining, installing, deploying, and developing with the OWASP CSRFGuard library. The author's goal was to keep the User Manual informative, use to understand, and concise. If you find that one or more aspects of this document does not adhere to these goals, please me know at eric dot sheridan at owasp dot org.&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
Users can download the latest release of OWASP CSRFGuard using one of the following links:&lt;br /&gt;
&lt;br /&gt;
:[https://github.com/downloads/esheri3/OWASP-CSRFGuard/OWASP-CSRFGuard-3.0.0.479.tar.gz&lt;br /&gt;
 OWASP CSRFGuard 3.0.0.479 (ALPHA)] - download the latest development release with binary and associated configuration files '''(recommended)'''.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
Installation of OWASP CSRFGuard 3 is very straight forward requiring three simple steps:&lt;br /&gt;
&lt;br /&gt;
:# Copy the Owasp.CsrfGuard.jar file to your application's classpath&lt;br /&gt;
:# Map the CsrfGuardFilter in your application's deployment descriptor (web.xml)&lt;br /&gt;
:# Configure the Owasp.CsrfGuard.properties file as you see fit&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Installation | Click here]] for more detailed information regarding the installation of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
&lt;br /&gt;
The minimum configuration settings that users should review include:&lt;br /&gt;
&lt;br /&gt;
:* Default new token landing page (org.owasp.csrfguard.NewTokenLandingPage)&lt;br /&gt;
:* Support for Ajax and XMLHttpRequest (org.owasp.csrfguard.Ajax)&lt;br /&gt;
:* URI resources that should not be protected (org.owasp.csrfguard.unprotected.*)&lt;br /&gt;
:* Actions executed when an attack is detected (org.owasp.csrfguard.action.*)&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Configuration | Click here]] for more information regarding the configuration of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
= Token Injection =&lt;br /&gt;
&lt;br /&gt;
Users of OWASP CSRFGuard can inject prevention tokens into HTML using two strategies:&lt;br /&gt;
&lt;br /&gt;
:* JavaScript DOM Manipulation - largely automated process requiring minimal effort and is ideal for most web applications&lt;br /&gt;
:* JSP Tag Library - provides fine grained strategy ideal for situations where automated DOM manipulation is insufficient.&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Token_Injection | Click here]] for more information regarding the injection of CSRF prevention tokens within your application.&lt;br /&gt;
&lt;br /&gt;
= Known Issues =&lt;br /&gt;
&lt;br /&gt;
The following is a quick bulleted list of known issues within the current release:&lt;br /&gt;
&lt;br /&gt;
:* No known way to inject CSRF prevention tokens into setters of document.location (ex: document.location=&amp;quot;http://www.owasp.org&amp;quot;;)&lt;br /&gt;
:* Tokens are not injected into HTML elements dynamically generated using JavaScript &amp;quot;createElement&amp;quot; and &amp;quot;setAttribute&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_CSRFGuard_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CSRFGuard_3_User_Manual&amp;diff=102361</id>
		<title>CSRFGuard 3 User Manual</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CSRFGuard_3_User_Manual&amp;diff=102361"/>
				<updated>2011-01-28T02:39:56Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Known Issues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
Welcome to the OWASP CSRFGuard 3 User Manual! The purpose of this article is to provide the user with guidance on obtaining, installing, deploying, and developing with the OWASP CSRFGuard library. The author's goal was to keep the User Manual informative, use to understand, and concise. If you find that one or more aspects of this document does not adhere to these goals, please me know at eric dot sheridan at owasp dot org.&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
Users can download the latest release of OWASP CSRFGuard using one of the following links:&lt;br /&gt;
&lt;br /&gt;
:[http://code.google.com/p/owaspcsrfguard/downloads/detail?name=OWASP%20CSRFGuard%20%283.0.0.245%20-%20ALPHA%29.zip&amp;amp;can=2&amp;amp;q= OWASP CSRFGuard 3.0.0.245 (ALPHA)] - download the latest development release with binary and associated configuration files '''(recommended)'''.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
Installation of OWASP CSRFGuard 3 is very straight forward requiring three simple steps:&lt;br /&gt;
&lt;br /&gt;
:# Copy the Owasp.CsrfGuard.jar file to your application's classpath&lt;br /&gt;
:# Map the CsrfGuardFilter in your application's deployment descriptor (web.xml)&lt;br /&gt;
:# Configure the Owasp.CsrfGuard.properties file as you see fit&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Installation | Click here]] for more detailed information regarding the installation of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
&lt;br /&gt;
The minimum configuration settings that users should review include:&lt;br /&gt;
&lt;br /&gt;
:* Default new token landing page (org.owasp.csrfguard.NewTokenLandingPage)&lt;br /&gt;
:* Support for Ajax and XMLHttpRequest (org.owasp.csrfguard.Ajax)&lt;br /&gt;
:* URI resources that should not be protected (org.owasp.csrfguard.unprotected.*)&lt;br /&gt;
:* Actions executed when an attack is detected (org.owasp.csrfguard.action.*)&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Configuration | Click here]] for more information regarding the configuration of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
= Token Injection =&lt;br /&gt;
&lt;br /&gt;
Users of OWASP CSRFGuard can inject prevention tokens into HTML using two strategies:&lt;br /&gt;
&lt;br /&gt;
:* JavaScript DOM Manipulation - largely automated process requiring minimal effort and is ideal for most web applications&lt;br /&gt;
:* JSP Tag Library - provides fine grained strategy ideal for situations where automated DOM manipulation is insufficient.&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Token_Injection | Click here]] for more information regarding the injection of CSRF prevention tokens within your application.&lt;br /&gt;
&lt;br /&gt;
= Known Issues =&lt;br /&gt;
&lt;br /&gt;
The following is a quick bulleted list of known issues within the current release:&lt;br /&gt;
&lt;br /&gt;
:* No known way to inject CSRF prevention tokens into setters of document.location (ex: document.location=&amp;quot;http://www.owasp.org&amp;quot;;)&lt;br /&gt;
:* Tokens are not injected into HTML elements dynamically generated using JavaScript &amp;quot;createElement&amp;quot; and &amp;quot;setAttribute&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_CSRFGuard_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=102360</id>
		<title>Category:OWASP CSRFGuard Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=102360"/>
				<updated>2011-01-28T02:25:26Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Downloads */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the home of the OWASP CSRFGuard Project! OWASP CSRFGuard is a library that implements a variant of the [http://www.corej2eepatterns.com/Design/PresoDesign.htm 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.&lt;br /&gt;
&lt;br /&gt;
== Project Lead ==&lt;br /&gt;
&lt;br /&gt;
[http://ericsheridan.blogspot.com/ Eric Sheridan] (eric dot sheridan at owasp dot org) is the lead and primary developer of the OWASP CSRFGuard project. Aside from leading up CSRFGuard, Eric has contributed to or provided guidance on numerous other OWASP projects including the Cross-Site Request Forgery Prevention Cheat Sheet, WebGoat, Stinger, CSRFTester, and Enterprise Security API (ESAPI). He is a Principal Consultant at Aspect Security specializing in a wide variety of application security activities including static analysis, penetration tests, code reviews, and threat modeling. In his personal time... wait, what is that?&lt;br /&gt;
&lt;br /&gt;
== License ==&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard is offered under the [http://www.opensource.org/licenses/bsd-license.php BSD] license. For further information on OWASP licenses, please consult the [[OWASP Licenses]] page.&lt;br /&gt;
&lt;br /&gt;
== Email List ==&lt;br /&gt;
&lt;br /&gt;
You can sign up for the OWASP CSRFGuard email list at [https://lists.owasp.org/mailman/listinfo/owasp-csrfguard https://lists.owasp.org/mailman/listinfo/owasp-csrfguard]&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
You can access the Git repository online at https://github.com/esheri3/OWASP-CSRFGuard&lt;br /&gt;
&lt;br /&gt;
== Downloads ==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/downloads/esheri3/OWASP-CSRFGuard/OWASP-CSRFGuard-3.0.0.479.tar.gz OWASP CSRFGuard 3.0.0.479 (ALPHA)] - download the latest development release with binary and associated configuration files '''(recommended)'''.&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_Deprecated_Releases | Deprecated Releases]] - article containing several download references to deprecated and officially unsupported releases&lt;br /&gt;
&lt;br /&gt;
== User Manual(s) ==&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_User_Manual | OWASP CSRFGuard v3 ]] - series of articles describing the installation, configuration, and deployment of OWASP CSRFGuard v3.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
:*[http://www.owasp.org/index.php/Category:OWASP_CSRFTester_Project OWASP CSRFTester ] - utility to assist in the testing and generating PoC for CSRF attacks.&lt;br /&gt;
:*[[Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet | OWASP CSRF Prevention Cheat Sheet]] - provides a more holistic overview of CSRF prevention strategies and associated frameworks.&lt;br /&gt;
:*http://www.owasp.org/index.php/PHP_CSRF_Guard - project implementing CSRFGuard style solution for PHP.&lt;br /&gt;
:*http://www.thespanner.co.uk/2007/10/19/jsck/ - project implementing CSRFGuard style solution for PHP and JavaScript.&lt;br /&gt;
:*http://www.owasp.org/index.php/.Net_CSRF_Guard - project implementing CSRFGuard style solution for ASP.NET.&lt;br /&gt;
&lt;br /&gt;
== Project Sponsors == &lt;br /&gt;
&lt;br /&gt;
[http://www.aspectsecurity.com https://www.owasp.org/images/d/d1/Aspect_logo.gif].&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Validation_Project]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:OWASP_Project|CSRFGuard Project]]&lt;br /&gt;
[[Category:OWASP_Java_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=102359</id>
		<title>Category:OWASP CSRFGuard Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=102359"/>
				<updated>2011-01-28T01:43:53Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Source Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the home of the OWASP CSRFGuard Project! OWASP CSRFGuard is a library that implements a variant of the [http://www.corej2eepatterns.com/Design/PresoDesign.htm 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.&lt;br /&gt;
&lt;br /&gt;
== Project Lead ==&lt;br /&gt;
&lt;br /&gt;
[http://ericsheridan.blogspot.com/ Eric Sheridan] (eric dot sheridan at owasp dot org) is the lead and primary developer of the OWASP CSRFGuard project. Aside from leading up CSRFGuard, Eric has contributed to or provided guidance on numerous other OWASP projects including the Cross-Site Request Forgery Prevention Cheat Sheet, WebGoat, Stinger, CSRFTester, and Enterprise Security API (ESAPI). He is a Principal Consultant at Aspect Security specializing in a wide variety of application security activities including static analysis, penetration tests, code reviews, and threat modeling. In his personal time... wait, what is that?&lt;br /&gt;
&lt;br /&gt;
== License ==&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard is offered under the [http://www.opensource.org/licenses/bsd-license.php BSD] license. For further information on OWASP licenses, please consult the [[OWASP Licenses]] page.&lt;br /&gt;
&lt;br /&gt;
== Email List ==&lt;br /&gt;
&lt;br /&gt;
You can sign up for the OWASP CSRFGuard email list at [https://lists.owasp.org/mailman/listinfo/owasp-csrfguard https://lists.owasp.org/mailman/listinfo/owasp-csrfguard]&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
You can access the Git repository online at https://github.com/esheri3/OWASP-CSRFGuard&lt;br /&gt;
&lt;br /&gt;
== Downloads ==&lt;br /&gt;
&lt;br /&gt;
[http://code.google.com/p/owaspcsrfguard/downloads/detail?name=OWASP%20CSRFGuard%20%283.0.0.336%20-%20ALPHA%29.zip&amp;amp;can=2&amp;amp;q= OWASP CSRFGuard 3.0.0.336 (ALPHA)] - download the latest development release with binary and associated configuration files '''(recommended)'''.&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_Deprecated_Releases | Deprecated Releases]] - article containing several download references to deprecated and officially unsupported releases&lt;br /&gt;
&lt;br /&gt;
== User Manual(s) ==&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_User_Manual | OWASP CSRFGuard v3 ]] - series of articles describing the installation, configuration, and deployment of OWASP CSRFGuard v3.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
:*[http://www.owasp.org/index.php/Category:OWASP_CSRFTester_Project OWASP CSRFTester ] - utility to assist in the testing and generating PoC for CSRF attacks.&lt;br /&gt;
:*[[Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet | OWASP CSRF Prevention Cheat Sheet]] - provides a more holistic overview of CSRF prevention strategies and associated frameworks.&lt;br /&gt;
:*http://www.owasp.org/index.php/PHP_CSRF_Guard - project implementing CSRFGuard style solution for PHP.&lt;br /&gt;
:*http://www.thespanner.co.uk/2007/10/19/jsck/ - project implementing CSRFGuard style solution for PHP and JavaScript.&lt;br /&gt;
:*http://www.owasp.org/index.php/.Net_CSRF_Guard - project implementing CSRFGuard style solution for ASP.NET.&lt;br /&gt;
&lt;br /&gt;
== Project Sponsors == &lt;br /&gt;
&lt;br /&gt;
[http://www.aspectsecurity.com https://www.owasp.org/images/d/d1/Aspect_logo.gif].&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Validation_Project]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:OWASP_Project|CSRFGuard Project]]&lt;br /&gt;
[[Category:OWASP_Java_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CSRFGuard_3_Token_Injection&amp;diff=98328</id>
		<title>CSRFGuard 3 Token Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CSRFGuard_3_Token_Injection&amp;diff=98328"/>
				<updated>2011-01-04T21:18:57Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Declare and Configure JavaScriptServlet */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard implements a variant of the synchronizer token pattern to mitigate the risk of CSRF attacks. In order to implement this pattern, CSRFGuard must offer the capability to place the CSRF prevention token within the HTML produced by the protected web application. CSRFGuard 3 provides developers more fine grain control over the injection of the token. Developers can inject the token in their HTML using either dynamic JavaScript DOM manipulation or a JSP tag library. CSRFGuard no longer intercepts and modifies the HttpServletResponse object as was done in previous releases. The currently available token injection strategies are designed to make the integration of CSRFGuard more feasible and scalable within current enterprise web applications. Developers are encouraged to make use of both the JavaScript DOM Manipulation and the JSP tag library strategies for a complete token injection strategy. The JavaScript DOM Manipulation strategy is ideal as it is automated and requires minimal effort on behalf of the developer. In the event the JavaScript solution is insufficient within a particular application context, developers should leverage the JSP tag library. The purpose of this article is to describe the token injection strategies offered by OWASP CSRFGuard 3.&lt;br /&gt;
&lt;br /&gt;
= JavaScript DOM Manipulation =&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard 3 supports the ability to dynamically inject CSRF prevention tokens throughout the DOM currently loaded in the user's browser. This strategy is extremely valuable with regards to server-side performance as it simply requires the serving of a dynamic JavaScript file. There is little to no performance hit when the fetched dynamic JavaScript updates the browser's DOM. Making use of the JavaScript token injection solution requires the developer map a Servlet and place a JavaScript HTML tag within all pages sending requests to protected application resources. Developers are strongly encouraged to leverage the JavaScript token injection strategy by default. This strategy requires minimal effort on behalf of the developer as most of the token injection logic is automated. In the event that the JavaScript automated solution may be insufficient for a specific application context, developers should leverage the OWASP CSRFGuard JSP tag library.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Use of JavaScript DOM Manipulation is required for Ajax support.&lt;br /&gt;
&lt;br /&gt;
== Declare and Configure JavaScriptServlet ==&lt;br /&gt;
&lt;br /&gt;
The JavaScript file used for token injection is dynamically generated by the JavaScriptServlet class using a template file. Ensure that the Owasp.CsrfGuard.jar file is found within the target application's classpath. Copy the Owasp.CsrfGuard.js template file from the OWASP CSRFGuard distribution folder to a non-publicly accessible directory within the target application. For the remainder of this section, we assume the Owasp.CsrfGuard.js template file was placed in the application's WEB-INF folder. Edit the deployment descriptor (web.xml) to declare the JavaScriptServlet class along with any associated initialization parameters. Consider the following configuration snippet taken from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;servlet&amp;gt;&lt;br /&gt;
      &amp;lt;servlet-name&amp;gt;JavaScriptServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;
      &amp;lt;servlet-class&amp;gt;org.owasp.csrfguard.servlet.JavaScriptServlet&amp;lt;/servlet-class&amp;gt;&lt;br /&gt;
      &amp;lt;init-param&amp;gt;&lt;br /&gt;
          &amp;lt;param-name&amp;gt;source-file&amp;lt;/param-name&amp;gt;&lt;br /&gt;
          &amp;lt;param-value&amp;gt;WEB-INF/Owasp.CsrfGuard.js&amp;lt;/param-value&amp;gt;&lt;br /&gt;
      &amp;lt;/init-param&amp;gt;&lt;br /&gt;
      &amp;lt;init-param&amp;gt;&lt;br /&gt;
          &amp;lt;param-name&amp;gt;inject-into-forms&amp;lt;/param-name&amp;gt;&lt;br /&gt;
          &amp;lt;param-value&amp;gt;true&amp;lt;/param-value&amp;gt;&lt;br /&gt;
      &amp;lt;/init-param&amp;gt;&lt;br /&gt;
      &amp;lt;init-param&amp;gt;&lt;br /&gt;
          &amp;lt;param-name&amp;gt;inject-into-attributes&amp;lt;/param-name&amp;gt;&lt;br /&gt;
          &amp;lt;param-value&amp;gt;true&amp;lt;/param-value&amp;gt;&lt;br /&gt;
      &amp;lt;/init-param&amp;gt;&lt;br /&gt;
     &amp;lt;init-param&amp;gt;&lt;br /&gt;
          &amp;lt;param-name&amp;gt;domain-strict&amp;lt;/param-name&amp;gt;&lt;br /&gt;
          &amp;lt;param-value&amp;gt;false&amp;lt;/param-value&amp;gt;&lt;br /&gt;
     &amp;lt;/init-param&amp;gt;&lt;br /&gt;
     &amp;lt;init-param&amp;gt;&lt;br /&gt;
          &amp;lt;param-name&amp;gt;referer-pattern&amp;lt;/param-name&amp;gt;&lt;br /&gt;
          &amp;lt;param-value&amp;gt;.*localhost.*&amp;lt;/param-value&amp;gt;&lt;br /&gt;
     &amp;lt;/init-param&amp;gt;&lt;br /&gt;
 &amp;lt;/servlet&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The aforementioned configuration snippet declares the JavaScriptServlet class using the name &amp;quot;JavaScriptServlet&amp;quot;. JavaScriptServlet accepts various initialization parameters augmenting the behavior of the class at runtime. The provided configuration snippet instructs JavaScriptServlet to...&lt;br /&gt;
&lt;br /&gt;
#Leverage the template JavaScript file at WEB-INF/Owasp.CsrfGuard.js&lt;br /&gt;
#Inject the token into all HTML forms&lt;br /&gt;
#Inject the token into all src and href attributes&lt;br /&gt;
#Leverage loose same origin matching criteria when placing the token in URL resources&lt;br /&gt;
&lt;br /&gt;
Consider the following for a more detailed listing of the initialization parameters supported by JavaScriptServlet:&lt;br /&gt;
&lt;br /&gt;
 source-file&lt;br /&gt;
&lt;br /&gt;
Denotes the location of the JavaScript template file that should be consumed and dynamically augmented by the JavaScriptServlet class. The default value is WEB-INF/Owasp.CsrfGuard.js. Use of this property and the existence of the specified template file is required. &lt;br /&gt;
&lt;br /&gt;
 domain-strict&lt;br /&gt;
&lt;br /&gt;
Boolean value that determines whether or not the dynamic JavaScript code should be strict with regards to what links it should inject the CSRF prevention token. With a value of true, the JavaScript code will only place the token in links that point to the same exact domain from which the HTML originated. With a value of false, the JavaScript code will place the token in links that not only point to the same exact domain from which the HTML originated, but sub-domains as well.&lt;br /&gt;
&lt;br /&gt;
 referer-pattern&lt;br /&gt;
&lt;br /&gt;
Allows the developer to specify a regular expression describing the required value of the Referer header. Any attempts to access the servlet with a Referer header that does not match the captured expression is discarded. Inclusion of referer header checking is to help minimize the risk of JavaScript Hijacking attacks that attempt to steal tokens from the dynamically generated JavaScript. While the primary defenses against JavaScript Hijacking attacks are implemented within the dynamic JavaScript itself, referer header checking is implemented to achieve defense in depth.&lt;br /&gt;
&lt;br /&gt;
 cache-control&lt;br /&gt;
&lt;br /&gt;
Allows the developer to specify the value of the Cache-Control header in the HTTP response when serving the dynamic JavaScript file. The default value is private, maxage=28800. Caching of the dynamic JavaScript file is intended to minimize traffic and improve performance. Note that the Cache-Control header is always set to &amp;quot;no-store&amp;quot; when either the &amp;quot;Rotate&amp;quot; &amp;quot;TokenPerPage&amp;quot; options is set to true in Owasp.CsrfGuard.properties.&lt;br /&gt;
&lt;br /&gt;
 inject-into-forms&lt;br /&gt;
&lt;br /&gt;
Boolean value that determines whether or not the dynamic JavaScript code should inject the CSRF prevention token as a hidden field into HTML forms. The default value is true. Developers are strongly discouraged from disabling this property as most server-side state changing actions are triggered via a POST request.&lt;br /&gt;
&lt;br /&gt;
 inject-into-attributes&lt;br /&gt;
&lt;br /&gt;
Boolean value that determines whether or not the dynamic JavaScript code should inject the CSRF prevention token in the query string of src and href attributes. Injecting the CSRF prevention token in a URL resource increases its general risk of exposure to unauthorized parties. However, most JavaEE web applications respond in the exact same manner to HTTP requests and their associated parameters regardless of the HTTP method. The risk associated with not protecting GET requests in this situation is perceived greater than the risk of exposing the token in protected GET requests. As a result, the default value of this attribute is set to true. Developers that are confident their server-side state changing controllers will only respond to POST requests (i.e. discarding GET requests) are strongly encouraged to disable this property.&lt;br /&gt;
&lt;br /&gt;
== Map JavaScriptServlet ==&lt;br /&gt;
&lt;br /&gt;
Developers must map the JavaScriptServlet to a URI space such that the Servlet class can be remotely accessed by the dynamic JavaScript code. Consider the following configuration snippet taken directly from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;
      &amp;lt;servlet-name&amp;gt;JavaScriptServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;
      &amp;lt;url-pattern&amp;gt;/JavaScriptServlet&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;
 &amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The aforementioned configuration snippet maps the Servlet referenced by the name &amp;quot;JavaScriptServlet&amp;quot; to the URI space &amp;quot;/JavaScriptServlet&amp;quot;. Any request sent to the /JavaScriptServlet URI will produce a dynamically generated CSRFGuard JavaScript file specific to the user's current session.&lt;br /&gt;
&lt;br /&gt;
== Inject Dynamic JavaScript ==&lt;br /&gt;
&lt;br /&gt;
Developers are required to place an HTML script tag within all pages that are known to send requests to CSRF protected resources. All requests within the current HTML page are augmented to ensure they submit the correct CSRF token for the user's current session. Note that inclusion of the dynamic JavaScript does not protect the current page. Rather, the script ensures the CSRF token is transmitted within all requests generated by the current page. Consider the following code snippet taken directly from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!-- OWASP CSRFGuard Support --&amp;gt;&lt;br /&gt;
 &amp;lt;script src=&amp;quot;/Owasp.CsrfGuard.Test/JavaScriptServlet&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script tag retrieves and executes the dynamically generated JavaScript from the Servlet mapped at /Owasp.CsrfGuard.Test/JavaScriptServlet. This JavaScript code will register an event handler with window.onload. Once triggered, the code will iterate over every HTML element within the DOM looking for either form tags and or tags containing href or src attributes as configured by the JavaScriptServlet initialization parameters. Forms are dynamically updated to include the CSRFGuard token via a hidden field and tags using src and href attributes are updated to include the CSRFGuard token via a query string parameter.&lt;br /&gt;
&lt;br /&gt;
= JSP Tag Library =&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard 3 exposes a JSP tag library providing developers more fine grain control over token injection. The library exposes JSP tags that allow access to the token name, the token value, and the token name value pair delimited by an equals (=) sign. In order to make use of the tag library, ensure the Owasp.CsrfGuard.jar file is found within the target application's classpath. For example, the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application places the OWASP CSRFGuard jar file within the WebContent/WEB-INF/lib directory. After placing the library in the classpath, developers can reference the tags in JSP pages using predefined URI reference. The following JSP code snippet imports the tag library and makes it available using the prefix &amp;quot;csrf&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%@ taglib uri=&amp;quot;http://www.owasp.org/index.php/Category:OWASP_CSRFGuard_Project/Owasp.CsrfGuard.tld&amp;quot; prefix=&amp;quot;csrf&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The benefit of using the JSP tag library to inject the CSRF prevention token is the fine grain level of control. Developers can place the token in all the correct locations within the context of their applications. This strategy is useful in application contexts where the JavaScript DOM Manipulation strategy is insufficient.&lt;br /&gt;
&lt;br /&gt;
== Display Token Name ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard token name can be obtained through the token-name tag. The token-name tag is useful when injecting the CSRFGuard token name in a non-query string context. Consider the following code snippet taken from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application. This code makes use of the token-name tag to reference the token name in the name attribute of a hidden input field:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;form name=&amp;quot;test1&amp;quot; action=&amp;quot;protect.html&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; value=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;'''&amp;lt;csrf:token-name/&amp;gt;'''&amp;quot; value=&amp;quot;&amp;lt;csrf:token-value/&amp;gt;&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Display Token Value ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard token value can be obtained through the token-value tag. The token-value tag is useful when injecting the CSRFGuard token value in a non-query string context. Consider the following code snippet taken from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application. This code makes use of the token-value tag to reference the token value in the value attribute of a hidden input field:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;form name=&amp;quot;test1&amp;quot; action=&amp;quot;protect.html&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; value=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;&amp;lt;csrf:token-name/&amp;gt;&amp;quot; value=&amp;quot;'''&amp;lt;csrf:token-value/&amp;gt;'''&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The token value tag must be used in conjunction with the URI attribute when using the unique token per page model (org.owasp.csrfguard.TokenPerPage). The value of the uri attribute is the URI for which the token value will be posted. Consider the following example which sets the URI to the destination of the form, &amp;quot;protect.html&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;form id=&amp;quot;formTest1&amp;quot; name=&amp;quot;formTest1&amp;quot; action=&amp;quot;protect.html&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; value=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;&amp;lt;csrf:token-name/&amp;gt;&amp;quot; value=&amp;quot;&amp;lt;csrf:token-value uri=&amp;quot;protect.html&amp;quot;/&amp;gt;&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Display Token Name Value Pair ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard token name value pair, delimited by an equals sign (=), can be obtained though the token tag. The token tag is useful when injecting the CSRFGuard token value in a query string context. Consider the following code snippet taken from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application. This code makes use of the token tag to reference the token name value pair in the href attribute of an anchor tag:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;a href=&amp;quot;protect.html?&amp;lt;csrf:token/&amp;gt;&amp;quot;&amp;gt;protect.html&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The token name value pair tag must be used in conjunction with the URI attribute when using the unique token per page model (org.owasp.csrfguard.TokenPerPage). The value of the uri attribute is the URI for which the token value will be posted. Consider the following example which sets the URI to the destination of the link, &amp;quot;protect.html&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;a href=&amp;quot;protect.html?&amp;lt;csrf:token uri=&amp;quot;protect.html&amp;quot;/&amp;gt;&amp;quot;&amp;gt;protect.html&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Generate Form with Prevention Token ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard JSP library implements a tag library designed specifically to generate HTML forms with the CSRF prevention token automatically embedded as a hidden field. This strategy simplifies the integration of the CSRF token, especially when using the unique token per page model (org.owasp.csrfguard.TokenPerPage). The tag accepts dynamic attribute name value pairs and simply outputs them to the page. As a result, you are free to use the same attribute values made available in a standard HTML form. There is no special output encoding performed on these dynamic attributes. Take care to perform the appropriate validation and output encoding for all dynamic attributes used in conjunction with untrusted data. Consider the following code snippet which will produce a HTML form with an embedded CSRF token. No special care must be taken when using this flag in conjunction with the unique token per uri model:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;csrf:form id=&amp;quot;formTest2&amp;quot; name=&amp;quot;formTest2&amp;quot; action=&amp;quot;protect.html&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; value=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/csrf:form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Generate Link with Prevention Token ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard JSP library implements a tag library designed specifically to generate HTML anchor tags with the CSRF prevention token automatically embedded as a query string parameter. This strategy simplifies the integration of the CSRF token, especially when using the unique token per page model (org.owasp.csrfguard.TokenPerPage). The tag accepts dynamic attribute name value pairs and simply outputs them to the page. As a result, you are free to use the same attribute values made available in a standard HTML anchor. There is no special output encoding performed on these dynamic attributes. Take care to perform the appropriate validation and output encoding for all dynamic attributes used in conjunction with untrusted data. Consider the following code snippet which will produce a HTML anchor tag with an embedded CSRF token. No special care must be taken when using this flag in conjunction with the unique token per uri model:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;csrf:a href=&amp;quot;protect.html&amp;quot;&amp;gt;protect.html&amp;lt;/csrf:a&amp;gt;&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CSRFGuard_3_Configuration&amp;diff=97612</id>
		<title>CSRFGuard 3 Configuration</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CSRFGuard_3_Configuration&amp;diff=97612"/>
				<updated>2010-12-22T22:32:00Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* New Token Landing Page */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
The most important aspect of deploying OWASP CSRFGuard is configuration of the Owasp.CsrfGuard.properties file. There are a minimum number of configuration settings that users should review and specify before running an instance of OWASP CSRFGuard. Such configurations include specifying the new token landing page, enabling Ajax support for applications making use of XMLHttpRequest, capturing pages that should not be protected, as well as configuring one or more actions that should be invoked when a CSRF attack is identified. The purpose of this article is to provide an overview of key OWASP CSRFGuard configuration settings.&lt;br /&gt;
&lt;br /&gt;
= Logger =&lt;br /&gt;
&lt;br /&gt;
The logger property (org.owasp.csrfguard.Logger) defines the qualified class name of the object responsible for processing all log messages produced by CSRFGuard. The default CSRFGuard logger is org.owasp.csrfguard.log.ConsoleLogger. This class logs all messages to System.out which JavaEE application servers redirect to a vendor specific log file. Developers can customize the logging behavior of CSRFGuard by implementing the org.owasp.csrfguard.log.ILogger interface and setting the logger property to the new logger's qualified class name. The following configuration snippet instructs OWASP CSRFGuard to capture all log messages to the console:&lt;br /&gt;
&lt;br /&gt;
 org.owasp.csrfguard.Logger=org.owasp.csrfguard.log.ConsoleLogger&lt;br /&gt;
&lt;br /&gt;
= New Token Landing Page =&lt;br /&gt;
&lt;br /&gt;
The new token landing page property (org.owasp.csrfguard.NewTokenLandingPage) defines where to send a user if the token is being generated for the first time. This request is generated using auto-posting forms and will only contain the CSRF prevention token parameter, if applicable. All query-string or form parameters sent with the original request will be discarded. If this property is not defined, CSRFGuard will instead auto-post the user to the originally requested URI. The following configuration snippet instructs OWASP CSRFGuard to redirect the user to /Owasp.CsrfGuard.Test/index.html when the user visits a protected resource without having a corresponding CSRF token present in the HttpSession object:&lt;br /&gt;
&lt;br /&gt;
 org.owasp.csrfguard.NewTokenLandingPage=/Owasp.CsrfGuard.Test/index.html&lt;br /&gt;
&lt;br /&gt;
= Unique Token Per Page =&lt;br /&gt;
&lt;br /&gt;
The unique token per-page property (org.owasp.csrfguard.TokenPerPage) is a boolean value that determines if CSRFGuard should make use of unique per-page (i.e. URI) prevention tokens as opposed to unique per-session prevention tokens. When a user requests a protected resource, CSRFGuard will determine if a page specific token has been previously generated. If a page specific token has not yet been previously generated, CSRFGuard will verify the request was submitted with the per-session token intact. After verifying the presence of the per-session token, CSRFGuard will create a page specific token that is required for all subsequent requests to the associated resource. The per-session CSRF token can only be used when requesting a resource for the first time. All subsequent requests must have the per-page token intact or the request will be treated as a CSRF attack. Use of the unique token per page property is currently experimental but provides a significant amount of improved security. Consider the exposure of a CSRF token using the legacy unique per-session model. Exposure of this token facilitates the attacker's ability to carry out a CSRF attack against the victim's active session for any resource exposed by the web application. Now consider the exposure of a CSRF token using the experimental unique token per-page model. Exposure of this token would only allow the attacker to carry out a CSRF attack against the victim's active session for a small subset of resources exposed by the web application. Use of the unique token per-page property is a strong defense in depth strategy significantly reducing the impact of exposed CSRF prevention tokens. The following configuration snippet instructs OWASP CSRFGuard to utilize the unique token per-page model:&lt;br /&gt;
&lt;br /&gt;
 org.owasp.csrfguard.TokenPerPage=true&lt;br /&gt;
&lt;br /&gt;
= Token Rotation =&lt;br /&gt;
&lt;br /&gt;
The rotate token property (org.owasp.csrfguard.Rotate) is a boolean value that determines if CSRFGuard should generate and utilize a new token after verifying the previous token. Rotation helps minimize the window of opportunity an attacker has to leverage the victim's stolen token in a targeted CSRF attack. However, this functionality generally causes navigation problems in most applications. Specifically, the 'Back' button in the browser will often cease to function properly. When a user hits the 'Back' button and interacts with the HTML, the browser may submit an old token causing CSRFGuard to incorrectly believe this request is a CSRF attack in progress (i.e. a 'false positive'). Users can prevent this scenario by preventing the caching of HTML pages containing FORM submissions using the cache-control header. However, this may also introduce performance problems as the browser will have to request HTML on a more frequent basis. The following configuration snippet disables token rotation:&lt;br /&gt;
 org.owasp.csrfguard.Rotate=false&lt;br /&gt;
&lt;br /&gt;
= Ajax and XMLHttpRequest Support =&lt;br /&gt;
&lt;br /&gt;
The Ajax property (org.owasp.csrfguard.Ajax) is a boolean value that indicates whether or not OWASP CSRFGuard should support the injection and verification of unique per-session prevention tokens for XMLHttpRequests. To leverage Ajax support, the user must not only set this property to true but must also reference the [[CSRFGuard_3_Token_Injection#JavaScript_DOM_Manipulation | JavaScript DOM Manipulation]] code using a script element. This dynamic script will override the send method of the XMLHttpRequest object to ensure the submission of an X-Requested-With header name value pair coupled with the submission of a custom header name value pair for each request. The name of the custom header is the value of the token name property and the value of the header is always the unique per-session token value. This custom header is analogous to the HTTP parameter name value pairs submitted via traditional GET and POST requests. If the X-Requested-With header was sent in the HTTP request, then CSRFGuard will look for the presence and ensure the validity of the unique per-session token in the custom header name value pair. Note that verification of these headers takes precedence over verification of the CSRF token supplied as an HTTP parameter. More specifically, CSRFGuard does not verify the presence of the CSRF token if the Ajax support property is enabled and the corresponding X-Requested-With and custom headers are embedded within the request. The following configuration snippet instructs OWASP CSRFGuard to support Ajax requests by verifying the presence and correctness of the X-Requested-With and custom headers:&lt;br /&gt;
&lt;br /&gt;
 org.owasp.csrfguard.Ajax=true&lt;br /&gt;
&lt;br /&gt;
= Unprotected Pages =&lt;br /&gt;
&lt;br /&gt;
The unprotected pages property (org.owasp.csrfguard.unprotected.*) defines a series of pages that should not be protected by CSRFGuard. Such configurations are useful when the CsrfGuardFilter is aggressively mapped (ex: /*). The syntax of the property name is org.owasp.csrfguard.unprotected.[PageName], where PageName is some arbitrary identifier that can be used to reference a resource. The syntax of defining the uri of unprotected pages is the same as the syntax used by the JavaEE container for uri mapping. Specifically, CSRFGuard will identify the first match (if any) between the requested uri and an unprotected page in order of declaration. Match criteria is as follows:&lt;br /&gt;
&lt;br /&gt;
:Case 1: exact match between request uri and unprotected page&lt;br /&gt;
:Case 2: longest path prefix match, beginning / and ending /*&lt;br /&gt;
:Case 3: extension match, beginning *.&lt;br /&gt;
:Default: requested resource must be validated by CSRFGuard&lt;br /&gt;
&lt;br /&gt;
The following code snippet illustrates the three use cases over four examples. The first two examples (Tag and JavaScriptServlet) look for direct URI matches. The third example (Html) looks for all resources ending in a .html extension. The last example (Public) looks for all resources prefixed with the URI path /MySite/Public/*.&lt;br /&gt;
&lt;br /&gt;
 org.owasp.csrfguard.unprotected.Tag=/Owasp.CsrfGuard.Test/tag.jsp&lt;br /&gt;
 org.owasp.csrfguard.unprotected.JavaScriptServlet=/Owasp.CsrfGuard.Test/JavaScriptServlet&lt;br /&gt;
 org.owasp.csrfguard.unprotected.Html=*.html&lt;br /&gt;
 org.owasp.csrfguard.unprotected.Public=/MySite/Public/*&lt;br /&gt;
&lt;br /&gt;
= Actions: Responding to Attacks =&lt;br /&gt;
&lt;br /&gt;
The actions directive (org.owasp.csrfguard.action.*) gives the user the ability to specify one or more actions that should be invoked when a CSRF attack is detected. Every action must implement the org.owasp.csrfguard.action.IAction interface either directly or indirectly through the org.owasp.csrfguard.action.AbstractAction helper class. Many actions accept parameters that can be specified along with the action class declaration. These parameters are consumed at runtime and impact the behavior of the associated action.&lt;br /&gt;
&lt;br /&gt;
The syntax for defining and configuring CSRFGuard actions is relatively straight forward. Let us assume we wish to redirect the user to a default page when a CSRF attack is detected. A redirect action already exists within the CSRFGuard bundle and is available via the class name org.owasp.csrfguard.actions.Redirect. In order to enable this action, we capture the following declaration in the Owasp.CsrfGuard.properties file:&lt;br /&gt;
&lt;br /&gt;
 '''syntax:''' org.owasp.csrfguard.action.[actionName]=[className]&lt;br /&gt;
 '''example:''' org.owasp.csrfguard.action.class.Redirect=org.owasp.csrfguard.actions.Redirect&lt;br /&gt;
&lt;br /&gt;
The aforementioned directive declares an action called &amp;quot;Redirect&amp;quot; (i.e. [actionName]) referencing the Java class &amp;quot;org.owasp.csrfguard.actions.Redirect&amp;quot; (i.e. [className]). Anytime a CSRF attack is detected, the Redirect action will be executed. You may be asking yourself, &amp;quot;but how do I specify where the user is redirected?&amp;quot;; this is where action parameters come into play. In order to specify the redirect location, we capture the following declaration in the Owasp.CsrfGuard.properties file:&lt;br /&gt;
&lt;br /&gt;
 '''syntax:''' org.owasp.csrfguard.action.[actionName].[parameterName]=[parameterValue]&lt;br /&gt;
 '''example:''' org.owasp.csrfguard.action.Redirect.ErrorPage=/Owasp.CsrfGuard.Test/error.html&lt;br /&gt;
&lt;br /&gt;
The aforementioned directive declares an action parameter called &amp;quot;ErrorPage&amp;quot; (i.e. [parameterName]) with the value of &amp;quot;/Owasp.CsrfGuard.Test/error.html&amp;quot; (i.e. [parameterValue]) for the action &amp;quot;Redirect&amp;quot; (i.e. [actionName]). The Redirect action expects the &amp;quot;ErrorPage&amp;quot; parameter to be defined and will redirect the user to this location when an attack is detected.&lt;br /&gt;
&lt;br /&gt;
There are several &amp;quot;out of the box&amp;quot; actions made available with the OWASP CSRFGuard distributable. &lt;br /&gt;
&lt;br /&gt;
== org.owasp.csrfguard.action.Log ==&lt;br /&gt;
&lt;br /&gt;
Creates a customized log message whenever a CSRF attack is detected by OWASP CSRFGuard. The log message is captured using the logger mechanism defined by the ''org.owasp.csrfguard.Logger'' directive in the Owasp.CsrfGuard.properties file. Log accepts the following action parameters:&lt;br /&gt;
&lt;br /&gt;
'''org.owasp.csrfguard.action.Log.Message'''&lt;br /&gt;
&lt;br /&gt;
Allows the user to define the format of the log message to be recorded. The Message parameter supports several formatting options to aide in the customization of the message to the particular attack. The following formatting options are supported:&lt;br /&gt;
&lt;br /&gt;
 '''%exception%''' - String representation of the CsrfGuardException thrown by the CsrfGuard class.&lt;br /&gt;
 '''%exception_message%''' - Localized exception message of the class CsrfGuardException thrown by the CsrfGuard class.&lt;br /&gt;
 '''%remote_ip%''' - Remote IP address of the client that sent the CSRF attack to the server.&lt;br /&gt;
 '''%remote_host%''' - Remote host name of the client that sent the CSRF attack to the server.&lt;br /&gt;
 '''%remote_port%''' - Remote port of the client that sent the CSRF attack to the server.&lt;br /&gt;
 '''%local_ip%''' - Local IP address of the server that detected the CSRF attack.&lt;br /&gt;
 '''%local_host%''' - Local host name of the server that detected the CSRF attack.&lt;br /&gt;
 '''%local_port%''' - Local port of the server that detected the CSRF attack.&lt;br /&gt;
 '''%request_uri%''' - Request URI for which the CSRF attack was targeting.&lt;br /&gt;
 '''%request_url%''' - Request URL for which the CSRF attack was targeting.&lt;br /&gt;
 '''%user%''' - User information as made available by the javax.servlet.http.HttpServletRequest.getRemoteUser() method invocation.&lt;br /&gt;
&lt;br /&gt;
== org.owasp.csrfguard.action.Invalidate ==&lt;br /&gt;
&lt;br /&gt;
Invalidate any existing HttpSession associated with the current HttpServletRequest. Note that this is the session of the victim for which the CSRF attack was targeting. Invalidating the JavaEE container's session generally results in the user having to re-authenticate. There are no parameters associated with this action.&lt;br /&gt;
&lt;br /&gt;
== org.owasp.csrfguard.action.Redirect ==&lt;br /&gt;
&lt;br /&gt;
Redirects the user to the URI specified in the Page action parameter. Attempting to utilize this action in combination with Forward will generally result in the JavaEE container throwing IllegalStateException. The action accepts the following action parameters:&lt;br /&gt;
&lt;br /&gt;
'''org.owasp.csrfguard.action.Redirect.Page'''&lt;br /&gt;
&lt;br /&gt;
Defines the URI for which the user is redirected when a CSRF attack is detected.&lt;br /&gt;
&lt;br /&gt;
== org.owasp.csrfguard.action.Forward ==&lt;br /&gt;
&lt;br /&gt;
Forwards the user to the URI specified in the Page action parameter. Attempting to utilize this action in combination with Redirect will generally result in the JavaEE container throwing IllegalStateException. The action accepts the following action parameters:&lt;br /&gt;
&lt;br /&gt;
'''org.owasp.csrfguard.action.Forward.Page'''&lt;br /&gt;
&lt;br /&gt;
Defines the URI for which the user is forwarded when a CSRF attack is detected.&lt;br /&gt;
&lt;br /&gt;
== org.owasp.csrfguard.action.RequestAttribute ==&lt;br /&gt;
&lt;br /&gt;
Makes the CsrfGuardException thrown by the CsrfGuard class when an attack is detected programmatically available as an attribute in the HttpServletRequest object. The action accepts the following action parameters:&lt;br /&gt;
&lt;br /&gt;
'''org.owasp.csrfguard.action.RequestAttribute.AttributeName'''&lt;br /&gt;
&lt;br /&gt;
Defines the attribute name that should be used when placing the CsrfGuardException in the HttpServletRequest attributes collection.&lt;br /&gt;
&lt;br /&gt;
== org.owasp.csrfguard.action.SessionAttribute ==&lt;br /&gt;
&lt;br /&gt;
Makes the CsrfGuardException thrown by the CsrfGuard class when an attack is detected programmatically available as an attribute in the HttpSession object. The action accepts the following action parameters:&lt;br /&gt;
&lt;br /&gt;
'''org.owasp.csrfguard.action.SessionAttribute.AttributeName'''&lt;br /&gt;
&lt;br /&gt;
Defines the attribute name that should be used when placing the CsrfGuardException in the HttpSession attributes collection.&lt;br /&gt;
&lt;br /&gt;
== org.owasp.csrfguard.action.Rotate ==&lt;br /&gt;
&lt;br /&gt;
Invalidates and re-generates any existing CSRF prevention tokens associated with the current HttpSession. This action helps minimize the risk of a malicious user attempting to brute force a user's prevention tokens through timing based side channel attacks. Note that this action has no effect when used in conjunction with the Invalidate action. There are no parameters associated with this action.&lt;br /&gt;
&lt;br /&gt;
= Miscellaneous Configurations =&lt;br /&gt;
&lt;br /&gt;
== Token Name ==&lt;br /&gt;
&lt;br /&gt;
The token name property (org.owasp.csrfguard.TokenName) defines the name of the HTTP parameter to contain the value of the OWASP CSRFGuard token for each request. The following configuration snippet sets the CSRFGuard token parameter name to the value OWASP_CSRFTOKEN:&lt;br /&gt;
 org.owasp.csrfguard.TokenName=OWASP_CSRFTOKEN&lt;br /&gt;
&lt;br /&gt;
== Session Key ==&lt;br /&gt;
&lt;br /&gt;
The session key property (org.owasp.csrfguard.SessionKey) defines the string literal used to save and lookup the CSRFGuard token from the session. This value is used by the filter and the tag libraries to retrieve and set the token value in the session. Developers can use this key to programmatically lookup the token within their own code. The following configuration snippet sets the session key to the value OWASP_CSRFTOKEN:&lt;br /&gt;
 org.owasp.csrfguard.SessionKey=OWASP_CSRFTOKEN&lt;br /&gt;
&lt;br /&gt;
== Token Length ==&lt;br /&gt;
&lt;br /&gt;
The token length property (org.owasp.csrfguard.TokenLength) defines the number of characters that should be found within the CSRFGuard token. Note that characters are delimited by dashes (-) in groups of four. For cosmetic reasons, users are encourage to ensure the token length is divisible by four. The following configuration snippet sets the token length property to 32 characters:&lt;br /&gt;
 org.owasp.csrfguard.TokenLength=32&lt;br /&gt;
&lt;br /&gt;
== Pseudo-Random Number Generator ==&lt;br /&gt;
&lt;br /&gt;
The pseudo-random number generator property (org.owasp.csrfguard.PRNG) defines what PRNG should be used to generate the OWASP CSRFGuard token. Always ensure this value references a cryptographically strong pseudo-random number generator algorithm. The following configuration snippet sets the pseudo-random number generator to SHA1PRNG:&lt;br /&gt;
 org.owasp.csrfguard.PRNG=SHA1PRNG&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP CSRFGuard Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CSRFGuard_3_Configuration&amp;diff=97514</id>
		<title>CSRFGuard 3 Configuration</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CSRFGuard_3_Configuration&amp;diff=97514"/>
				<updated>2010-12-22T15:22:21Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* org.owasp.csrfguard.action.Log */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
The most important aspect of deploying OWASP CSRFGuard is configuration of the Owasp.CsrfGuard.properties file. There are a minimum number of configuration settings that users should review and specify before running an instance of OWASP CSRFGuard. Such configurations include specifying the new token landing page, enabling Ajax support for applications making use of XMLHttpRequest, capturing pages that should not be protected, as well as configuring one or more actions that should be invoked when a CSRF attack is identified. The purpose of this article is to provide an overview of key OWASP CSRFGuard configuration settings.&lt;br /&gt;
&lt;br /&gt;
= Logger =&lt;br /&gt;
&lt;br /&gt;
The logger property (org.owasp.csrfguard.Logger) defines the qualified class name of the object responsible for processing all log messages produced by CSRFGuard. The default CSRFGuard logger is org.owasp.csrfguard.log.ConsoleLogger. This class logs all messages to System.out which JavaEE application servers redirect to a vendor specific log file. Developers can customize the logging behavior of CSRFGuard by implementing the org.owasp.csrfguard.log.ILogger interface and setting the logger property to the new logger's qualified class name. The following configuration snippet instructs OWASP CSRFGuard to capture all log messages to the console:&lt;br /&gt;
&lt;br /&gt;
 org.owasp.csrfguard.Logger=org.owasp.csrfguard.log.ConsoleLogger&lt;br /&gt;
&lt;br /&gt;
= New Token Landing Page =&lt;br /&gt;
&lt;br /&gt;
The new token landing page property (org.owasp.csrfguard.NewTokenLandingPage) defines where to send a user if the token is being generated for the first time. CSRFGuard will redirect the user to the current page without any parameters if the property is not specified. Preventing the protected application from consuming a request whose session does not yet have a CSRF token through the use of a redirect prevents the execution of a one-time CSRF attack. The following configuration snippet instructs OWASP CSRFGuard to redirect the user to /Owasp.CsrfGuard.Test/index.html when they visit a protected resource without having a corresponding CSRF token present in the HttpSession object:&lt;br /&gt;
&lt;br /&gt;
 org.owasp.csrfguard.NewTokenLandingPage=/Owasp.CsrfGuard.Test/index.html&lt;br /&gt;
&lt;br /&gt;
= Unique Token Per Page =&lt;br /&gt;
&lt;br /&gt;
The unique token per-page property (org.owasp.csrfguard.TokenPerPage) is a boolean value that determines if CSRFGuard should make use of unique per-page (i.e. URI) prevention tokens as opposed to unique per-session prevention tokens. When a user requests a protected resource, CSRFGuard will determine if a page specific token has been previously generated. If a page specific token has not yet been previously generated, CSRFGuard will verify the request was submitted with the per-session token intact. After verifying the presence of the per-session token, CSRFGuard will create a page specific token that is required for all subsequent requests to the associated resource. The per-session CSRF token can only be used when requesting a resource for the first time. All subsequent requests must have the per-page token intact or the request will be treated as a CSRF attack. Use of the unique token per page property is currently experimental but provides a significant amount of improved security. Consider the exposure of a CSRF token using the legacy unique per-session model. Exposure of this token facilitates the attacker's ability to carry out a CSRF attack against the victim's active session for any resource exposed by the web application. Now consider the exposure of a CSRF token using the experimental unique token per-page model. Exposure of this token would only allow the attacker to carry out a CSRF attack against the victim's active session for a small subset of resources exposed by the web application. Use of the unique token per-page property is a strong defense in depth strategy significantly reducing the impact of exposed CSRF prevention tokens. The following configuration snippet instructs OWASP CSRFGuard to utilize the unique token per-page model:&lt;br /&gt;
&lt;br /&gt;
 org.owasp.csrfguard.TokenPerPage=true&lt;br /&gt;
&lt;br /&gt;
= Token Rotation =&lt;br /&gt;
&lt;br /&gt;
The rotate token property (org.owasp.csrfguard.Rotate) is a boolean value that determines if CSRFGuard should generate and utilize a new token after verifying the previous token. Rotation helps minimize the window of opportunity an attacker has to leverage the victim's stolen token in a targeted CSRF attack. However, this functionality generally causes navigation problems in most applications. Specifically, the 'Back' button in the browser will often cease to function properly. When a user hits the 'Back' button and interacts with the HTML, the browser may submit an old token causing CSRFGuard to incorrectly believe this request is a CSRF attack in progress (i.e. a 'false positive'). Users can prevent this scenario by preventing the caching of HTML pages containing FORM submissions using the cache-control header. However, this may also introduce performance problems as the browser will have to request HTML on a more frequent basis. The following configuration snippet disables token rotation:&lt;br /&gt;
 org.owasp.csrfguard.Rotate=false&lt;br /&gt;
&lt;br /&gt;
= Ajax and XMLHttpRequest Support =&lt;br /&gt;
&lt;br /&gt;
The Ajax property (org.owasp.csrfguard.Ajax) is a boolean value that indicates whether or not OWASP CSRFGuard should support the injection and verification of unique per-session prevention tokens for XMLHttpRequests. To leverage Ajax support, the user must not only set this property to true but must also reference the [[CSRFGuard_3_Token_Injection#JavaScript_DOM_Manipulation | JavaScript DOM Manipulation]] code using a script element. This dynamic script will override the send method of the XMLHttpRequest object to ensure the submission of an X-Requested-With header name value pair coupled with the submission of a custom header name value pair for each request. The name of the custom header is the value of the token name property and the value of the header is always the unique per-session token value. This custom header is analogous to the HTTP parameter name value pairs submitted via traditional GET and POST requests. If the X-Requested-With header was sent in the HTTP request, then CSRFGuard will look for the presence and ensure the validity of the unique per-session token in the custom header name value pair. Note that verification of these headers takes precedence over verification of the CSRF token supplied as an HTTP parameter. More specifically, CSRFGuard does not verify the presence of the CSRF token if the Ajax support property is enabled and the corresponding X-Requested-With and custom headers are embedded within the request. The following configuration snippet instructs OWASP CSRFGuard to support Ajax requests by verifying the presence and correctness of the X-Requested-With and custom headers:&lt;br /&gt;
&lt;br /&gt;
 org.owasp.csrfguard.Ajax=true&lt;br /&gt;
&lt;br /&gt;
= Unprotected Pages =&lt;br /&gt;
&lt;br /&gt;
The unprotected pages property (org.owasp.csrfguard.unprotected.*) defines a series of pages that should not be protected by CSRFGuard. Such configurations are useful when the CsrfGuardFilter is aggressively mapped (ex: /*). The syntax of the property name is org.owasp.csrfguard.unprotected.[PageName], where PageName is some arbitrary identifier that can be used to reference a resource. The syntax of defining the uri of unprotected pages is the same as the syntax used by the JavaEE container for uri mapping. Specifically, CSRFGuard will identify the first match (if any) between the requested uri and an unprotected page in order of declaration. Match criteria is as follows:&lt;br /&gt;
&lt;br /&gt;
:Case 1: exact match between request uri and unprotected page&lt;br /&gt;
:Case 2: longest path prefix match, beginning / and ending /*&lt;br /&gt;
:Case 3: extension match, beginning *.&lt;br /&gt;
:Default: requested resource must be validated by CSRFGuard&lt;br /&gt;
&lt;br /&gt;
The following code snippet illustrates the three use cases over four examples. The first two examples (Tag and JavaScriptServlet) look for direct URI matches. The third example (Html) looks for all resources ending in a .html extension. The last example (Public) looks for all resources prefixed with the URI path /MySite/Public/*.&lt;br /&gt;
&lt;br /&gt;
 org.owasp.csrfguard.unprotected.Tag=/Owasp.CsrfGuard.Test/tag.jsp&lt;br /&gt;
 org.owasp.csrfguard.unprotected.JavaScriptServlet=/Owasp.CsrfGuard.Test/JavaScriptServlet&lt;br /&gt;
 org.owasp.csrfguard.unprotected.Html=*.html&lt;br /&gt;
 org.owasp.csrfguard.unprotected.Public=/MySite/Public/*&lt;br /&gt;
&lt;br /&gt;
= Actions: Responding to Attacks =&lt;br /&gt;
&lt;br /&gt;
The actions directive (org.owasp.csrfguard.action.*) gives the user the ability to specify one or more actions that should be invoked when a CSRF attack is detected. Every action must implement the org.owasp.csrfguard.action.IAction interface either directly or indirectly through the org.owasp.csrfguard.action.AbstractAction helper class. Many actions accept parameters that can be specified along with the action class declaration. These parameters are consumed at runtime and impact the behavior of the associated action.&lt;br /&gt;
&lt;br /&gt;
The syntax for defining and configuring CSRFGuard actions is relatively straight forward. Let us assume we wish to redirect the user to a default page when a CSRF attack is detected. A redirect action already exists within the CSRFGuard bundle and is available via the class name org.owasp.csrfguard.actions.Redirect. In order to enable this action, we capture the following declaration in the Owasp.CsrfGuard.properties file:&lt;br /&gt;
&lt;br /&gt;
 '''syntax:''' org.owasp.csrfguard.action.[actionName]=[className]&lt;br /&gt;
 '''example:''' org.owasp.csrfguard.action.class.Redirect=org.owasp.csrfguard.actions.Redirect&lt;br /&gt;
&lt;br /&gt;
The aforementioned directive declares an action called &amp;quot;Redirect&amp;quot; (i.e. [actionName]) referencing the Java class &amp;quot;org.owasp.csrfguard.actions.Redirect&amp;quot; (i.e. [className]). Anytime a CSRF attack is detected, the Redirect action will be executed. You may be asking yourself, &amp;quot;but how do I specify where the user is redirected?&amp;quot;; this is where action parameters come into play. In order to specify the redirect location, we capture the following declaration in the Owasp.CsrfGuard.properties file:&lt;br /&gt;
&lt;br /&gt;
 '''syntax:''' org.owasp.csrfguard.action.[actionName].[parameterName]=[parameterValue]&lt;br /&gt;
 '''example:''' org.owasp.csrfguard.action.Redirect.ErrorPage=/Owasp.CsrfGuard.Test/error.html&lt;br /&gt;
&lt;br /&gt;
The aforementioned directive declares an action parameter called &amp;quot;ErrorPage&amp;quot; (i.e. [parameterName]) with the value of &amp;quot;/Owasp.CsrfGuard.Test/error.html&amp;quot; (i.e. [parameterValue]) for the action &amp;quot;Redirect&amp;quot; (i.e. [actionName]). The Redirect action expects the &amp;quot;ErrorPage&amp;quot; parameter to be defined and will redirect the user to this location when an attack is detected.&lt;br /&gt;
&lt;br /&gt;
There are several &amp;quot;out of the box&amp;quot; actions made available with the OWASP CSRFGuard distributable. &lt;br /&gt;
&lt;br /&gt;
== org.owasp.csrfguard.action.Log ==&lt;br /&gt;
&lt;br /&gt;
Creates a customized log message whenever a CSRF attack is detected by OWASP CSRFGuard. The log message is captured using the logger mechanism defined by the ''org.owasp.csrfguard.Logger'' directive in the Owasp.CsrfGuard.properties file. Log accepts the following action parameters:&lt;br /&gt;
&lt;br /&gt;
'''org.owasp.csrfguard.action.Log.Message'''&lt;br /&gt;
&lt;br /&gt;
Allows the user to define the format of the log message to be recorded. The Message parameter supports several formatting options to aide in the customization of the message to the particular attack. The following formatting options are supported:&lt;br /&gt;
&lt;br /&gt;
 '''%exception%''' - String representation of the CsrfGuardException thrown by the CsrfGuard class.&lt;br /&gt;
 '''%exception_message%''' - Localized exception message of the class CsrfGuardException thrown by the CsrfGuard class.&lt;br /&gt;
 '''%remote_ip%''' - Remote IP address of the client that sent the CSRF attack to the server.&lt;br /&gt;
 '''%remote_host%''' - Remote host name of the client that sent the CSRF attack to the server.&lt;br /&gt;
 '''%remote_port%''' - Remote port of the client that sent the CSRF attack to the server.&lt;br /&gt;
 '''%local_ip%''' - Local IP address of the server that detected the CSRF attack.&lt;br /&gt;
 '''%local_host%''' - Local host name of the server that detected the CSRF attack.&lt;br /&gt;
 '''%local_port%''' - Local port of the server that detected the CSRF attack.&lt;br /&gt;
 '''%request_uri%''' - Request URI for which the CSRF attack was targeting.&lt;br /&gt;
 '''%request_url%''' - Request URL for which the CSRF attack was targeting.&lt;br /&gt;
 '''%user%''' - User information as made available by the javax.servlet.http.HttpServletRequest.getRemoteUser() method invocation.&lt;br /&gt;
&lt;br /&gt;
== org.owasp.csrfguard.action.Invalidate ==&lt;br /&gt;
&lt;br /&gt;
Invalidate any existing HttpSession associated with the current HttpServletRequest. Note that this is the session of the victim for which the CSRF attack was targeting. Invalidating the JavaEE container's session generally results in the user having to re-authenticate. There are no parameters associated with this action.&lt;br /&gt;
&lt;br /&gt;
== org.owasp.csrfguard.action.Redirect ==&lt;br /&gt;
&lt;br /&gt;
Redirects the user to the URI specified in the Page action parameter. Attempting to utilize this action in combination with Forward will generally result in the JavaEE container throwing IllegalStateException. The action accepts the following action parameters:&lt;br /&gt;
&lt;br /&gt;
'''org.owasp.csrfguard.action.Redirect.Page'''&lt;br /&gt;
&lt;br /&gt;
Defines the URI for which the user is redirected when a CSRF attack is detected.&lt;br /&gt;
&lt;br /&gt;
== org.owasp.csrfguard.action.Forward ==&lt;br /&gt;
&lt;br /&gt;
Forwards the user to the URI specified in the Page action parameter. Attempting to utilize this action in combination with Redirect will generally result in the JavaEE container throwing IllegalStateException. The action accepts the following action parameters:&lt;br /&gt;
&lt;br /&gt;
'''org.owasp.csrfguard.action.Forward.Page'''&lt;br /&gt;
&lt;br /&gt;
Defines the URI for which the user is forwarded when a CSRF attack is detected.&lt;br /&gt;
&lt;br /&gt;
== org.owasp.csrfguard.action.RequestAttribute ==&lt;br /&gt;
&lt;br /&gt;
Makes the CsrfGuardException thrown by the CsrfGuard class when an attack is detected programmatically available as an attribute in the HttpServletRequest object. The action accepts the following action parameters:&lt;br /&gt;
&lt;br /&gt;
'''org.owasp.csrfguard.action.RequestAttribute.AttributeName'''&lt;br /&gt;
&lt;br /&gt;
Defines the attribute name that should be used when placing the CsrfGuardException in the HttpServletRequest attributes collection.&lt;br /&gt;
&lt;br /&gt;
== org.owasp.csrfguard.action.SessionAttribute ==&lt;br /&gt;
&lt;br /&gt;
Makes the CsrfGuardException thrown by the CsrfGuard class when an attack is detected programmatically available as an attribute in the HttpSession object. The action accepts the following action parameters:&lt;br /&gt;
&lt;br /&gt;
'''org.owasp.csrfguard.action.SessionAttribute.AttributeName'''&lt;br /&gt;
&lt;br /&gt;
Defines the attribute name that should be used when placing the CsrfGuardException in the HttpSession attributes collection.&lt;br /&gt;
&lt;br /&gt;
== org.owasp.csrfguard.action.Rotate ==&lt;br /&gt;
&lt;br /&gt;
Invalidates and re-generates any existing CSRF prevention tokens associated with the current HttpSession. This action helps minimize the risk of a malicious user attempting to brute force a user's prevention tokens through timing based side channel attacks. Note that this action has no effect when used in conjunction with the Invalidate action. There are no parameters associated with this action.&lt;br /&gt;
&lt;br /&gt;
= Miscellaneous Configurations =&lt;br /&gt;
&lt;br /&gt;
== Token Name ==&lt;br /&gt;
&lt;br /&gt;
The token name property (org.owasp.csrfguard.TokenName) defines the name of the HTTP parameter to contain the value of the OWASP CSRFGuard token for each request. The following configuration snippet sets the CSRFGuard token parameter name to the value OWASP_CSRFTOKEN:&lt;br /&gt;
 org.owasp.csrfguard.TokenName=OWASP_CSRFTOKEN&lt;br /&gt;
&lt;br /&gt;
== Session Key ==&lt;br /&gt;
&lt;br /&gt;
The session key property (org.owasp.csrfguard.SessionKey) defines the string literal used to save and lookup the CSRFGuard token from the session. This value is used by the filter and the tag libraries to retrieve and set the token value in the session. Developers can use this key to programmatically lookup the token within their own code. The following configuration snippet sets the session key to the value OWASP_CSRFTOKEN:&lt;br /&gt;
 org.owasp.csrfguard.SessionKey=OWASP_CSRFTOKEN&lt;br /&gt;
&lt;br /&gt;
== Token Length ==&lt;br /&gt;
&lt;br /&gt;
The token length property (org.owasp.csrfguard.TokenLength) defines the number of characters that should be found within the CSRFGuard token. Note that characters are delimited by dashes (-) in groups of four. For cosmetic reasons, users are encourage to ensure the token length is divisible by four. The following configuration snippet sets the token length property to 32 characters:&lt;br /&gt;
 org.owasp.csrfguard.TokenLength=32&lt;br /&gt;
&lt;br /&gt;
== Pseudo-Random Number Generator ==&lt;br /&gt;
&lt;br /&gt;
The pseudo-random number generator property (org.owasp.csrfguard.PRNG) defines what PRNG should be used to generate the OWASP CSRFGuard token. Always ensure this value references a cryptographically strong pseudo-random number generator algorithm. The following configuration snippet sets the pseudo-random number generator to SHA1PRNG:&lt;br /&gt;
 org.owasp.csrfguard.PRNG=SHA1PRNG&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP CSRFGuard Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CSRFGuard_3_Token_Injection&amp;diff=96889</id>
		<title>CSRFGuard 3 Token Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CSRFGuard_3_Token_Injection&amp;diff=96889"/>
				<updated>2010-12-18T18:30:59Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Declare and Configure JavaScriptServlet */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard implements a variant of the synchronizer token pattern to mitigate the risk of CSRF attacks. In order to implement this pattern, CSRFGuard must offer the capability to place the CSRF prevention token within the HTML produced by the protected web application. CSRFGuard 3 provides developers more fine grain control over the injection of the token. Developers can inject the token in their HTML using either dynamic JavaScript DOM manipulation or a JSP tag library. CSRFGuard no longer intercepts and modifies the HttpServletResponse object as was done in previous releases. The currently available token injection strategies are designed to make the integration of CSRFGuard more feasible and scalable within current enterprise web applications. Developers are encouraged to make use of both the JavaScript DOM Manipulation and the JSP tag library strategies for a complete token injection strategy. The JavaScript DOM Manipulation strategy is ideal as it is automated and requires minimal effort on behalf of the developer. In the event the JavaScript solution is insufficient within a particular application context, developers should leverage the JSP tag library. The purpose of this article is to describe the token injection strategies offered by OWASP CSRFGuard 3.&lt;br /&gt;
&lt;br /&gt;
= JavaScript DOM Manipulation =&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard 3 supports the ability to dynamically inject CSRF prevention tokens throughout the DOM currently loaded in the user's browser. This strategy is extremely valuable with regards to server-side performance as it simply requires the serving of a dynamic JavaScript file. There is little to no performance hit when the fetched dynamic JavaScript updates the browser's DOM. Making use of the JavaScript token injection solution requires the developer map a Servlet and place a JavaScript HTML tag within all pages sending requests to protected application resources. Developers are strongly encouraged to leverage the JavaScript token injection strategy by default. This strategy requires minimal effort on behalf of the developer as most of the token injection logic is automated. In the event that the JavaScript automated solution may be insufficient for a specific application context, developers should leverage the OWASP CSRFGuard JSP tag library.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Use of JavaScript DOM Manipulation is required for Ajax support.&lt;br /&gt;
&lt;br /&gt;
== Declare and Configure JavaScriptServlet ==&lt;br /&gt;
&lt;br /&gt;
The JavaScript file used for token injection is dynamically generated by the JavaScriptServlet class using a template file. Ensure that the Owasp.CsrfGuard.jar file is found within the target application's classpath. Copy the Owasp.CsrfGuard.js template file from the OWASP CSRFGuard distribution folder to a non-publicly accessible directory within the target application. For the remainder of this section, we assume the Owasp.CsrfGuard.js template file was placed in the application's WEB-INF folder. Edit the deployment descriptor (web.xml) to declare the JavaScriptServlet class along with any associated initialization parameters. Consider the following configuration snippet taken from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;servlet&amp;gt;&lt;br /&gt;
      &amp;lt;servlet-name&amp;gt;JavaScriptServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;
      &amp;lt;servlet-class&amp;gt;org.owasp.csrfguard.servlet.JavaScriptServlet&amp;lt;/servlet-class&amp;gt;&lt;br /&gt;
      &amp;lt;init-param&amp;gt;&lt;br /&gt;
           &amp;lt;param-name&amp;gt;source-file&amp;lt;/param-name&amp;gt;&lt;br /&gt;
           &amp;lt;param-value&amp;gt;WEB-INF/Owasp.CsrfGuard.js&amp;lt;/param-value&amp;gt;&lt;br /&gt;
      &amp;lt;/init-param&amp;gt;&lt;br /&gt;
      &amp;lt;init-param&amp;gt;&lt;br /&gt;
           &amp;lt;param-name&amp;gt;inject-into-forms&amp;lt;/param-name&amp;gt;&lt;br /&gt;
           &amp;lt;param-value&amp;gt;true&amp;lt;/param-value&amp;gt;&lt;br /&gt;
      &amp;lt;/init-param&amp;gt;&lt;br /&gt;
      &amp;lt;init-param&amp;gt;&lt;br /&gt;
           &amp;lt;param-name&amp;gt;inject-into-attributes&amp;lt;/param-name&amp;gt;&lt;br /&gt;
           &amp;lt;param-value&amp;gt;true&amp;lt;/param-value&amp;gt;&lt;br /&gt;
      &amp;lt;/init-param&amp;gt;&lt;br /&gt;
     &amp;lt;init-param&amp;gt;&lt;br /&gt;
           &amp;lt;param-name&amp;gt;domain-strict&amp;lt;/param-name&amp;gt;&lt;br /&gt;
           &amp;lt;param-value&amp;gt;false&amp;lt;/param-value&amp;gt;&lt;br /&gt;
     &amp;lt;/init-param&amp;gt;&lt;br /&gt;
 &amp;lt;/servlet&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The aforementioned configuration snippet declares the JavaScriptServlet class using the name &amp;quot;JavaScriptServlet&amp;quot;. JavaScriptServlet accepts various initialization parameters augmenting the behavior of the class at runtime. The provided configuration snippet instructs JavaScriptServlet to...&lt;br /&gt;
&lt;br /&gt;
#Leverage the template JavaScript file at WEB-INF/Owasp.CsrfGuard.js&lt;br /&gt;
#Inject the token into all HTML forms&lt;br /&gt;
#Inject the token into all src and href attributes&lt;br /&gt;
#Leverage loose same origin matching criteria when placing the token in URL resources&lt;br /&gt;
&lt;br /&gt;
Consider the following for a more detailed listing of the initialization parameters supported by JavaScriptServlet:&lt;br /&gt;
&lt;br /&gt;
 source-file&lt;br /&gt;
&lt;br /&gt;
Denotes the location of the JavaScript template file that should be consumed and dynamically augmented by the JavaScriptServlet class. The default value is WEB-INF/Owasp.CsrfGuard.js. Use of this property and the existence of the specified template file is required. &lt;br /&gt;
&lt;br /&gt;
 domain-strict&lt;br /&gt;
&lt;br /&gt;
Boolean value that determines whether or not the dynamic JavaScript code should be strict with regards to what links it should inject the CSRF prevention token. With a value of true, the JavaScript code will only place the token in links that point to the same exact domain from which the HTML originated. With a value of false, the JavaScript code will place the token in links that not only point to the same exact domain from which the HTML originated, but sub-domains as well.&lt;br /&gt;
&lt;br /&gt;
 referer-pattern&lt;br /&gt;
&lt;br /&gt;
Allows the developer to specify a regular expression describing the required value of the Referer header. Any attempts to access the servlet with a Referer header that does not match the captured expression is discarded. Inclusion of referer header checking is to help minimize the risk of JavaScript Hijacking attacks that attempt to steal tokens from the dynamically generated JavaScript. While the primary defenses against JavaScript Hijacking attacks are implemented within the dynamic JavaScript itself, referer header checking is implemented to achieve defense in depth.&lt;br /&gt;
&lt;br /&gt;
 cache-control&lt;br /&gt;
&lt;br /&gt;
Allows the developer to specify the value of the Cache-Control header in the HTTP response when serving the dynamic JavaScript file. The default value is private, maxage=28800. Caching of the dynamic JavaScript file is intended to minimize traffic and improve performance. Note that the Cache-Control header is always set to &amp;quot;no-store&amp;quot; when either the &amp;quot;Rotate&amp;quot; &amp;quot;TokenPerPage&amp;quot; options is set to true in Owasp.CsrfGuard.properties.&lt;br /&gt;
&lt;br /&gt;
 inject-into-forms&lt;br /&gt;
&lt;br /&gt;
Boolean value that determines whether or not the dynamic JavaScript code should inject the CSRF prevention token as a hidden field into HTML forms. The default value is true. Developers are strongly discouraged from disabling this property as most server-side state changing actions are triggered via a POST request.&lt;br /&gt;
&lt;br /&gt;
 inject-into-attributes&lt;br /&gt;
&lt;br /&gt;
Boolean value that determines whether or not the dynamic JavaScript code should inject the CSRF prevention token in the query string of src and href attributes. Injecting the CSRF prevention token in a URL resource increases its general risk of exposure to unauthorized parties. However, most JavaEE web applications respond in the exact same manner to HTTP requests and their associated parameters regardless of the HTTP method. The risk associated with not protecting GET requests in this situation is perceived greater than the risk of exposing the token in protected GET requests. As a result, the default value of this attribute is set to true. Developers that are confident their server-side state changing controllers will only respond to POST requests (i.e. discarding GET requests) are strongly encouraged to disable this property.&lt;br /&gt;
&lt;br /&gt;
== Map JavaScriptServlet ==&lt;br /&gt;
&lt;br /&gt;
Developers must map the JavaScriptServlet to a URI space such that the Servlet class can be remotely accessed by the dynamic JavaScript code. Consider the following configuration snippet taken directly from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;
      &amp;lt;servlet-name&amp;gt;JavaScriptServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;
      &amp;lt;url-pattern&amp;gt;/JavaScriptServlet&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;
 &amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The aforementioned configuration snippet maps the Servlet referenced by the name &amp;quot;JavaScriptServlet&amp;quot; to the URI space &amp;quot;/JavaScriptServlet&amp;quot;. Any request sent to the /JavaScriptServlet URI will produce a dynamically generated CSRFGuard JavaScript file specific to the user's current session.&lt;br /&gt;
&lt;br /&gt;
== Inject Dynamic JavaScript ==&lt;br /&gt;
&lt;br /&gt;
Developers are required to place an HTML script tag within all pages that are known to send requests to CSRF protected resources. All requests within the current HTML page are augmented to ensure they submit the correct CSRF token for the user's current session. Note that inclusion of the dynamic JavaScript does not protect the current page. Rather, the script ensures the CSRF token is transmitted within all requests generated by the current page. Consider the following code snippet taken directly from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!-- OWASP CSRFGuard Support --&amp;gt;&lt;br /&gt;
 &amp;lt;script src=&amp;quot;/Owasp.CsrfGuard.Test/JavaScriptServlet&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script tag retrieves and executes the dynamically generated JavaScript from the Servlet mapped at /Owasp.CsrfGuard.Test/JavaScriptServlet. This JavaScript code will register an event handler with window.onload. Once triggered, the code will iterate over every HTML element within the DOM looking for either form tags and or tags containing href or src attributes as configured by the JavaScriptServlet initialization parameters. Forms are dynamically updated to include the CSRFGuard token via a hidden field and tags using src and href attributes are updated to include the CSRFGuard token via a query string parameter.&lt;br /&gt;
&lt;br /&gt;
= JSP Tag Library =&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard 3 exposes a JSP tag library providing developers more fine grain control over token injection. The library exposes JSP tags that allow access to the token name, the token value, and the token name value pair delimited by an equals (=) sign. In order to make use of the tag library, ensure the Owasp.CsrfGuard.jar file is found within the target application's classpath. For example, the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application places the OWASP CSRFGuard jar file within the WebContent/WEB-INF/lib directory. After placing the library in the classpath, developers can reference the tags in JSP pages using predefined URI reference. The following JSP code snippet imports the tag library and makes it available using the prefix &amp;quot;csrf&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%@ taglib uri=&amp;quot;http://www.owasp.org/index.php/Category:OWASP_CSRFGuard_Project/Owasp.CsrfGuard.tld&amp;quot; prefix=&amp;quot;csrf&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The benefit of using the JSP tag library to inject the CSRF prevention token is the fine grain level of control. Developers can place the token in all the correct locations within the context of their applications. This strategy is useful in application contexts where the JavaScript DOM Manipulation strategy is insufficient.&lt;br /&gt;
&lt;br /&gt;
== Display Token Name ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard token name can be obtained through the token-name tag. The token-name tag is useful when injecting the CSRFGuard token name in a non-query string context. Consider the following code snippet taken from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application. This code makes use of the token-name tag to reference the token name in the name attribute of a hidden input field:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;form name=&amp;quot;test1&amp;quot; action=&amp;quot;protect.html&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; value=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;'''&amp;lt;csrf:token-name/&amp;gt;'''&amp;quot; value=&amp;quot;&amp;lt;csrf:token-value/&amp;gt;&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Display Token Value ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard token value can be obtained through the token-value tag. The token-value tag is useful when injecting the CSRFGuard token value in a non-query string context. Consider the following code snippet taken from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application. This code makes use of the token-value tag to reference the token value in the value attribute of a hidden input field:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;form name=&amp;quot;test1&amp;quot; action=&amp;quot;protect.html&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; value=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;&amp;lt;csrf:token-name/&amp;gt;&amp;quot; value=&amp;quot;'''&amp;lt;csrf:token-value/&amp;gt;'''&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The token value tag must be used in conjunction with the URI attribute when using the unique token per page model (org.owasp.csrfguard.TokenPerPage). The value of the uri attribute is the URI for which the token value will be posted. Consider the following example which sets the URI to the destination of the form, &amp;quot;protect.html&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;form id=&amp;quot;formTest1&amp;quot; name=&amp;quot;formTest1&amp;quot; action=&amp;quot;protect.html&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; value=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;&amp;lt;csrf:token-name/&amp;gt;&amp;quot; value=&amp;quot;&amp;lt;csrf:token-value uri=&amp;quot;protect.html&amp;quot;/&amp;gt;&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Display Token Name Value Pair ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard token name value pair, delimited by an equals sign (=), can be obtained though the token tag. The token tag is useful when injecting the CSRFGuard token value in a query string context. Consider the following code snippet taken from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application. This code makes use of the token tag to reference the token name value pair in the href attribute of an anchor tag:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;a href=&amp;quot;protect.html?&amp;lt;csrf:token/&amp;gt;&amp;quot;&amp;gt;protect.html&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The token name value pair tag must be used in conjunction with the URI attribute when using the unique token per page model (org.owasp.csrfguard.TokenPerPage). The value of the uri attribute is the URI for which the token value will be posted. Consider the following example which sets the URI to the destination of the link, &amp;quot;protect.html&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;a href=&amp;quot;protect.html?&amp;lt;csrf:token uri=&amp;quot;protect.html&amp;quot;/&amp;gt;&amp;quot;&amp;gt;protect.html&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Generate Form with Prevention Token ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard JSP library implements a tag library designed specifically to generate HTML forms with the CSRF prevention token automatically embedded as a hidden field. This strategy simplifies the integration of the CSRF token, especially when using the unique token per page model (org.owasp.csrfguard.TokenPerPage). The tag accepts dynamic attribute name value pairs and simply outputs them to the page. As a result, you are free to use the same attribute values made available in a standard HTML form. There is no special output encoding performed on these dynamic attributes. Take care to perform the appropriate validation and output encoding for all dynamic attributes used in conjunction with untrusted data. Consider the following code snippet which will produce a HTML form with an embedded CSRF token. No special care must be taken when using this flag in conjunction with the unique token per uri model:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;csrf:form id=&amp;quot;formTest2&amp;quot; name=&amp;quot;formTest2&amp;quot; action=&amp;quot;protect.html&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; value=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/csrf:form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Generate Link with Prevention Token ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard JSP library implements a tag library designed specifically to generate HTML anchor tags with the CSRF prevention token automatically embedded as a query string parameter. This strategy simplifies the integration of the CSRF token, especially when using the unique token per page model (org.owasp.csrfguard.TokenPerPage). The tag accepts dynamic attribute name value pairs and simply outputs them to the page. As a result, you are free to use the same attribute values made available in a standard HTML anchor. There is no special output encoding performed on these dynamic attributes. Take care to perform the appropriate validation and output encoding for all dynamic attributes used in conjunction with untrusted data. Consider the following code snippet which will produce a HTML anchor tag with an embedded CSRF token. No special care must be taken when using this flag in conjunction with the unique token per uri model:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;csrf:a href=&amp;quot;protect.html&amp;quot;&amp;gt;protect.html&amp;lt;/csrf:a&amp;gt;&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CSRFGuard_3_User_Manual&amp;diff=96692</id>
		<title>CSRFGuard 3 User Manual</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CSRFGuard_3_User_Manual&amp;diff=96692"/>
				<updated>2010-12-16T16:06:17Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
Welcome to the OWASP CSRFGuard 3 User Manual! The purpose of this article is to provide the user with guidance on obtaining, installing, deploying, and developing with the OWASP CSRFGuard library. The author's goal was to keep the User Manual informative, use to understand, and concise. If you find that one or more aspects of this document does not adhere to these goals, please me know at eric dot sheridan at owasp dot org.&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
Users can download the latest release of OWASP CSRFGuard using one of the following links:&lt;br /&gt;
&lt;br /&gt;
:[http://code.google.com/p/owaspcsrfguard/downloads/detail?name=OWASP%20CSRFGuard%20%283.0.0.245%20-%20ALPHA%29.zip&amp;amp;can=2&amp;amp;q= OWASP CSRFGuard 3.0.0.245 (ALPHA)] - download the latest development release with binary and associated configuration files '''(recommended)'''.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
Installation of OWASP CSRFGuard 3 is very straight forward requiring three simple steps:&lt;br /&gt;
&lt;br /&gt;
:# Copy the Owasp.CsrfGuard.jar file to your application's classpath&lt;br /&gt;
:# Map the CsrfGuardFilter in your application's deployment descriptor (web.xml)&lt;br /&gt;
:# Configure the Owasp.CsrfGuard.properties file as you see fit&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Installation | Click here]] for more detailed information regarding the installation of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
&lt;br /&gt;
The minimum configuration settings that users should review include:&lt;br /&gt;
&lt;br /&gt;
:* Default new token landing page (org.owasp.csrfguard.NewTokenLandingPage)&lt;br /&gt;
:* Support for Ajax and XMLHttpRequest (org.owasp.csrfguard.Ajax)&lt;br /&gt;
:* URI resources that should not be protected (org.owasp.csrfguard.unprotected.*)&lt;br /&gt;
:* Actions executed when an attack is detected (org.owasp.csrfguard.action.*)&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Configuration | Click here]] for more information regarding the configuration of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
= Token Injection =&lt;br /&gt;
&lt;br /&gt;
Users of OWASP CSRFGuard can inject prevention tokens into HTML using two strategies:&lt;br /&gt;
&lt;br /&gt;
:* JavaScript DOM Manipulation - largely automated process requiring minimal effort and is ideal for most web applications&lt;br /&gt;
:* JSP Tag Library - provides fine grained strategy ideal for situations where automated DOM manipulation is insufficient.&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Token_Injection | Click here]] for more information regarding the injection of CSRF prevention tokens within your application.&lt;br /&gt;
&lt;br /&gt;
= Known Issues =&lt;br /&gt;
&lt;br /&gt;
The following is a quick bulleted list of known issues within the current release:&lt;br /&gt;
&lt;br /&gt;
:* Ajax support does not yet work in Internet Explorer&lt;br /&gt;
:* Ajax support coupled with the TokenPerPage option only works as expected in Google Chrome. The Ajax request is not being triggered correctly in other browsers.&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_CSRFGuard_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=96630</id>
		<title>Category:OWASP CSRFGuard Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=96630"/>
				<updated>2010-12-16T02:30:32Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the home of the OWASP CSRFGuard Project! OWASP CSRFGuard is a library that implements a variant of the [http://www.corej2eepatterns.com/Design/PresoDesign.htm 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.&lt;br /&gt;
&lt;br /&gt;
== Project Lead ==&lt;br /&gt;
&lt;br /&gt;
[http://ericsheridan.blogspot.com/ Eric Sheridan] (eric dot sheridan at owasp dot org) is the lead and primary developer of the OWASP CSRFGuard project. Aside from leading up CSRFGuard, Eric has contributed to or provided guidance on numerous other OWASP projects including the Cross-Site Request Forgery Prevention Cheat Sheet, WebGoat, Stinger, CSRFTester, and Enterprise Security API (ESAPI). He is a Principal Consultant at Aspect Security specializing in a wide variety of application security activities including static analysis, penetration tests, code reviews, and threat modeling. In his personal time... wait, what is that?&lt;br /&gt;
&lt;br /&gt;
== License ==&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard is offered under the [http://www.opensource.org/licenses/bsd-license.php BSD] license. For further information on OWASP licenses, please consult the [[OWASP Licenses]] page.&lt;br /&gt;
&lt;br /&gt;
== Email List ==&lt;br /&gt;
&lt;br /&gt;
You can sign up for the OWASP CSRFGuard email list at [https://lists.owasp.org/mailman/listinfo/owasp-csrfguard https://lists.owasp.org/mailman/listinfo/owasp-csrfguard]&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
You can access the SVN repository online at http://owaspcsrfguard.googlecode.com&lt;br /&gt;
&lt;br /&gt;
== Downloads ==&lt;br /&gt;
&lt;br /&gt;
[http://code.google.com/p/owaspcsrfguard/downloads/detail?name=OWASP%20CSRFGuard%20%283.0.0.336%20-%20ALPHA%29.zip&amp;amp;can=2&amp;amp;q= OWASP CSRFGuard 3.0.0.336 (ALPHA)] - download the latest development release with binary and associated configuration files '''(recommended)'''.&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_Deprecated_Releases | Deprecated Releases]] - article containing several download references to deprecated and officially unsupported releases&lt;br /&gt;
&lt;br /&gt;
== User Manual(s) ==&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_User_Manual | OWASP CSRFGuard v3 ]] - series of articles describing the installation, configuration, and deployment of OWASP CSRFGuard v3.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
:*[http://www.owasp.org/index.php/Category:OWASP_CSRFTester_Project OWASP CSRFTester ] - utility to assist in the testing and generating PoC for CSRF attacks.&lt;br /&gt;
:*[[Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet | OWASP CSRF Prevention Cheat Sheet]] - provides a more holistic overview of CSRF prevention strategies and associated frameworks.&lt;br /&gt;
:*http://www.owasp.org/index.php/PHP_CSRF_Guard - project implementing CSRFGuard style solution for PHP.&lt;br /&gt;
:*http://www.thespanner.co.uk/2007/10/19/jsck/ - project implementing CSRFGuard style solution for PHP and JavaScript.&lt;br /&gt;
:*http://www.owasp.org/index.php/.Net_CSRF_Guard - project implementing CSRFGuard style solution for ASP.NET.&lt;br /&gt;
&lt;br /&gt;
== Project Sponsors == &lt;br /&gt;
&lt;br /&gt;
[http://www.aspectsecurity.com https://www.owasp.org/images/d/d1/Aspect_logo.gif].&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Validation_Project]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:OWASP_Project|CSRFGuard Project]]&lt;br /&gt;
[[Category:OWASP_Java_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=96629</id>
		<title>Category:OWASP CSRFGuard Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_CSRFGuard_Project&amp;diff=96629"/>
				<updated>2010-12-16T01:59:51Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Downloads */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the home of the OWASP CSRFGuard Project! OWASP CSRFGuard is a library that implements a variant of the [http://www.corej2eepatterns.com/Design/PresoDesign.htm 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.&lt;br /&gt;
&lt;br /&gt;
== Project Lead ==&lt;br /&gt;
&lt;br /&gt;
Eric Sheridan (eric dot sheridan at owasp dot org) is the lead and primary developer of the OWASP CSRFGuard project. Aside from leading up CSRFGuard, Eric has contributed to or provided guidance on numerous other OWASP projects including the Cross-Site Request Forgery Prevention Cheat Sheet, WebGoat, Stinger, CSRFTester, and Enterprise Security API (ESAPI). He is a Principal Consultant at Aspect Security specializing in a wide variety of application security activities including static analysis, penetration tests, code reviews, and threat modeling. In his personal time... wait, what is that?&lt;br /&gt;
&lt;br /&gt;
== License ==&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard is offered under the [http://www.opensource.org/licenses/bsd-license.php BSD] license. For further information on OWASP licenses, please consult the [[OWASP Licenses]] page.&lt;br /&gt;
&lt;br /&gt;
== Email List ==&lt;br /&gt;
&lt;br /&gt;
You can sign up for the OWASP CSRFGuard email list at [https://lists.owasp.org/mailman/listinfo/owasp-csrfguard https://lists.owasp.org/mailman/listinfo/owasp-csrfguard]&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
You can access the SVN repository online at http://owaspcsrfguard.googlecode.com&lt;br /&gt;
&lt;br /&gt;
== Downloads ==&lt;br /&gt;
&lt;br /&gt;
[http://code.google.com/p/owaspcsrfguard/downloads/detail?name=OWASP%20CSRFGuard%20%283.0.0.336%20-%20ALPHA%29.zip&amp;amp;can=2&amp;amp;q= OWASP CSRFGuard 3.0.0.336 (ALPHA)] - download the latest development release with binary and associated configuration files '''(recommended)'''.&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_Deprecated_Releases | Deprecated Releases]] - article containing several download references to deprecated and officially unsupported releases&lt;br /&gt;
&lt;br /&gt;
== User Manual(s) ==&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_User_Manual | OWASP CSRFGuard v3 ]] - series of articles describing the installation, configuration, and deployment of OWASP CSRFGuard v3.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
:*[http://www.owasp.org/index.php/Category:OWASP_CSRFTester_Project OWASP CSRFTester ] - utility to assist in the testing and generating PoC for CSRF attacks.&lt;br /&gt;
:*[[Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet | OWASP CSRF Prevention Cheat Sheet]] - provides a more holistic overview of CSRF prevention strategies and associated frameworks.&lt;br /&gt;
:*http://www.owasp.org/index.php/PHP_CSRF_Guard - project implementing CSRFGuard style solution for PHP.&lt;br /&gt;
:*http://www.thespanner.co.uk/2007/10/19/jsck/ - project implementing CSRFGuard style solution for PHP and JavaScript.&lt;br /&gt;
:*http://www.owasp.org/index.php/.Net_CSRF_Guard - project implementing CSRFGuard style solution for ASP.NET.&lt;br /&gt;
&lt;br /&gt;
== Project Sponsors == &lt;br /&gt;
&lt;br /&gt;
[http://www.aspectsecurity.com https://www.owasp.org/images/d/d1/Aspect_logo.gif].&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Validation_Project]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:OWASP_Project|CSRFGuard Project]]&lt;br /&gt;
[[Category:OWASP_Java_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CSRFGuard_3_Token_Injection&amp;diff=96628</id>
		<title>CSRFGuard 3 Token Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CSRFGuard_3_Token_Injection&amp;diff=96628"/>
				<updated>2010-12-16T01:35:35Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* JSP Tag Library */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard implements a variant of the synchronizer token pattern to mitigate the risk of CSRF attacks. In order to implement this pattern, CSRFGuard must offer the capability to place the CSRF prevention token within the HTML produced by the protected web application. CSRFGuard 3 provides developers more fine grain control over the injection of the token. Developers can inject the token in their HTML using either dynamic JavaScript DOM manipulation or a JSP tag library. CSRFGuard no longer intercepts and modifies the HttpServletResponse object as was done in previous releases. The currently available token injection strategies are designed to make the integration of CSRFGuard more feasible and scalable within current enterprise web applications. Developers are encouraged to make use of both the JavaScript DOM Manipulation and the JSP tag library strategies for a complete token injection strategy. The JavaScript DOM Manipulation strategy is ideal as it is automated and requires minimal effort on behalf of the developer. In the event the JavaScript solution is insufficient within a particular application context, developers should leverage the JSP tag library. The purpose of this article is to describe the token injection strategies offered by OWASP CSRFGuard 3.&lt;br /&gt;
&lt;br /&gt;
= JavaScript DOM Manipulation =&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard 3 supports the ability to dynamically inject CSRF prevention tokens throughout the DOM currently loaded in the user's browser. This strategy is extremely valuable with regards to server-side performance as it simply requires the serving of a dynamic JavaScript file. There is little to no performance hit when the fetched dynamic JavaScript updates the browser's DOM. Making use of the JavaScript token injection solution requires the developer map a Servlet and place a JavaScript HTML tag within all pages sending requests to protected application resources. Developers are strongly encouraged to leverage the JavaScript token injection strategy by default. This strategy requires minimal effort on behalf of the developer as most of the token injection logic is automated. In the event that the JavaScript automated solution may be insufficient for a specific application context, developers should leverage the OWASP CSRFGuard JSP tag library.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Use of JavaScript DOM Manipulation is required for Ajax support.&lt;br /&gt;
&lt;br /&gt;
== Declare and Configure JavaScriptServlet ==&lt;br /&gt;
&lt;br /&gt;
The JavaScript file used for token injection is dynamically generated by the JavaScriptServlet class using a template file. Ensure that the Owasp.CsrfGuard.jar file is found within the target application's classpath. Copy the Owasp.CsrfGuard.js template file from the OWASP CSRFGuard distribution folder to a non-publicly accessible directory within the target application. For the remainder of this section, we assume the Owasp.CsrfGuard.js template file was placed in the application's WEB-INF folder. Edit the deployment descriptor (web.xml) to declare the JavaScriptServlet class along with any associated initialization parameters. Consider the following configuration snippet taken from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;servlet&amp;gt;&lt;br /&gt;
      &amp;lt;servlet-name&amp;gt;JavaScriptServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;
      &amp;lt;servlet-class&amp;gt;org.owasp.csrfguard.servlet.JavaScriptServlet&amp;lt;/servlet-class&amp;gt;&lt;br /&gt;
      &amp;lt;init-param&amp;gt;&lt;br /&gt;
           &amp;lt;param-name&amp;gt;source-file&amp;lt;/param-name&amp;gt;&lt;br /&gt;
           &amp;lt;param-value&amp;gt;WEB-INF/Owasp.CsrfGuard.js&amp;lt;/param-value&amp;gt;&lt;br /&gt;
      &amp;lt;/init-param&amp;gt;&lt;br /&gt;
      &amp;lt;init-param&amp;gt;&lt;br /&gt;
           &amp;lt;param-name&amp;gt;inject-into-forms&amp;lt;/param-name&amp;gt;&lt;br /&gt;
           &amp;lt;param-value&amp;gt;true&amp;lt;/param-value&amp;gt;&lt;br /&gt;
      &amp;lt;/init-param&amp;gt;&lt;br /&gt;
      &amp;lt;init-param&amp;gt;&lt;br /&gt;
           &amp;lt;param-name&amp;gt;inject-into-attributes&amp;lt;/param-name&amp;gt;&lt;br /&gt;
           &amp;lt;param-value&amp;gt;true&amp;lt;/param-value&amp;gt;&lt;br /&gt;
      &amp;lt;/init-param&amp;gt;&lt;br /&gt;
     &amp;lt;init-param&amp;gt;&lt;br /&gt;
           &amp;lt;param-name&amp;gt;domain-strict&amp;lt;/param-name&amp;gt;&lt;br /&gt;
           &amp;lt;param-value&amp;gt;false&amp;lt;/param-value&amp;gt;&lt;br /&gt;
     &amp;lt;/init-param&amp;gt;&lt;br /&gt;
 &amp;lt;/servlet&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The aforementioned configuration snippet declares the JavaScriptServlet class using the name &amp;quot;JavaScriptServlet&amp;quot;. JavaScriptServlet accepts various initialization parameters augmenting the behavior of the class at runtime. The provided configuration snippet instructs JavaScriptServlet to...&lt;br /&gt;
&lt;br /&gt;
#Leverage the template JavaScript file at WEB-INF/Owasp.CsrfGuard.js&lt;br /&gt;
#Inject the token into all HTML forms&lt;br /&gt;
#Inject the token into all src and href attributes&lt;br /&gt;
#Leverage loose same origin matching criteria when placing the token in URL resources&lt;br /&gt;
&lt;br /&gt;
Consider the following for a more detailed listing of the initialization parameters supported by JavaScriptServlet:&lt;br /&gt;
&lt;br /&gt;
 source-file&lt;br /&gt;
&lt;br /&gt;
Denotes the location of the JavaScript template file that should be consumed and dynamically augmented by the JavaScriptServlet class. The default value is WEB-INF/Owasp.CsrfGuard.js. Use of this property and the existence of the specified template file is required. &lt;br /&gt;
&lt;br /&gt;
 domain-strict&lt;br /&gt;
&lt;br /&gt;
Boolean value that determines whether or not the dynamic JavaScript code should be strict with regards to what links it should inject the CSRF prevention token. With a value of true, the JavaScript code will only place the token in links that point to the same exact origin from which the HTML originated. With a value of false, the JavaScript code will place the token in links that contain, but may not exactly match, the originating domain.&lt;br /&gt;
&lt;br /&gt;
 referer-pattern&lt;br /&gt;
&lt;br /&gt;
Allows the developer to specify a regular expression describing the required value of the Referer header. Any attempts to access the servlet with a Referer header that does not match the captured expression is discarded. Inclusion of referer header checking is to help minimize the risk of JavaScript Hijacking attacks that attempt to steal tokens from the dynamically generated JavaScript. While the primary defenses against JavaScript Hijacking attacks are implemented within the dynamic JavaScript itself, referer header checking is implemented to achieve defense in depth.&lt;br /&gt;
&lt;br /&gt;
 cache-control&lt;br /&gt;
&lt;br /&gt;
Allows the developer to specify the value of the Cache-Control header in the HTTP response when serving the dynamic JavaScript file. The default value is private, maxage=28800. Caching of the dynamic JavaScript file is intended to minimize traffic and improve performance. Note that the Cache-Control header is always set to &amp;quot;no-store&amp;quot; when either the &amp;quot;Rotate&amp;quot; &amp;quot;TokenPerPage&amp;quot; options is set to true in Owasp.CsrfGuard.properties.&lt;br /&gt;
&lt;br /&gt;
 inject-into-forms&lt;br /&gt;
&lt;br /&gt;
Boolean value that determines whether or not the dynamic JavaScript code should inject the CSRF prevention token as a hidden field into HTML forms. The default value is true. Developers are strongly discouraged from disabling this property as most server-side state changing actions are triggered via a POST request.&lt;br /&gt;
&lt;br /&gt;
 inject-into-attributes&lt;br /&gt;
&lt;br /&gt;
Boolean value that determines whether or not the dynamic JavaScript code should inject the CSRF prevention token in the query string of src and href attributes. Injecting the CSRF prevention token in a URL resource increases its general risk of exposure to unauthorized parties. However, most JavaEE web applications respond in the exact same manner to HTTP requests and their associated parameters regardless of the HTTP method. The risk associated with not protecting GET requests in this situation is perceived greater than the risk of exposing the token in protected GET requests. As a result, the default value of this attribute is set to true. Developers that are confident their server-side state changing controllers will only respond to POST requests (i.e. discarding GET requests) are strongly encouraged to disable this property.&lt;br /&gt;
&lt;br /&gt;
== Map JavaScriptServlet ==&lt;br /&gt;
&lt;br /&gt;
Developers must map the JavaScriptServlet to a URI space such that the Servlet class can be remotely accessed by the dynamic JavaScript code. Consider the following configuration snippet taken directly from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;
      &amp;lt;servlet-name&amp;gt;JavaScriptServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;
      &amp;lt;url-pattern&amp;gt;/JavaScriptServlet&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;
 &amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The aforementioned configuration snippet maps the Servlet referenced by the name &amp;quot;JavaScriptServlet&amp;quot; to the URI space &amp;quot;/JavaScriptServlet&amp;quot;. Any request sent to the /JavaScriptServlet URI will produce a dynamically generated CSRFGuard JavaScript file specific to the user's current session.&lt;br /&gt;
&lt;br /&gt;
== Inject Dynamic JavaScript ==&lt;br /&gt;
&lt;br /&gt;
Developers are required to place an HTML script tag within all pages that are known to send requests to CSRF protected resources. All requests within the current HTML page are augmented to ensure they submit the correct CSRF token for the user's current session. Note that inclusion of the dynamic JavaScript does not protect the current page. Rather, the script ensures the CSRF token is transmitted within all requests generated by the current page. Consider the following code snippet taken directly from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!-- OWASP CSRFGuard Support --&amp;gt;&lt;br /&gt;
 &amp;lt;script src=&amp;quot;/Owasp.CsrfGuard.Test/JavaScriptServlet&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script tag retrieves and executes the dynamically generated JavaScript from the Servlet mapped at /Owasp.CsrfGuard.Test/JavaScriptServlet. This JavaScript code will register an event handler with window.onload. Once triggered, the code will iterate over every HTML element within the DOM looking for either form tags and or tags containing href or src attributes as configured by the JavaScriptServlet initialization parameters. Forms are dynamically updated to include the CSRFGuard token via a hidden field and tags using src and href attributes are updated to include the CSRFGuard token via a query string parameter.&lt;br /&gt;
&lt;br /&gt;
= JSP Tag Library =&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard 3 exposes a JSP tag library providing developers more fine grain control over token injection. The library exposes JSP tags that allow access to the token name, the token value, and the token name value pair delimited by an equals (=) sign. In order to make use of the tag library, ensure the Owasp.CsrfGuard.jar file is found within the target application's classpath. For example, the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application places the OWASP CSRFGuard jar file within the WebContent/WEB-INF/lib directory. After placing the library in the classpath, developers can reference the tags in JSP pages using predefined URI reference. The following JSP code snippet imports the tag library and makes it available using the prefix &amp;quot;csrf&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%@ taglib uri=&amp;quot;http://www.owasp.org/index.php/Category:OWASP_CSRFGuard_Project/Owasp.CsrfGuard.tld&amp;quot; prefix=&amp;quot;csrf&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The benefit of using the JSP tag library to inject the CSRF prevention token is the fine grain level of control. Developers can place the token in all the correct locations within the context of their applications. This strategy is useful in application contexts where the JavaScript DOM Manipulation strategy is insufficient.&lt;br /&gt;
&lt;br /&gt;
== Display Token Name ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard token name can be obtained through the token-name tag. The token-name tag is useful when injecting the CSRFGuard token name in a non-query string context. Consider the following code snippet taken from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application. This code makes use of the token-name tag to reference the token name in the name attribute of a hidden input field:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;form name=&amp;quot;test1&amp;quot; action=&amp;quot;protect.html&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; value=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;'''&amp;lt;csrf:token-name/&amp;gt;'''&amp;quot; value=&amp;quot;&amp;lt;csrf:token-value/&amp;gt;&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Display Token Value ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard token value can be obtained through the token-value tag. The token-value tag is useful when injecting the CSRFGuard token value in a non-query string context. Consider the following code snippet taken from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application. This code makes use of the token-value tag to reference the token value in the value attribute of a hidden input field:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;form name=&amp;quot;test1&amp;quot; action=&amp;quot;protect.html&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; value=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;&amp;lt;csrf:token-name/&amp;gt;&amp;quot; value=&amp;quot;'''&amp;lt;csrf:token-value/&amp;gt;'''&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The token value tag must be used in conjunction with the URI attribute when using the unique token per page model (org.owasp.csrfguard.TokenPerPage). The value of the uri attribute is the URI for which the token value will be posted. Consider the following example which sets the URI to the destination of the form, &amp;quot;protect.html&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;form id=&amp;quot;formTest1&amp;quot; name=&amp;quot;formTest1&amp;quot; action=&amp;quot;protect.html&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; value=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;&amp;lt;csrf:token-name/&amp;gt;&amp;quot; value=&amp;quot;&amp;lt;csrf:token-value uri=&amp;quot;protect.html&amp;quot;/&amp;gt;&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Display Token Name Value Pair ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard token name value pair, delimited by an equals sign (=), can be obtained though the token tag. The token tag is useful when injecting the CSRFGuard token value in a query string context. Consider the following code snippet taken from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application. This code makes use of the token tag to reference the token name value pair in the href attribute of an anchor tag:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;a href=&amp;quot;protect.html?&amp;lt;csrf:token/&amp;gt;&amp;quot;&amp;gt;protect.html&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The token name value pair tag must be used in conjunction with the URI attribute when using the unique token per page model (org.owasp.csrfguard.TokenPerPage). The value of the uri attribute is the URI for which the token value will be posted. Consider the following example which sets the URI to the destination of the link, &amp;quot;protect.html&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;a href=&amp;quot;protect.html?&amp;lt;csrf:token uri=&amp;quot;protect.html&amp;quot;/&amp;gt;&amp;quot;&amp;gt;protect.html&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Generate Form with Prevention Token ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard JSP library implements a tag library designed specifically to generate HTML forms with the CSRF prevention token automatically embedded as a hidden field. This strategy simplifies the integration of the CSRF token, especially when using the unique token per page model (org.owasp.csrfguard.TokenPerPage). The tag accepts dynamic attribute name value pairs and simply outputs them to the page. As a result, you are free to use the same attribute values made available in a standard HTML form. There is no special output encoding performed on these dynamic attributes. Take care to perform the appropriate validation and output encoding for all dynamic attributes used in conjunction with untrusted data. Consider the following code snippet which will produce a HTML form with an embedded CSRF token. No special care must be taken when using this flag in conjunction with the unique token per uri model:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;csrf:form id=&amp;quot;formTest2&amp;quot; name=&amp;quot;formTest2&amp;quot; action=&amp;quot;protect.html&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; value=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/csrf:form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Generate Link with Prevention Token ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard JSP library implements a tag library designed specifically to generate HTML anchor tags with the CSRF prevention token automatically embedded as a query string parameter. This strategy simplifies the integration of the CSRF token, especially when using the unique token per page model (org.owasp.csrfguard.TokenPerPage). The tag accepts dynamic attribute name value pairs and simply outputs them to the page. As a result, you are free to use the same attribute values made available in a standard HTML anchor. There is no special output encoding performed on these dynamic attributes. Take care to perform the appropriate validation and output encoding for all dynamic attributes used in conjunction with untrusted data. Consider the following code snippet which will produce a HTML anchor tag with an embedded CSRF token. No special care must be taken when using this flag in conjunction with the unique token per uri model:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;csrf:a href=&amp;quot;protect.html&amp;quot;&amp;gt;protect.html&amp;lt;/csrf:a&amp;gt;&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CSRFGuard_3_Token_Injection&amp;diff=96627</id>
		<title>CSRFGuard 3 Token Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CSRFGuard_3_Token_Injection&amp;diff=96627"/>
				<updated>2010-12-16T01:32:12Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* JSP Tag Library */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard implements a variant of the synchronizer token pattern to mitigate the risk of CSRF attacks. In order to implement this pattern, CSRFGuard must offer the capability to place the CSRF prevention token within the HTML produced by the protected web application. CSRFGuard 3 provides developers more fine grain control over the injection of the token. Developers can inject the token in their HTML using either dynamic JavaScript DOM manipulation or a JSP tag library. CSRFGuard no longer intercepts and modifies the HttpServletResponse object as was done in previous releases. The currently available token injection strategies are designed to make the integration of CSRFGuard more feasible and scalable within current enterprise web applications. Developers are encouraged to make use of both the JavaScript DOM Manipulation and the JSP tag library strategies for a complete token injection strategy. The JavaScript DOM Manipulation strategy is ideal as it is automated and requires minimal effort on behalf of the developer. In the event the JavaScript solution is insufficient within a particular application context, developers should leverage the JSP tag library. The purpose of this article is to describe the token injection strategies offered by OWASP CSRFGuard 3.&lt;br /&gt;
&lt;br /&gt;
= JavaScript DOM Manipulation =&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard 3 supports the ability to dynamically inject CSRF prevention tokens throughout the DOM currently loaded in the user's browser. This strategy is extremely valuable with regards to server-side performance as it simply requires the serving of a dynamic JavaScript file. There is little to no performance hit when the fetched dynamic JavaScript updates the browser's DOM. Making use of the JavaScript token injection solution requires the developer map a Servlet and place a JavaScript HTML tag within all pages sending requests to protected application resources. Developers are strongly encouraged to leverage the JavaScript token injection strategy by default. This strategy requires minimal effort on behalf of the developer as most of the token injection logic is automated. In the event that the JavaScript automated solution may be insufficient for a specific application context, developers should leverage the OWASP CSRFGuard JSP tag library.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Use of JavaScript DOM Manipulation is required for Ajax support.&lt;br /&gt;
&lt;br /&gt;
== Declare and Configure JavaScriptServlet ==&lt;br /&gt;
&lt;br /&gt;
The JavaScript file used for token injection is dynamically generated by the JavaScriptServlet class using a template file. Ensure that the Owasp.CsrfGuard.jar file is found within the target application's classpath. Copy the Owasp.CsrfGuard.js template file from the OWASP CSRFGuard distribution folder to a non-publicly accessible directory within the target application. For the remainder of this section, we assume the Owasp.CsrfGuard.js template file was placed in the application's WEB-INF folder. Edit the deployment descriptor (web.xml) to declare the JavaScriptServlet class along with any associated initialization parameters. Consider the following configuration snippet taken from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;servlet&amp;gt;&lt;br /&gt;
      &amp;lt;servlet-name&amp;gt;JavaScriptServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;
      &amp;lt;servlet-class&amp;gt;org.owasp.csrfguard.servlet.JavaScriptServlet&amp;lt;/servlet-class&amp;gt;&lt;br /&gt;
      &amp;lt;init-param&amp;gt;&lt;br /&gt;
           &amp;lt;param-name&amp;gt;source-file&amp;lt;/param-name&amp;gt;&lt;br /&gt;
           &amp;lt;param-value&amp;gt;WEB-INF/Owasp.CsrfGuard.js&amp;lt;/param-value&amp;gt;&lt;br /&gt;
      &amp;lt;/init-param&amp;gt;&lt;br /&gt;
      &amp;lt;init-param&amp;gt;&lt;br /&gt;
           &amp;lt;param-name&amp;gt;inject-into-forms&amp;lt;/param-name&amp;gt;&lt;br /&gt;
           &amp;lt;param-value&amp;gt;true&amp;lt;/param-value&amp;gt;&lt;br /&gt;
      &amp;lt;/init-param&amp;gt;&lt;br /&gt;
      &amp;lt;init-param&amp;gt;&lt;br /&gt;
           &amp;lt;param-name&amp;gt;inject-into-attributes&amp;lt;/param-name&amp;gt;&lt;br /&gt;
           &amp;lt;param-value&amp;gt;true&amp;lt;/param-value&amp;gt;&lt;br /&gt;
      &amp;lt;/init-param&amp;gt;&lt;br /&gt;
     &amp;lt;init-param&amp;gt;&lt;br /&gt;
           &amp;lt;param-name&amp;gt;domain-strict&amp;lt;/param-name&amp;gt;&lt;br /&gt;
           &amp;lt;param-value&amp;gt;false&amp;lt;/param-value&amp;gt;&lt;br /&gt;
     &amp;lt;/init-param&amp;gt;&lt;br /&gt;
 &amp;lt;/servlet&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The aforementioned configuration snippet declares the JavaScriptServlet class using the name &amp;quot;JavaScriptServlet&amp;quot;. JavaScriptServlet accepts various initialization parameters augmenting the behavior of the class at runtime. The provided configuration snippet instructs JavaScriptServlet to...&lt;br /&gt;
&lt;br /&gt;
#Leverage the template JavaScript file at WEB-INF/Owasp.CsrfGuard.js&lt;br /&gt;
#Inject the token into all HTML forms&lt;br /&gt;
#Inject the token into all src and href attributes&lt;br /&gt;
#Leverage loose same origin matching criteria when placing the token in URL resources&lt;br /&gt;
&lt;br /&gt;
Consider the following for a more detailed listing of the initialization parameters supported by JavaScriptServlet:&lt;br /&gt;
&lt;br /&gt;
 source-file&lt;br /&gt;
&lt;br /&gt;
Denotes the location of the JavaScript template file that should be consumed and dynamically augmented by the JavaScriptServlet class. The default value is WEB-INF/Owasp.CsrfGuard.js. Use of this property and the existence of the specified template file is required. &lt;br /&gt;
&lt;br /&gt;
 domain-strict&lt;br /&gt;
&lt;br /&gt;
Boolean value that determines whether or not the dynamic JavaScript code should be strict with regards to what links it should inject the CSRF prevention token. With a value of true, the JavaScript code will only place the token in links that point to the same exact origin from which the HTML originated. With a value of false, the JavaScript code will place the token in links that contain, but may not exactly match, the originating domain.&lt;br /&gt;
&lt;br /&gt;
 referer-pattern&lt;br /&gt;
&lt;br /&gt;
Allows the developer to specify a regular expression describing the required value of the Referer header. Any attempts to access the servlet with a Referer header that does not match the captured expression is discarded. Inclusion of referer header checking is to help minimize the risk of JavaScript Hijacking attacks that attempt to steal tokens from the dynamically generated JavaScript. While the primary defenses against JavaScript Hijacking attacks are implemented within the dynamic JavaScript itself, referer header checking is implemented to achieve defense in depth.&lt;br /&gt;
&lt;br /&gt;
 cache-control&lt;br /&gt;
&lt;br /&gt;
Allows the developer to specify the value of the Cache-Control header in the HTTP response when serving the dynamic JavaScript file. The default value is private, maxage=28800. Caching of the dynamic JavaScript file is intended to minimize traffic and improve performance. Note that the Cache-Control header is always set to &amp;quot;no-store&amp;quot; when either the &amp;quot;Rotate&amp;quot; &amp;quot;TokenPerPage&amp;quot; options is set to true in Owasp.CsrfGuard.properties.&lt;br /&gt;
&lt;br /&gt;
 inject-into-forms&lt;br /&gt;
&lt;br /&gt;
Boolean value that determines whether or not the dynamic JavaScript code should inject the CSRF prevention token as a hidden field into HTML forms. The default value is true. Developers are strongly discouraged from disabling this property as most server-side state changing actions are triggered via a POST request.&lt;br /&gt;
&lt;br /&gt;
 inject-into-attributes&lt;br /&gt;
&lt;br /&gt;
Boolean value that determines whether or not the dynamic JavaScript code should inject the CSRF prevention token in the query string of src and href attributes. Injecting the CSRF prevention token in a URL resource increases its general risk of exposure to unauthorized parties. However, most JavaEE web applications respond in the exact same manner to HTTP requests and their associated parameters regardless of the HTTP method. The risk associated with not protecting GET requests in this situation is perceived greater than the risk of exposing the token in protected GET requests. As a result, the default value of this attribute is set to true. Developers that are confident their server-side state changing controllers will only respond to POST requests (i.e. discarding GET requests) are strongly encouraged to disable this property.&lt;br /&gt;
&lt;br /&gt;
== Map JavaScriptServlet ==&lt;br /&gt;
&lt;br /&gt;
Developers must map the JavaScriptServlet to a URI space such that the Servlet class can be remotely accessed by the dynamic JavaScript code. Consider the following configuration snippet taken directly from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;
      &amp;lt;servlet-name&amp;gt;JavaScriptServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;
      &amp;lt;url-pattern&amp;gt;/JavaScriptServlet&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;
 &amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The aforementioned configuration snippet maps the Servlet referenced by the name &amp;quot;JavaScriptServlet&amp;quot; to the URI space &amp;quot;/JavaScriptServlet&amp;quot;. Any request sent to the /JavaScriptServlet URI will produce a dynamically generated CSRFGuard JavaScript file specific to the user's current session.&lt;br /&gt;
&lt;br /&gt;
== Inject Dynamic JavaScript ==&lt;br /&gt;
&lt;br /&gt;
Developers are required to place an HTML script tag within all pages that are known to send requests to CSRF protected resources. All requests within the current HTML page are augmented to ensure they submit the correct CSRF token for the user's current session. Note that inclusion of the dynamic JavaScript does not protect the current page. Rather, the script ensures the CSRF token is transmitted within all requests generated by the current page. Consider the following code snippet taken directly from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!-- OWASP CSRFGuard Support --&amp;gt;&lt;br /&gt;
 &amp;lt;script src=&amp;quot;/Owasp.CsrfGuard.Test/JavaScriptServlet&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script tag retrieves and executes the dynamically generated JavaScript from the Servlet mapped at /Owasp.CsrfGuard.Test/JavaScriptServlet. This JavaScript code will register an event handler with window.onload. Once triggered, the code will iterate over every HTML element within the DOM looking for either form tags and or tags containing href or src attributes as configured by the JavaScriptServlet initialization parameters. Forms are dynamically updated to include the CSRFGuard token via a hidden field and tags using src and href attributes are updated to include the CSRFGuard token via a query string parameter.&lt;br /&gt;
&lt;br /&gt;
= JSP Tag Library =&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard 3 exposes a JSP tag library providing developers more fine grain control over token injection. The library exposes JSP tags that allow access to the token name, the token value, and the token name value pair delimited by an equals (=) sign. In order to make use of the tag library, ensure the Owasp.CsrfGuard.jar file is found within the target application's classpath. For example, the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application places the OWASP CSRFGuard jar file within the WebContent/WEB-INF/lib directory. After placing the library in the classpath, developers can reference the tags in JSP pages using predefined URI reference. The following JSP code snippet imports the tag library and makes it available using the prefix &amp;quot;csrf&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%@ taglib uri=&amp;quot;http://www.owasp.org/index.php/Category:OWASP_CSRFGuard_Project/Owasp.CsrfGuard.tld&amp;quot; prefix=&amp;quot;csrf&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The benefit of using the JSP tag library to inject the CSRF prevention token is the fine grain level of control. Developers can place the token in all the correct locations within the context of their applications. This strategy is useful in application contexts where the JavaScript DOM Manipulation strategy is insufficient.&lt;br /&gt;
&lt;br /&gt;
== Display Token Name ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard token name can be obtained through the token-name tag. The token-name tag is useful when injecting the CSRFGuard token name in a non-query string context. Consider the following code snippet taken from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application. This code makes use of the token-name tag to reference the token name in the name attribute of a hidden input field:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;form name=&amp;quot;test1&amp;quot; action=&amp;quot;protect.html&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; value=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;'''&amp;lt;csrf:token-name/&amp;gt;'''&amp;quot; value=&amp;quot;&amp;lt;csrf:token-value/&amp;gt;&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Display Token Value ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard token value can be obtained through the token-value tag. The token-value tag is useful when injecting the CSRFGuard token value in a non-query string context. Consider the following code snippet taken from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application. This code makes use of the token-value tag to reference the token value in the value attribute of a hidden input field:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;form name=&amp;quot;test1&amp;quot; action=&amp;quot;protect.html&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; value=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;&amp;lt;csrf:token-name/&amp;gt;&amp;quot; value=&amp;quot;'''&amp;lt;csrf:token-value/&amp;gt;'''&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The token value tag must be used in conjunction with the URI attribute when using the unique token per page model (org.owasp.csrfguard.TokenPerPage). The value of the uri attribute is the URI for which the token value will be posted. Consider the following example which sets the URI to the destination of the form, &amp;quot;protect.html&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;form id=&amp;quot;formTest1&amp;quot; name=&amp;quot;formTest1&amp;quot; action=&amp;quot;protect.html&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; value=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;&amp;lt;csrf:token-name/&amp;gt;&amp;quot; value=&amp;quot;&amp;lt;csrf:token-value uri=&amp;quot;protect.html&amp;quot;/&amp;gt;&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Display Token Name Value Pair ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard token name value pair, delimited by an equals sign (=), can be obtained though the token tag. The token tag is useful when injecting the CSRFGuard token value in a query string context. Consider the following code snippet taken from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application. This code makes use of the token tag to reference the token name value pair in the href attribute of an anchor tag:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;a href=&amp;quot;protect.html?&amp;lt;csrf:token/&amp;gt;&amp;quot;&amp;gt;protect.html&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The token name value pair tag must be used in conjunction with the URI attribute when using the unique token per page model (org.owasp.csrfguard.TokenPerPage). The value of the uri attribute is the URI for which the token value will be posted. Consider the following example which sets the URI to the destination of the link, &amp;quot;protect.html&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;a href=&amp;quot;protect.html?&amp;lt;csrf:token uri=&amp;quot;protect.html&amp;quot;/&amp;gt;&amp;quot;&amp;gt;protect.html&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Generate Form with Prevention Token ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard JSP library implements a tag library designed specifically to generate HTML forms with the CSRF prevention token automatically embedded as a hidden field. This strategy simplifies the integration of the CSRF token, especially when using the unique token per page model (org.owasp.csrfguard.TokenPerPage). Consider the following code snippet which will produce a HTML form with an embedded CSRF token. No special care must be taken when using this flag in conjunction with the unique token per uri model:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;csrf:form id=&amp;quot;formTest2&amp;quot; name=&amp;quot;formTest2&amp;quot; action=&amp;quot;protect.html&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; value=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/csrf:form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Generate Link with Prevention Token ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard JSP library implements a tag library designed specifically to generate HTML anchor tags with the CSRF prevention token automatically embedded as a query string parameter. This strategy simplifies the integration of the CSRF token, especially when using the unique token per page model (org.owasp.csrfguard.TokenPerPage). Consider the following code snippet which will produce a HTML anchor tag with an embedded CSRF token. No special care must be taken when using this flag in conjunction with the unique token per uri model:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;csrf:a href=&amp;quot;protect.html&amp;quot;&amp;gt;protect.html&amp;lt;/csrf:a&amp;gt;&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Summit_2011_Attendee/Attendee076&amp;diff=96314</id>
		<title>Summit 2011 Attendee/Attendee076</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Summit_2011_Attendee/Attendee076&amp;diff=96314"/>
				<updated>2010-12-14T16:00:35Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:&amp;lt;includeonly&amp;gt;{{{1}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;OWASP 2011 Global Summit Attendee Tab&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| summit_attendee_name1 = Eric Sheridan&lt;br /&gt;
| summit_attendee_email1 = eric.sheridan@owasp.org&lt;br /&gt;
| summit_attendee_wiki_username1 = esheridan&lt;br /&gt;
|-&lt;br /&gt;
| summit_attendee_company = Aspect Security&lt;br /&gt;
|-&lt;br /&gt;
| summit_attendee_current_owasp_involvement_name1 =  CSRFGuard&lt;br /&gt;
| summit_attendee_current_owasp_involvement_url_1 = http://www.owasp.org/index.php/Category:OWASP_CSRFGuard_Project&lt;br /&gt;
| summit_attendee_current_owasp_involvement_name2 = &lt;br /&gt;
| summit_attendee_current_owasp_involvement_url_2 = &lt;br /&gt;
| summit_attendee_current_owasp_involvement_name3 = &lt;br /&gt;
| summit_attendee_current_owasp_involvement_url_3 = &lt;br /&gt;
| summit_attendee_current_owasp_involvement_name4 = &lt;br /&gt;
| summit_attendee_current_owasp_involvement_url_4 = &lt;br /&gt;
| summit_attendee_current_owasp_involvement_name5 = &lt;br /&gt;
| summit_attendee_current_owasp_involvement_url_5 = &lt;br /&gt;
|-&lt;br /&gt;
| summit_attendee_reason_for_summit_participation_name1 =  Protecting Against CSRF&lt;br /&gt;
| summit_attendee_reason_for_summit_participation_url_1 = http://www.owasp.org/index.php/Summit_2011/OWASP_Secure_Coding_Workshop&lt;br /&gt;
| notes_reason_for_participating_issues_to_be_discussed_1 = &lt;br /&gt;
| summit_attendee_reason_for_summit_participation_name2 = &lt;br /&gt;
| summit_attendee_reason_for_summit_participation_url_2 = &lt;br /&gt;
| notes_reason_for_participating_issues_to_be_discussed_2 = &lt;br /&gt;
| summit_attendee_reason_for_summit_participation_name3 = &lt;br /&gt;
| summit_attendee_reason_for_summit_participation_url_3 = &lt;br /&gt;
| notes_reason_for_participating_issues_to_be_discussed_3 = &lt;br /&gt;
| summit_attendee_reason_for_summit_participation_name4 = &lt;br /&gt;
| summit_attendee_reason_for_summit_participation_url_4 = &lt;br /&gt;
| notes_reason_for_participating_issues_to_be_discussed_4 = &lt;br /&gt;
| summit_attendee_reason_for_summit_participation_name5 = &lt;br /&gt;
| summit_attendee_reason_for_summit_participation_url_5 = &lt;br /&gt;
| notes_reason_for_participating_issues_to_be_discussed_5 = &lt;br /&gt;
|-&lt;br /&gt;
| summit_attendee_owasp_sponsor = &lt;br /&gt;
|-&lt;br /&gt;
| summit_attendee_summit_time_paid_by_name1 =&lt;br /&gt;
| summit_attendee_summit_time_paid_by_url_1 =&lt;br /&gt;
| summit_attendee_summit_time_paid_by_name2 =&lt;br /&gt;
| summit_attendee_summit_time_paid_by_url_2 =&lt;br /&gt;
|-&lt;br /&gt;
| summit_attendee_summit_expenses_paid_by_name1 = &lt;br /&gt;
| summit_attendee_summit_expenses_paid_by_url_1 = &lt;br /&gt;
| summit_attendee_summit_expenses_paid_by_name2 = &lt;br /&gt;
| summit_attendee_summit_expenses_paid_by_url_2 =  &lt;br /&gt;
|-&lt;br /&gt;
| reason_for_sponsorship = OWASP CSRFGuard Project Lead&lt;br /&gt;
|-&lt;br /&gt;
| status = Confirmed, Seeking Funds&lt;br /&gt;
|-&lt;br /&gt;
| letter sent to sponsor = &lt;br /&gt;
|-&lt;br /&gt;
| notes for Kate =&lt;br /&gt;
|-&lt;br /&gt;
| attendee_name_mask = &amp;lt;!--Please replace DO NOT EDIT this string --&amp;gt; Attendee076&lt;br /&gt;
| attendee_home_page = &amp;lt;!--Please replace DO NOT EDIT this string --&amp;gt; Summit_2011_Attendee/Attendee076 &lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Summit_2011_Attendee/Attendee076&amp;diff=96313</id>
		<title>Summit 2011 Attendee/Attendee076</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Summit_2011_Attendee/Attendee076&amp;diff=96313"/>
				<updated>2010-12-14T15:58:42Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:&amp;lt;includeonly&amp;gt;{{{1}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;OWASP 2011 Global Summit Attendee Tab&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| summit_attendee_name1 = Eric Sheridan&lt;br /&gt;
| summit_attendee_email1 = eric.sheridan@owasp.org&lt;br /&gt;
| summit_attendee_wiki_username1 = esheridan&lt;br /&gt;
|-&lt;br /&gt;
| summit_attendee_company = Aspect Security&lt;br /&gt;
|-&lt;br /&gt;
| summit_attendee_current_owasp_involvement_name1 =  CSRFGuard&lt;br /&gt;
| summit_attendee_current_owasp_involvement_url_1 = http://www.owasp.org/index.php/Category:OWASP_CSRFGuard_Project&lt;br /&gt;
| summit_attendee_current_owasp_involvement_name2 = &lt;br /&gt;
| summit_attendee_current_owasp_involvement_url_2 = &lt;br /&gt;
| summit_attendee_current_owasp_involvement_name3 = &lt;br /&gt;
| summit_attendee_current_owasp_involvement_url_3 = &lt;br /&gt;
| summit_attendee_current_owasp_involvement_name4 = &lt;br /&gt;
| summit_attendee_current_owasp_involvement_url_4 = &lt;br /&gt;
| summit_attendee_current_owasp_involvement_name5 = &lt;br /&gt;
| summit_attendee_current_owasp_involvement_url_5 = &lt;br /&gt;
|-&lt;br /&gt;
| summit_attendee_reason_for_summit_participation_name1 =  Protecting Against CSRF&lt;br /&gt;
| summit_attendee_reason_for_summit_participation_url_1 = http://www.owasp.org/index.php/Summit_2011/OWASP_Secure_Coding_Workshop&lt;br /&gt;
| notes_reason_for_participating_issues_to_be_discussed_1 = &lt;br /&gt;
| summit_attendee_reason_for_summit_participation_name2 = &lt;br /&gt;
| summit_attendee_reason_for_summit_participation_url_2 = &lt;br /&gt;
| notes_reason_for_participating_issues_to_be_discussed_2 = &lt;br /&gt;
| summit_attendee_reason_for_summit_participation_name3 = &lt;br /&gt;
| summit_attendee_reason_for_summit_participation_url_3 = &lt;br /&gt;
| notes_reason_for_participating_issues_to_be_discussed_3 = &lt;br /&gt;
| summit_attendee_reason_for_summit_participation_name4 = &lt;br /&gt;
| summit_attendee_reason_for_summit_participation_url_4 = &lt;br /&gt;
| notes_reason_for_participating_issues_to_be_discussed_4 = &lt;br /&gt;
| summit_attendee_reason_for_summit_participation_name5 = &lt;br /&gt;
| summit_attendee_reason_for_summit_participation_url_5 = &lt;br /&gt;
| notes_reason_for_participating_issues_to_be_discussed_5 = &lt;br /&gt;
|-&lt;br /&gt;
| summit_attendee_owasp_sponsor = &lt;br /&gt;
|-&lt;br /&gt;
| summit_attendee_summit_time_paid_by_name1 =&lt;br /&gt;
| summit_attendee_summit_time_paid_by_url_1 =&lt;br /&gt;
| summit_attendee_summit_time_paid_by_name2 =&lt;br /&gt;
| summit_attendee_summit_time_paid_by_url_2 =&lt;br /&gt;
|-&lt;br /&gt;
| summit_attendee_summit_expenses_paid_by_name1 = &lt;br /&gt;
| summit_attendee_summit_expenses_paid_by_url_1 = &lt;br /&gt;
| summit_attendee_summit_expenses_paid_by_name2 = &lt;br /&gt;
| summit_attendee_summit_expenses_paid_by_url_2 =  &lt;br /&gt;
|-&lt;br /&gt;
| reason_for_sponsorship = &lt;br /&gt;
|-&lt;br /&gt;
| status = &lt;br /&gt;
|-&lt;br /&gt;
| letter sent to sponsor = &lt;br /&gt;
|-&lt;br /&gt;
| notes for Kate =&lt;br /&gt;
|-&lt;br /&gt;
| attendee_name_mask = &amp;lt;!--Please replace DO NOT EDIT this string --&amp;gt; Attendee076&lt;br /&gt;
| attendee_home_page = &amp;lt;!--Please replace DO NOT EDIT this string --&amp;gt; Summit_2011_Attendee/Attendee076 &lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CSRFGuard_3_Token_Injection&amp;diff=96180</id>
		<title>CSRFGuard 3 Token Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CSRFGuard_3_Token_Injection&amp;diff=96180"/>
				<updated>2010-12-13T23:15:04Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard implements a variant of the synchronizer token pattern to mitigate the risk of CSRF attacks. In order to implement this pattern, CSRFGuard must offer the capability to place the CSRF prevention token within the HTML produced by the protected web application. CSRFGuard 3 provides developers more fine grain control over the injection of the token. Developers can inject the token in their HTML using either dynamic JavaScript DOM manipulation or a JSP tag library. CSRFGuard no longer intercepts and modifies the HttpServletResponse object as was done in previous releases. The currently available token injection strategies are designed to make the integration of CSRFGuard more feasible and scalable within current enterprise web applications. Developers are encouraged to make use of both the JavaScript DOM Manipulation and the JSP tag library strategies for a complete token injection strategy. The JavaScript DOM Manipulation strategy is ideal as it is automated and requires minimal effort on behalf of the developer. In the event the JavaScript solution is insufficient within a particular application context, developers should leverage the JSP tag library. The purpose of this article is to describe the token injection strategies offered by OWASP CSRFGuard 3.&lt;br /&gt;
&lt;br /&gt;
= JavaScript DOM Manipulation =&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard 3 supports the ability to dynamically inject CSRF prevention tokens throughout the DOM currently loaded in the user's browser. This strategy is extremely valuable with regards to server-side performance as it simply requires the serving of a dynamic JavaScript file. There is little to no performance hit when the fetched dynamic JavaScript updates the browser's DOM. Making use of the JavaScript token injection solution requires the developer map a Servlet and place a JavaScript HTML tag within all pages sending requests to protected application resources. Developers are strongly encouraged to leverage the JavaScript token injection strategy by default. This strategy requires minimal effort on behalf of the developer as most of the token injection logic is automated. In the event that the JavaScript automated solution may be insufficient for a specific application context, developers should leverage the OWASP CSRFGuard JSP tag library.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Use of JavaScript DOM Manipulation is required for Ajax support.&lt;br /&gt;
&lt;br /&gt;
== Declare and Configure JavaScriptServlet ==&lt;br /&gt;
&lt;br /&gt;
The JavaScript file used for token injection is dynamically generated by the JavaScriptServlet class using a template file. Ensure that the Owasp.CsrfGuard.jar file is found within the target application's classpath. Copy the Owasp.CsrfGuard.js template file from the OWASP CSRFGuard distribution folder to a non-publicly accessible directory within the target application. For the remainder of this section, we assume the Owasp.CsrfGuard.js template file was placed in the application's WEB-INF folder. Edit the deployment descriptor (web.xml) to declare the JavaScriptServlet class along with any associated initialization parameters. Consider the following configuration snippet taken from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;servlet&amp;gt;&lt;br /&gt;
      &amp;lt;servlet-name&amp;gt;JavaScriptServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;
      &amp;lt;servlet-class&amp;gt;org.owasp.csrfguard.servlet.JavaScriptServlet&amp;lt;/servlet-class&amp;gt;&lt;br /&gt;
      &amp;lt;init-param&amp;gt;&lt;br /&gt;
           &amp;lt;param-name&amp;gt;source-file&amp;lt;/param-name&amp;gt;&lt;br /&gt;
           &amp;lt;param-value&amp;gt;WEB-INF/Owasp.CsrfGuard.js&amp;lt;/param-value&amp;gt;&lt;br /&gt;
      &amp;lt;/init-param&amp;gt;&lt;br /&gt;
      &amp;lt;init-param&amp;gt;&lt;br /&gt;
           &amp;lt;param-name&amp;gt;inject-into-forms&amp;lt;/param-name&amp;gt;&lt;br /&gt;
           &amp;lt;param-value&amp;gt;true&amp;lt;/param-value&amp;gt;&lt;br /&gt;
      &amp;lt;/init-param&amp;gt;&lt;br /&gt;
      &amp;lt;init-param&amp;gt;&lt;br /&gt;
           &amp;lt;param-name&amp;gt;inject-into-attributes&amp;lt;/param-name&amp;gt;&lt;br /&gt;
           &amp;lt;param-value&amp;gt;true&amp;lt;/param-value&amp;gt;&lt;br /&gt;
      &amp;lt;/init-param&amp;gt;&lt;br /&gt;
     &amp;lt;init-param&amp;gt;&lt;br /&gt;
           &amp;lt;param-name&amp;gt;domain-strict&amp;lt;/param-name&amp;gt;&lt;br /&gt;
           &amp;lt;param-value&amp;gt;false&amp;lt;/param-value&amp;gt;&lt;br /&gt;
     &amp;lt;/init-param&amp;gt;&lt;br /&gt;
 &amp;lt;/servlet&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The aforementioned configuration snippet declares the JavaScriptServlet class using the name &amp;quot;JavaScriptServlet&amp;quot;. JavaScriptServlet accepts various initialization parameters augmenting the behavior of the class at runtime. The provided configuration snippet instructs JavaScriptServlet to...&lt;br /&gt;
&lt;br /&gt;
#Leverage the template JavaScript file at WEB-INF/Owasp.CsrfGuard.js&lt;br /&gt;
#Inject the token into all HTML forms&lt;br /&gt;
#Inject the token into all src and href attributes&lt;br /&gt;
#Leverage loose same origin matching criteria when placing the token in URL resources&lt;br /&gt;
&lt;br /&gt;
Consider the following for a more detailed listing of the initialization parameters supported by JavaScriptServlet:&lt;br /&gt;
&lt;br /&gt;
 source-file&lt;br /&gt;
&lt;br /&gt;
Denotes the location of the JavaScript template file that should be consumed and dynamically augmented by the JavaScriptServlet class. The default value is WEB-INF/Owasp.CsrfGuard.js. Use of this property and the existence of the specified template file is required. &lt;br /&gt;
&lt;br /&gt;
 domain-strict&lt;br /&gt;
&lt;br /&gt;
Boolean value that determines whether or not the dynamic JavaScript code should be strict with regards to what links it should inject the CSRF prevention token. With a value of true, the JavaScript code will only place the token in links that point to the same exact origin from which the HTML originated. With a value of false, the JavaScript code will place the token in links that contain, but may not exactly match, the originating domain.&lt;br /&gt;
&lt;br /&gt;
 referer-pattern&lt;br /&gt;
&lt;br /&gt;
Allows the developer to specify a regular expression describing the required value of the Referer header. Any attempts to access the servlet with a Referer header that does not match the captured expression is discarded. Inclusion of referer header checking is to help minimize the risk of JavaScript Hijacking attacks that attempt to steal tokens from the dynamically generated JavaScript. While the primary defenses against JavaScript Hijacking attacks are implemented within the dynamic JavaScript itself, referer header checking is implemented to achieve defense in depth.&lt;br /&gt;
&lt;br /&gt;
 cache-control&lt;br /&gt;
&lt;br /&gt;
Allows the developer to specify the value of the Cache-Control header in the HTTP response when serving the dynamic JavaScript file. The default value is private, maxage=28800. Caching of the dynamic JavaScript file is intended to minimize traffic and improve performance. Note that the Cache-Control header is always set to &amp;quot;no-store&amp;quot; when either the &amp;quot;Rotate&amp;quot; &amp;quot;TokenPerPage&amp;quot; options is set to true in Owasp.CsrfGuard.properties.&lt;br /&gt;
&lt;br /&gt;
 inject-into-forms&lt;br /&gt;
&lt;br /&gt;
Boolean value that determines whether or not the dynamic JavaScript code should inject the CSRF prevention token as a hidden field into HTML forms. The default value is true. Developers are strongly discouraged from disabling this property as most server-side state changing actions are triggered via a POST request.&lt;br /&gt;
&lt;br /&gt;
 inject-into-attributes&lt;br /&gt;
&lt;br /&gt;
Boolean value that determines whether or not the dynamic JavaScript code should inject the CSRF prevention token in the query string of src and href attributes. Injecting the CSRF prevention token in a URL resource increases its general risk of exposure to unauthorized parties. However, most JavaEE web applications respond in the exact same manner to HTTP requests and their associated parameters regardless of the HTTP method. The risk associated with not protecting GET requests in this situation is perceived greater than the risk of exposing the token in protected GET requests. As a result, the default value of this attribute is set to true. Developers that are confident their server-side state changing controllers will only respond to POST requests (i.e. discarding GET requests) are strongly encouraged to disable this property.&lt;br /&gt;
&lt;br /&gt;
== Map JavaScriptServlet ==&lt;br /&gt;
&lt;br /&gt;
Developers must map the JavaScriptServlet to a URI space such that the Servlet class can be remotely accessed by the dynamic JavaScript code. Consider the following configuration snippet taken directly from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;
      &amp;lt;servlet-name&amp;gt;JavaScriptServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;
      &amp;lt;url-pattern&amp;gt;/JavaScriptServlet&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;
 &amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The aforementioned configuration snippet maps the Servlet referenced by the name &amp;quot;JavaScriptServlet&amp;quot; to the URI space &amp;quot;/JavaScriptServlet&amp;quot;. Any request sent to the /JavaScriptServlet URI will produce a dynamically generated CSRFGuard JavaScript file specific to the user's current session.&lt;br /&gt;
&lt;br /&gt;
== Inject Dynamic JavaScript ==&lt;br /&gt;
&lt;br /&gt;
Developers are required to place an HTML script tag within all pages that are known to send requests to CSRF protected resources. All requests within the current HTML page are augmented to ensure they submit the correct CSRF token for the user's current session. Note that inclusion of the dynamic JavaScript does not protect the current page. Rather, the script ensures the CSRF token is transmitted within all requests generated by the current page. Consider the following code snippet taken directly from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!-- OWASP CSRFGuard Support --&amp;gt;&lt;br /&gt;
 &amp;lt;script src=&amp;quot;/Owasp.CsrfGuard.Test/JavaScriptServlet&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script tag retrieves and executes the dynamically generated JavaScript from the Servlet mapped at /Owasp.CsrfGuard.Test/JavaScriptServlet. This JavaScript code will register an event handler with window.onload. Once triggered, the code will iterate over every HTML element within the DOM looking for either form tags and or tags containing href or src attributes as configured by the JavaScriptServlet initialization parameters. Forms are dynamically updated to include the CSRFGuard token via a hidden field and tags using src and href attributes are updated to include the CSRFGuard token via a query string parameter.&lt;br /&gt;
&lt;br /&gt;
= JSP Tag Library =&lt;br /&gt;
&lt;br /&gt;
OWASP CSRFGuard 3 exposes a JSP tag library providing developers more fine grain control over token injection. The library exposes JSP tags that allow access to the token name, the token value, and the token name value pair delimited by an equals (=) sign. In order to make use of the tag library, ensure the Owasp.CsrfGuard.jar file is found within the target application's classpath. For example, the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application places the OWASP CSRFGuard jar file within the WebContent/WEB-INF/lib directory. After placing the library in the classpath, developers can reference the tags in JSP pages using predefined URI reference. The following JSP code snippet imports the tag library and makes it available using the prefix &amp;quot;csrf&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%@ taglib uri=&amp;quot;http://www.owasp.org/index.php/Category:OWASP_CSRFGuard_Project/Owasp.CsrfGuard.tld&amp;quot; prefix=&amp;quot;csrf&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The benefit of using the JSP tag library to inject the CSRF prevention token is the fine grain level of control. Developers can place the token in all the correct locations within the context of their applications. This strategy is useful in application contexts where the JavaScript DOM Manipulation strategy is insufficient.&lt;br /&gt;
&lt;br /&gt;
== Display Token Name ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard token name can be obtained through the token-name tag. The token-name tag is useful when injecting the CSRFGuard token name in a non-query string context. Consider the following code snippet taken from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application. This code makes use of the token-name tag to reference the token name in the name attribute of a hidden input field:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;form name=&amp;quot;test1&amp;quot; action=&amp;quot;protect.html&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; value=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;'''&amp;lt;csrf:token-name/&amp;gt;'''&amp;quot; value=&amp;quot;&amp;lt;csrf:token-value/&amp;gt;&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Display Token Value ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard token value can be obtained through the token-value tag. The token-value tag is useful when injecting the CSRFGuard token value in a non-query string context. Consider the following code snippet taken from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application. This code makes use of the token-value tag to reference the token value in the value attribute of a hidden input field:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;form name=&amp;quot;test1&amp;quot; action=&amp;quot;protect.html&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;text&amp;quot; value=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;submit&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;&amp;lt;csrf:token-name/&amp;gt;&amp;quot; value=&amp;quot;'''&amp;lt;csrf:token-value/&amp;gt;'''&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Display Token Name Value Pair ==&lt;br /&gt;
&lt;br /&gt;
The OWASP CSRFGuard token name value pair, delimited by an equals sign (=), can be obtained though the token tag. The token tag is useful when injecting the CSRFGuard token value in a query string context. Consider the following code snippet taken from the [http://code.google.com/p/owaspcsrfguard/source/browse/#svn/trunk/main/Owasp.CsrfGuard.Test Owasp.CsrfGuard.Test] application. This code makes use of the token tag to reference the token name value pair in the href attribute of an anchor tag:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;a href=&amp;quot;protect.html?&amp;lt;csrf:token/&amp;gt;&amp;quot;&amp;gt;protect.html&amp;lt;/a&amp;gt;&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CSRFGuard_3_User_Manual&amp;diff=96175</id>
		<title>CSRFGuard 3 User Manual</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CSRFGuard_3_User_Manual&amp;diff=96175"/>
				<updated>2010-12-13T22:55:42Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Token Injection */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
Welcome to the OWASP CSRFGuard 3 User Manual! The purpose of this article is to provide the user with guidance on obtaining, installing, deploying, and developing with the OWASP CSRFGuard library. The author's goal was to keep the User Manual informative, use to understand, and concise. If you find that one or more aspects of this document does not adhere to these goals, please me know at eric dot sheridan at owasp dot org.&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
Users can download the latest release of OWASP CSRFGuard using one of the following links:&lt;br /&gt;
&lt;br /&gt;
:[http://code.google.com/p/owaspcsrfguard/downloads/detail?name=OWASP%20CSRFGuard%20%283.0.0.245%20-%20ALPHA%29.zip&amp;amp;can=2&amp;amp;q= OWASP CSRFGuard 3.0.0.245 (ALPHA)] - download the latest development release with binary and associated configuration files '''(recommended)'''.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
Installation of OWASP CSRFGuard 3 is very straight forward requiring three simple steps:&lt;br /&gt;
&lt;br /&gt;
:# Copy the Owasp.CsrfGuard.jar file to your application's classpath&lt;br /&gt;
:# Map the CsrfGuardFilter in your application's deployment descriptor (web.xml)&lt;br /&gt;
:# Configure the Owasp.CsrfGuard.properties file as you see fit&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Installation | Click here]] for more detailed information regarding the installation of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
&lt;br /&gt;
The minimum configuration settings that users should review include:&lt;br /&gt;
&lt;br /&gt;
:* Default new token landing page (org.owasp.csrfguard.NewTokenLandingPage)&lt;br /&gt;
:* Support for Ajax and XMLHttpRequest (org.owasp.csrfguard.Ajax)&lt;br /&gt;
:* URI resources that should not be protected (org.owasp.csrfguard.unprotected.*)&lt;br /&gt;
:* Actions executed when an attack is detected (org.owasp.csrfguard.action.*)&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Configuration | Click here]] for more information regarding the configuration of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
= Token Injection =&lt;br /&gt;
&lt;br /&gt;
Users of OWASP CSRFGuard can inject prevention tokens into HTML using two strategies:&lt;br /&gt;
&lt;br /&gt;
:* JavaScript DOM Manipulation - largely automated process requiring minimal effort and is ideal for most web applications&lt;br /&gt;
:* JSP Tag Library - provides fine grained strategy ideal for situations where automated DOM manipulation is insufficient.&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Token_Injection | Click here]] for more information regarding the injection of CSRF prevention tokens within your application.&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_CSRFGuard_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CSRFGuard_3_User_Manual&amp;diff=96173</id>
		<title>CSRFGuard 3 User Manual</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CSRFGuard_3_User_Manual&amp;diff=96173"/>
				<updated>2010-12-13T22:54:04Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Token Injection */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
Welcome to the OWASP CSRFGuard 3 User Manual! The purpose of this article is to provide the user with guidance on obtaining, installing, deploying, and developing with the OWASP CSRFGuard library. The author's goal was to keep the User Manual informative, use to understand, and concise. If you find that one or more aspects of this document does not adhere to these goals, please me know at eric dot sheridan at owasp dot org.&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
Users can download the latest release of OWASP CSRFGuard using one of the following links:&lt;br /&gt;
&lt;br /&gt;
:[http://code.google.com/p/owaspcsrfguard/downloads/detail?name=OWASP%20CSRFGuard%20%283.0.0.245%20-%20ALPHA%29.zip&amp;amp;can=2&amp;amp;q= OWASP CSRFGuard 3.0.0.245 (ALPHA)] - download the latest development release with binary and associated configuration files '''(recommended)'''.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
Installation of OWASP CSRFGuard 3 is very straight forward requiring three simple steps:&lt;br /&gt;
&lt;br /&gt;
:# Copy the Owasp.CsrfGuard.jar file to your application's classpath&lt;br /&gt;
:# Map the CsrfGuardFilter in your application's deployment descriptor (web.xml)&lt;br /&gt;
:# Configure the Owasp.CsrfGuard.properties file as you see fit&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Installation | Click here]] for more detailed information regarding the installation of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
&lt;br /&gt;
The minimum configuration settings that users should review include:&lt;br /&gt;
&lt;br /&gt;
:* Default new token landing page (org.owasp.csrfguard.NewTokenLandingPage)&lt;br /&gt;
:* Support for Ajax and XMLHttpRequest (org.owasp.csrfguard.Ajax)&lt;br /&gt;
:* URI resources that should not be protected (org.owasp.csrfguard.unprotected.*)&lt;br /&gt;
:* Actions executed when an attack is detected (org.owasp.csrfguard.action.*)&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Configuration | Click here]] for more information regarding the configuration of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
= Token Injection =&lt;br /&gt;
&lt;br /&gt;
Users of OWASP CSRFGuard can inject prevention tokens into HTML using two strategies:&lt;br /&gt;
&lt;br /&gt;
:* JavaScript DOM Manipulation&lt;br /&gt;
:* JSP Tag Library&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Token_Injection | Click here]] for more information regarding the injection of CSRF prevention tokens within your application.&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_CSRFGuard_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CSRFGuard_3_User_Manual&amp;diff=96172</id>
		<title>CSRFGuard 3 User Manual</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CSRFGuard_3_User_Manual&amp;diff=96172"/>
				<updated>2010-12-13T22:53:21Z</updated>
		
		<summary type="html">&lt;p&gt;Esheridan: /* Token Injection */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
Welcome to the OWASP CSRFGuard 3 User Manual! The purpose of this article is to provide the user with guidance on obtaining, installing, deploying, and developing with the OWASP CSRFGuard library. The author's goal was to keep the User Manual informative, use to understand, and concise. If you find that one or more aspects of this document does not adhere to these goals, please me know at eric dot sheridan at owasp dot org.&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
Users can download the latest release of OWASP CSRFGuard using one of the following links:&lt;br /&gt;
&lt;br /&gt;
:[http://code.google.com/p/owaspcsrfguard/downloads/detail?name=OWASP%20CSRFGuard%20%283.0.0.245%20-%20ALPHA%29.zip&amp;amp;can=2&amp;amp;q= OWASP CSRFGuard 3.0.0.245 (ALPHA)] - download the latest development release with binary and associated configuration files '''(recommended)'''.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
Installation of OWASP CSRFGuard 3 is very straight forward requiring three simple steps:&lt;br /&gt;
&lt;br /&gt;
:# Copy the Owasp.CsrfGuard.jar file to your application's classpath&lt;br /&gt;
:# Map the CsrfGuardFilter in your application's deployment descriptor (web.xml)&lt;br /&gt;
:# Configure the Owasp.CsrfGuard.properties file as you see fit&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Installation | Click here]] for more detailed information regarding the installation of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
&lt;br /&gt;
The minimum configuration settings that users should review include:&lt;br /&gt;
&lt;br /&gt;
:* Default new token landing page (org.owasp.csrfguard.NewTokenLandingPage)&lt;br /&gt;
:* Support for Ajax and XMLHttpRequest (org.owasp.csrfguard.Ajax)&lt;br /&gt;
:* URI resources that should not be protected (org.owasp.csrfguard.unprotected.*)&lt;br /&gt;
:* Actions executed when an attack is detected (org.owasp.csrfguard.action.*)&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Configuration | Click here]] for more information regarding the configuration of OWASP CSRFGuard.&lt;br /&gt;
&lt;br /&gt;
= Token Injection =&lt;br /&gt;
&lt;br /&gt;
Users of OWASP CSRFGuard can inject prevention tokens into HTML using JavaScript DOM Manipulation and or the JSP Tag Library. JavaScript DOM Manipulation requires minimal effort on behalf of the developer and is ideal for most web based applications. The JSP tag library should be utilized in situations where the JavaScript DOM Manipulation token injection strategy is found to be technically insufficient. Together, the JavaScript DOM Manipulation and the JSP tag library provide strong and fine grain means of integrating CSRF prevention tokens within application presentation logic.&lt;br /&gt;
&lt;br /&gt;
[[CSRFGuard_3_Token_Injection | Click here]] for more information regarding the injection of CSRF prevention tokens within your application.&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_CSRFGuard_Project]]&lt;/div&gt;</summary>
		<author><name>Esheridan</name></author>	</entry>

	</feed>