<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.mozilla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mtl</id>
	<title>MozillaWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.mozilla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mtl"/>
	<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/Special:Contributions/Mtl"/>
	<updated>2026-05-02T19:31:45Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.10</generator>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177780</id>
		<title>Security/CSP/CSRFModule</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177780"/>
		<updated>2009-10-22T18:06:17Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* anti-csrf */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of [http://en.wikipedia.org/wiki/Cross-site_request_forgery cross-site request forgery] vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot; / &amp;quot;cookieless-images&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;&amp;amp;lt;img src=&amp;amp;hellip;&amp;amp;gt;&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;&amp;amp;lt;link href=&amp;amp;hellip;&amp;amp;gt;&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;&amp;amp;lt;script src=&amp;amp;hellip;&amp;amp;gt;&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;&amp;amp;lt;iframe src=&amp;amp;hellip;&amp;amp;gt;&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other NECESSARY and SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive protects websites against CSRF attacks by preventing authorization tokens stored in cookies from being sent in different-origin HTTP requests.  Without &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;, the attacker is able to cause the user agent to submit fraudulent requests to websites where the user has an active, authenticated browsing session.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive DOES NOT protect a website against CSRF attacks against itself (where &amp;lt;i&amp;gt;itself&amp;lt;/i&amp;gt; is defined as the set of &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs).  Nor does &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; protect against CSRF for such websites that authorize HTTP requests by some mechanism other than &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request headers (e.g., implicit authorization based on requester&#039;s IP address).  However, &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; DOES enable a website to protect its users from being victimized by attacks originating from said website, targeted at certain other websites the user has a relationship with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Documents that enable &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; must not depend on external resources that are only accessible via &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt;-authorized HTTP request.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;cookieless-images&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
TODO: Affects all images, regardless of where they are loaded from.  Cookies are also disallowed over all redirects encountered while locating the image.&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues. &lt;br /&gt;
&lt;br /&gt;
*Any policy governing the sending of cookies to URIs other than &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; requires enforcement of the policy over all HTTP redirects encountered while loading the URI.  (Presumably &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; is in control of its redirects.)  Enforcement of CSP policies over redirects may be in conflict with [[Security/CSP/BaseModule|BaseModule]], if BaseModule defines CSP policies to be non-composeable, and any redirect or the resource declares a CSP policy.&lt;br /&gt;
*The attacker could bypass the defense by hyperlinking to attacker.com, which isn&#039;t using CSP, and then submit the CSRF request from there.&lt;br /&gt;
**To address this threat, form submission should only be allowed to &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs when &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; is enabled (the allowed set of URIs should be made extensible by other policy declarations).&lt;br /&gt;
**Link activations are still vulnerable to this attack, however.&lt;br /&gt;
*The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; list of HTTP requests where &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; header is allowed to be sent must be exhaustive.&lt;br /&gt;
*The CSP policy should be allowed to contain URI that are excepted from &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; restrictions.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177774</id>
		<title>Security/CSP/CSRFModule</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177774"/>
		<updated>2009-10-22T17:58:30Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* cookieless-images */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of [http://en.wikipedia.org/wiki/Cross-site_request_forgery cross-site request forgery] vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot; / &amp;quot;cookieless-images&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other NECESSARY and SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive protects websites against CSRF attacks by preventing authorization tokens stored in cookies from being sent in different-origin HTTP requests.  Without &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;, the attacker is able to cause the user agent to submit fraudulent requests to websites where the user has an active, authenticated browsing session.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive DOES NOT protect a website against CSRF attacks against itself (where &amp;lt;i&amp;gt;itself&amp;lt;/i&amp;gt; is defined as the set of &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs).  Nor does &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; protect against CSRF for such websites that authorize HTTP requests by some mechanism other than &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request headers (e.g., implicit authorization based on requester&#039;s IP address).  However, &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; DOES enable a website to protect its users from being victimized by attacks originating from said website, targeted at certain other websites the user has a relationship with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Documents that enable &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; must not depend on external resources that are only accessible via &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt;-authorized HTTP request.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;cookieless-images&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
TODO: Affects all images, regardless of where they are loaded from.  Cookies are also disallowed over all redirects encountered while locating the image.&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues. &lt;br /&gt;
&lt;br /&gt;
*Any policy governing the sending of cookies to URIs other than &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; requires enforcement of the policy over all HTTP redirects encountered while loading the URI.  (Presumably &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; is in control of its redirects.)  Enforcement of CSP policies over redirects may be in conflict with [[Security/CSP/BaseModule|BaseModule]], if BaseModule defines CSP policies to be non-composeable, and any redirect or the resource declares a CSP policy.&lt;br /&gt;
*The attacker could bypass the defense by hyperlinking to attacker.com, which isn&#039;t using CSP, and then submit the CSRF request from there.&lt;br /&gt;
**To address this threat, form submission should only be allowed to &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs when &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; is enabled (the allowed set of URIs should be made extensible by other policy declarations).&lt;br /&gt;
**Link activations are still vulnerable to this attack, however.&lt;br /&gt;
*The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; list of HTTP requests where &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; header is allowed to be sent must be exhaustive.&lt;br /&gt;
*The CSP policy should be allowed to contain URI that are excepted from &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; restrictions.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177773</id>
		<title>Security/CSP/CSRFModule</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177773"/>
		<updated>2009-10-22T17:55:46Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* Open Issues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of [http://en.wikipedia.org/wiki/Cross-site_request_forgery cross-site request forgery] vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot; / &amp;quot;cookieless-images&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other NECESSARY and SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive protects websites against CSRF attacks by preventing authorization tokens stored in cookies from being sent in different-origin HTTP requests.  Without &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;, the attacker is able to cause the user agent to submit fraudulent requests to websites where the user has an active, authenticated browsing session.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive DOES NOT protect a website against CSRF attacks against itself (where &amp;lt;i&amp;gt;itself&amp;lt;/i&amp;gt; is defined as the set of &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs).  Nor does &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; protect against CSRF for such websites that authorize HTTP requests by some mechanism other than &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request headers (e.g., implicit authorization based on requester&#039;s IP address).  However, &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; DOES enable a website to protect its users from being victimized by attacks originating from said website, targeted at certain other websites the user has a relationship with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Documents that enable &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; must not depend on external resources that are only accessible via &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt;-authorized HTTP request.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;cookieless-images&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
TODO: Affects all images, regardless of where they are loaded from.&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues. &lt;br /&gt;
&lt;br /&gt;
*Any policy governing the sending of cookies to URIs other than &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; requires enforcement of the policy over all HTTP redirects encountered while loading the URI.  (Presumably &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; is in control of its redirects.)  Enforcement of CSP policies over redirects may be in conflict with [[Security/CSP/BaseModule|BaseModule]], if BaseModule defines CSP policies to be non-composeable, and any redirect or the resource declares a CSP policy.&lt;br /&gt;
*The attacker could bypass the defense by hyperlinking to attacker.com, which isn&#039;t using CSP, and then submit the CSRF request from there.&lt;br /&gt;
**To address this threat, form submission should only be allowed to &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs when &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; is enabled (the allowed set of URIs should be made extensible by other policy declarations).&lt;br /&gt;
**Link activations are still vulnerable to this attack, however.&lt;br /&gt;
*The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; list of HTTP requests where &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; header is allowed to be sent must be exhaustive.&lt;br /&gt;
*The CSP policy should be allowed to contain URI that are excepted from &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; restrictions.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177769</id>
		<title>Security/CSP/CSRFModule</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177769"/>
		<updated>2009-10-22T17:51:13Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* Open Issues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of [http://en.wikipedia.org/wiki/Cross-site_request_forgery cross-site request forgery] vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot; / &amp;quot;cookieless-images&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other NECESSARY and SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive protects websites against CSRF attacks by preventing authorization tokens stored in cookies from being sent in different-origin HTTP requests.  Without &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;, the attacker is able to cause the user agent to submit fraudulent requests to websites where the user has an active, authenticated browsing session.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive DOES NOT protect a website against CSRF attacks against itself (where &amp;lt;i&amp;gt;itself&amp;lt;/i&amp;gt; is defined as the set of &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs).  Nor does &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; protect against CSRF for such websites that authorize HTTP requests by some mechanism other than &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request headers (e.g., implicit authorization based on requester&#039;s IP address).  However, &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; DOES enable a website to protect its users from being victimized by attacks originating from said website, targeted at certain other websites the user has a relationship with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Documents that enable &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; must not depend on external resources that are only accessible via &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt;-authorized HTTP request.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;cookieless-images&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
TODO: Affects all images, regardless of where they are loaded from.&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues. &lt;br /&gt;
&lt;br /&gt;
*Any policy governing the sending of cookies to URIs other than &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; requires enforcement of the policy over all HTTP redirects encountered while loading the URI.  (Presumably &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; is in control of its redirects.)  Enforcement of CSP policies over redirects may be in conflict with [[Security/CSP/BaseModule|BaseModule]], if BaseModule defines CSP policies to be non-composeable, and any redirect or the resource declares a CSP policy.&lt;br /&gt;
*The attacker could bypass the defense by hyperlinking to attacker.com, which isn&#039;t using CSP, and then submit the CSRF request from there.&lt;br /&gt;
**To address this threat, form submission should only be allowed to &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs when &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; is enabled (the allowed set of URIs should be made extensible by other policy declarations).&lt;br /&gt;
**Link activations are still vulnerable to this attack, however.&lt;br /&gt;
*The list of HTTP requests where &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; header is allowed to be sent must be exhaustive.&lt;br /&gt;
*The CSP policy should be allowed to contain URI that are excepted from &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; restrictions.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177768</id>
		<title>Security/CSP/CSRFModule</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177768"/>
		<updated>2009-10-22T17:50:07Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* Open Issues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of [http://en.wikipedia.org/wiki/Cross-site_request_forgery cross-site request forgery] vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot; / &amp;quot;cookieless-images&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other NECESSARY and SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive protects websites against CSRF attacks by preventing authorization tokens stored in cookies from being sent in different-origin HTTP requests.  Without &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;, the attacker is able to cause the user agent to submit fraudulent requests to websites where the user has an active, authenticated browsing session.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive DOES NOT protect a website against CSRF attacks against itself (where &amp;lt;i&amp;gt;itself&amp;lt;/i&amp;gt; is defined as the set of &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs).  Nor does &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; protect against CSRF for such websites that authorize HTTP requests by some mechanism other than &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request headers (e.g., implicit authorization based on requester&#039;s IP address).  However, &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; DOES enable a website to protect its users from being victimized by attacks originating from said website, targeted at certain other websites the user has a relationship with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Documents that enable &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; must not depend on external resources that are only accessible via &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt;-authorized HTTP request.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;cookieless-images&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
TODO: Affects all images, regardless of where they are loaded from.&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues. &lt;br /&gt;
&lt;br /&gt;
*Any policy governing the sending of cookies to URIs other than &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; requires enforcement of the policy over all HTTP redirects encountered while loading the URI.  (Presumably &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; is in control of its redirects.)  CSP policy enforcement may be in conflict with [[Security/CSP/BaseModule|BaseModule]], if BaseModule defines CSP policies to be non-composeable, and any redirect or the resource declares a CSP policy.&lt;br /&gt;
*The attacker could bypass the defense by hyperlinking to attacker.com, which isn&#039;t using CSP, and then submit the CSRF request from there.&lt;br /&gt;
**To address this threat, form submission should only be allowed to &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs when &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; is enabled (the allowed set of URIs should be made extensible by other policy declarations).&lt;br /&gt;
**Link activations are still vulnerable to this attack, however.&lt;br /&gt;
*The list of HTTP requests where &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; header is allowed to be sent must be exhaustive.&lt;br /&gt;
*The CSP policy should be allowed to contain URI that are excepted from &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; restrictions.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177765</id>
		<title>Security/CSP/CSRFModule</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177765"/>
		<updated>2009-10-22T17:47:44Z</updated>

		<summary type="html">&lt;p&gt;Mtl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of [http://en.wikipedia.org/wiki/Cross-site_request_forgery cross-site request forgery] vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot; / &amp;quot;cookieless-images&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other NECESSARY and SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive protects websites against CSRF attacks by preventing authorization tokens stored in cookies from being sent in different-origin HTTP requests.  Without &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;, the attacker is able to cause the user agent to submit fraudulent requests to websites where the user has an active, authenticated browsing session.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive DOES NOT protect a website against CSRF attacks against itself (where &amp;lt;i&amp;gt;itself&amp;lt;/i&amp;gt; is defined as the set of &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs).  Nor does &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; protect against CSRF for such websites that authorize HTTP requests by some mechanism other than &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request headers (e.g., implicit authorization based on requester&#039;s IP address).  However, &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; DOES enable a website to protect its users from being victimized by attacks originating from said website, targeted at certain other websites the user has a relationship with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Documents that enable &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; must not depend on external resources that are only accessible via &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt;-authorized HTTP request.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;cookieless-images&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
TODO: Affects all images, regardless of where they are loaded from.&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues. &lt;br /&gt;
&lt;br /&gt;
*Any policy governing the sending of cookies to URIs other than |self| requires enforcement of the policy over all HTTP redirects encountered while loading the URI.  This may be in conflict with [[Security/CSP/BaseModule|BaseModule]] if BaseModule defines CSP policies to be non-composeable.&lt;br /&gt;
*The attacker could bypass the defense by hyperlinking to attacker.com, which isn&#039;t using CSP, and then submit the CSRF request from there.&lt;br /&gt;
**To address this threat, form submission should only be allowed to &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs when &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; is enabled (the allowed set of URIs should be made extensible by other policy declarations).&lt;br /&gt;
**Link activations are still vulnerable to this attack, however.&lt;br /&gt;
*The list of HTTP requests where &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; header is allowed to be sent must be exhaustive.&lt;br /&gt;
*The CSP policy should be allowed to contain URI that are excepted from &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; restrictions.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177763</id>
		<title>Security/CSP/CSRFModule</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177763"/>
		<updated>2009-10-22T17:46:09Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* Open Issues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of [http://en.wikipedia.org/wiki/Cross-site_request_forgery cross-site request forgery] vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot; / &amp;quot;cookieless-images&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other NECESSARY and SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive protects websites against CSRF attacks by preventing authorization tokens stored in cookies from being sent in different-origin HTTP requests.  Without &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;, the attacker is able to cause the user agent to submit fraudulent requests to websites where the user has an active, authenticated browsing session.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive DOES NOT protect a website against CSRF attacks against itself (where &amp;lt;i&amp;gt;itself&amp;lt;/i&amp;gt; is defined as the set of &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs).  Nor does &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; protect against CSRF for such websites that authorize HTTP requests by some mechanism other than &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request headers (e.g., implicit authorization based on requester&#039;s IP address).  However, &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; DOES enable a website to protect its users from being victimized by attacks originating from said website, targeted at certain other websites the user has a relationship with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Documents that enable &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; must not depend on external resources that are only accessible via &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt;-authorized HTTP request.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;cookieless-images&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
TODO: Affects all images, regardless of where they are loaded from.&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues. &lt;br /&gt;
&lt;br /&gt;
*Any policy governing the sending of cookies to URIs other than |self| requires enforcement of the policy over all HTTP redirects encountered while loading the URI.  This may be in conflict with BaseModule if CSP policies are not composeable.&lt;br /&gt;
*The attacker could bypass the defense by hyperlinking to attacker.com, which isn&#039;t using CSP, and then submit the CSRF request from there.&lt;br /&gt;
**To address this threat, form submission should only be allowed to &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs when &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; is enabled (the allowed set of URIs should be made extensible by other policy declarations).&lt;br /&gt;
**Link activations are still vulnerable to this attack, however.&lt;br /&gt;
*The list of HTTP requests where &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; header is allowed to be sent must be exhaustive.&lt;br /&gt;
*The CSP policy should be allowed to contain URI that are excepted from &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; restrictions.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177754</id>
		<title>Security/CSP/CSRFModule</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177754"/>
		<updated>2009-10-22T17:11:25Z</updated>

		<summary type="html">&lt;p&gt;Mtl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of [http://en.wikipedia.org/wiki/Cross-site_request_forgery cross-site request forgery] vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot; / &amp;quot;cookieless-images&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other NECESSARY and SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive protects websites against CSRF attacks by preventing authorization tokens stored in cookies from being sent in different-origin HTTP requests.  Without &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;, the attacker is able to cause the user agent to submit fraudulent requests to websites where the user has an active, authenticated browsing session.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive DOES NOT protect a website against CSRF attacks against itself (where &amp;lt;i&amp;gt;itself&amp;lt;/i&amp;gt; is defined as the set of &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs).  Nor does &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; protect against CSRF for such websites that authorize HTTP requests by some mechanism other than &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request headers (e.g., implicit authorization based on requester&#039;s IP address).  However, &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; DOES enable a website to protect its users from being victimized by attacks originating from said website, targeted at certain other websites the user has a relationship with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Documents that enable &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; must not depend on external resources that are only accessible via &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt;-authorized HTTP request.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;cookieless-images&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
TODO: Affects all images, regardless of where they are loaded from.&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues. &lt;br /&gt;
&lt;br /&gt;
*The attacker could bypass the defense by hyperlinking to attacker.com, which isn&#039;t using CSP, and then submit the CSRF request from there.&lt;br /&gt;
**To address this threat, form submission should only be allowed to &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs when &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; is enabled (the allowed set of URIs should be made extensible by other policy declarations).&lt;br /&gt;
**Link activations are still vulnerable to this attack, however.&lt;br /&gt;
*The list of HTTP requests where &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; header is allowed to be sent must be exhaustive.&lt;br /&gt;
*The CSP policy should be allowed to contain URI that are excepted from &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; restrictions.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177753</id>
		<title>Security/CSP/CSRFModule</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177753"/>
		<updated>2009-10-22T17:10:21Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of [http://en.wikipedia.org/wiki/Cross-site_request_forgery cross-site request forgery] vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot; / &amp;quot;cookieless-images&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other NECESSARY and SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive protects websites against CSRF attacks by preventing authorization tokens stored in cookies from being sent in different-origin HTTP requests.  Without &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;, the attacker is able to cause the user agent to submit fraudulent requests to websites where the user has an active, authenticated browsing session.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive DOES NOT protect a website against CSRF attacks against itself (where &amp;lt;i&amp;gt;itself&amp;lt;/i&amp;gt; is defined as the set of &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs).  Nor does &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; protect against CSRF for such websites that authorize HTTP requests by some mechanism other than &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request headers (e.g., implicit authorization based on requester&#039;s IP address).  However, &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; DOES enable a website to protect its users from being victimized by attacks originating from said website, targeted at certain other websites the user has a relationship with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Documents that enable &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; must not depend on external resources that are only accessible via &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt;-authorized HTTP request.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues. &lt;br /&gt;
&lt;br /&gt;
*The attacker could bypass the defense by hyperlinking to attacker.com, which isn&#039;t using CSP, and then submit the CSRF request from there.&lt;br /&gt;
**To address this threat, form submission should only be allowed to &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs when &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; is enabled (the allowed set of URIs should be made extensible by other policy declarations).&lt;br /&gt;
**Link activations are still vulnerable to this attack, however.&lt;br /&gt;
*The list of HTTP requests where &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; header is allowed to be sent must be exhaustive.&lt;br /&gt;
*The CSP policy should be allowed to contain URI that are excepted from &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; restrictions.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177750</id>
		<title>Security/CSP/CSRFModule</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177750"/>
		<updated>2009-10-22T17:00:01Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* Open Issues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of [http://en.wikipedia.org/wiki/Cross-site_request_forgery cross-site request forgery] vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other NECESSARY and SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive protects websites against CSRF attacks by preventing authorization tokens stored in cookies from being sent in different-origin HTTP requests.  Without &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;, the attacker is able to cause the user agent to submit fraudulent requests to websites where the user has an active, authenticated browsing session.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive DOES NOT protect a website against CSRF attacks against itself (where &amp;lt;i&amp;gt;itself&amp;lt;/i&amp;gt; is defined as the set of &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs).  Nor does &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; protect against CSRF for such websites that authorize HTTP requests by some mechanism other than &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request headers (e.g., implicit authorization based on requester&#039;s IP address).  However, &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; DOES enable a website to protect its users from being victimized by attacks originating from said website, targeted at certain other websites the user has a relationship with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Documents that enable &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; must not depend on external resources that are only accessible via &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt;-authorized HTTP request.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues. &lt;br /&gt;
&lt;br /&gt;
*The attacker could bypass the defense by hyperlinking to attacker.com, which isn&#039;t using CSP, and then submit the CSRF request from there.&lt;br /&gt;
**To address this threat, form submission should only be allowed to &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs when &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; is enabled (the allowed set of URIs should be made extensible by other policy declarations).&lt;br /&gt;
**Link activations are still vulnerable to this attack, however.&lt;br /&gt;
*The list of HTTP requests where &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; header is allowed to be sent must be exhaustive.&lt;br /&gt;
*The CSP policy should be allowed to contain URI that are excepted from &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; restrictions.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177749</id>
		<title>Security/CSP/CSRFModule</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177749"/>
		<updated>2009-10-22T16:59:21Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* Open Issues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of [http://en.wikipedia.org/wiki/Cross-site_request_forgery cross-site request forgery] vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other NECESSARY and SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive protects websites against CSRF attacks by preventing authorization tokens stored in cookies from being sent in different-origin HTTP requests.  Without &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;, the attacker is able to cause the user agent to submit fraudulent requests to websites where the user has an active, authenticated browsing session.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive DOES NOT protect a website against CSRF attacks against itself (where &amp;lt;i&amp;gt;itself&amp;lt;/i&amp;gt; is defined as the set of &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs).  Nor does &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; protect against CSRF for such websites that authorize HTTP requests by some mechanism other than &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request headers (e.g., implicit authorization based on requester&#039;s IP address).  However, &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; DOES enable a website to protect its users from being victimized by attacks originating from said website, targeted at certain other websites the user has a relationship with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Documents that enable &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; must not depend on external resources that are only accessible via &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt;-authorized HTTP request.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues. &lt;br /&gt;
&lt;br /&gt;
*The attacker could bypass the defense by hyperlinking to attacker.com, which isn&#039;t using CSP, and then submit the CSRF request from there.  Form submission should only be allowed to &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs when &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; is enabled (the allowed set of URIs should be made extensible by other policy declarations).  Link activations are still vulnerable to this attack, however.&lt;br /&gt;
*The list of HTTP requests where &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; header is allowed to be sent must be exhaustive.&lt;br /&gt;
*The CSP policy should be allowed to contain URI that are excepted from &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; restrictions.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177747</id>
		<title>Security/CSP/CSRFModule</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177747"/>
		<updated>2009-10-22T16:54:03Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* anti-csrf */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of [http://en.wikipedia.org/wiki/Cross-site_request_forgery cross-site request forgery] vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other NECESSARY and SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive protects websites against CSRF attacks by preventing authorization tokens stored in cookies from being sent in different-origin HTTP requests.  Without &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;, the attacker is able to cause the user agent to submit fraudulent requests to websites where the user has an active, authenticated browsing session.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive DOES NOT protect a website against CSRF attacks against itself (where &amp;lt;i&amp;gt;itself&amp;lt;/i&amp;gt; is defined as the set of &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs).  Nor does &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; protect against CSRF for such websites that authorize HTTP requests by some mechanism other than &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request headers (e.g., implicit authorization based on requester&#039;s IP address).  However, &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; DOES enable a website to protect its users from being victimized by attacks originating from said website, targeted at certain other websites the user has a relationship with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Documents that enable &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; must not depend on external resources that are only accessible via &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt;-authorized HTTP request.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues. &lt;br /&gt;
&lt;br /&gt;
*The attacker could bypass the defense by hyperlinking to attacker.com, which isn&#039;t using CSP, and then submit the CSRF request from there.&lt;br /&gt;
*The list of HTTP requests where &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; header is allowed to be sent must be exhaustive.&lt;br /&gt;
*The CSP policy should be allowed to contain URI that are excepted from &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; restrictions.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177735</id>
		<title>Security/CSP/CSRFModule</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Security/CSP/CSRFModule&amp;diff=177735"/>
		<updated>2009-10-22T15:52:20Z</updated>

		<summary type="html">&lt;p&gt;Mtl: Created page with &amp;#039;= Overview =  This document defines the CSRFModule, which contains the cross-site request forgery mitigations. The CSRFModule lets web developers mitigate CSRF attacks by disabli…&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of [http://en.wikipedia.org/wiki/Cross-site_request_forgery cross-site request forgery] vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other NECESSARY and SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive protects websites against CSRF attacks by preventing authorization tokens stored in cookies from being sent in different-origin HTTP requests.  Without &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;, the attacker is able to cause the user agent to submit fraudulent requests to websites where the user has an active, authenticated browsing session.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive DOES NOT protect a website against CSRF attacks against itself (where &amp;lt;i&amp;gt;itself&amp;lt;/i&amp;gt; is defined as the set of &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs).  Nor does &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; protect against CSRF for such websites that authorize HTTP requests by some mechanism other than &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request headers (e.g., implicit authorization based on requester&#039;s IP address).  However, &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; DOES enable a website to protect its users from being victimized by attacks originating from said website, targeted at certain other websites the user has a relationship with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Documents that enable &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; must not depend on external resources that are only accessible via &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; authenticated HTTP request.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues. &lt;br /&gt;
&lt;br /&gt;
*The list of HTTP requests where &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; header is allowed to be sent must be exhaustive.&lt;br /&gt;
*The CSP policy should be allowed to contain URI that are excepted from &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; restrictions.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Security/CSP/Modules&amp;diff=177733</id>
		<title>Security/CSP/Modules</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Security/CSP/Modules&amp;diff=177733"/>
		<updated>2009-10-22T15:51:54Z</updated>

		<summary type="html">&lt;p&gt;Mtl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the status of the various CSP modules: &lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;200&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;1&amp;quot; cellspacing=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Module &lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| [[Security/CSP/BaseModule|BaseModule]]&lt;br /&gt;
| Required&lt;br /&gt;
|-&lt;br /&gt;
| [[Security/CSP/XSSModule|XSSModule]] &lt;br /&gt;
| Recommended&lt;br /&gt;
|-&lt;br /&gt;
| [[Security/CSP/HistoryModule|HistoryModule]] &lt;br /&gt;
| Experimental&lt;br /&gt;
|-&lt;br /&gt;
| [[Security/CSP/ClickJackingModule|ClickJackingModule]] &lt;br /&gt;
| Experimental&lt;br /&gt;
|-&lt;br /&gt;
| [[Security/CSP/CSRFModule|CSRFModule]] &lt;br /&gt;
| Experimental&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177732</id>
		<title>User:Mtl</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177732"/>
		<updated>2009-10-22T15:50:36Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* anti-csrf */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of [http://en.wikipedia.org/wiki/Cross-site_request_forgery cross-site request forgery] vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other NECESSARY and SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive protects websites against CSRF attacks by preventing authorization tokens stored in cookies from being sent in different-origin HTTP requests.  Without &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;, the attacker is able to cause the user agent to submit fraudulent requests to websites where the user has an active, authenticated browsing session.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive DOES NOT protect a website against CSRF attacks against itself (where &amp;lt;i&amp;gt;itself&amp;lt;/i&amp;gt; is defined as the set of &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs).  Nor does &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; protect against CSRF for such websites that authorize HTTP requests by some mechanism other than &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request headers (e.g., implicit authorization based on requester&#039;s IP address).  However, &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; DOES enable a website to protect its users from being victimized by attacks originating from said website, targeted at certain other websites the user has a relationship with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Documents that enable &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; must not depend on external resources that are only accessible via &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; authenticated HTTP request.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues. &lt;br /&gt;
&lt;br /&gt;
*The list of HTTP requests where &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; header is allowed to be sent must be exhaustive.&lt;br /&gt;
*The CSP policy should be allowed to contain URI that are excepted from &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; restrictions.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177731</id>
		<title>User:Mtl</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177731"/>
		<updated>2009-10-22T15:49:39Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* anti-csrf */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of [http://en.wikipedia.org/wiki/Cross-site_request_forgery cross-site request forgery] vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other NECESSARY and SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive protects websites against CSRF attacks by preventing authorization tokens stored in cookies from being sent in different-origin HTTP requests.  Without &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;, the attacker is able to cause the user agent to submit fraudulent requests to websites where the user has an active, authenticated browsing session.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive DOES NOT protect a website against CSRF attacks against itself (where &amp;lt;i&amp;gt;itself&amp;lt;/i&amp;gt; is defined as the set of &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs).  Nor does &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; protect against CSRF for such websites that authorize HTTP requests by some mechanism other than &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request headers (e.g., implicit authorization based on requester&#039;s IP address).  However, &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; DOES enable a website to protect its users from being victimized by attacks originating from said website, targeted at other websites the user has a relationship with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Documents that enable &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; must not depend on external resources that are only accessible via &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; authenticated HTTP request.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues. &lt;br /&gt;
&lt;br /&gt;
*The list of HTTP requests where &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; header is allowed to be sent must be exhaustive.&lt;br /&gt;
*The CSP policy should be allowed to contain URI that are excepted from &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; restrictions.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177729</id>
		<title>User:Mtl</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177729"/>
		<updated>2009-10-22T15:46:24Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* Threat Model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of [http://en.wikipedia.org/wiki/Cross-site_request_forgery cross-site request forgery] vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other NECESSARY and SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive protects websites against CSRF attacks by preventing authorization tokens stored in cookies from being sent in different-origin HTTP requests.  Without &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;, the attacker is able to cause the user agent to submit fraudulent requests to websites where the user has an active, authenticated browsing session.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive DOES NOT protect a website against CSRF attacks against itself (where &amp;lt;i&amp;gt;itself&amp;lt;/i&amp;gt; is defined as the set of &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs).  Nor does &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; protect against CSRF for such websites that authorize HTTP requests by some mechanism other than &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request headers (e.g., implicit authorization based on requester&#039;s IP address).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Documents that enable &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; must not depend on external resources that are only accessible via &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; authenticated HTTP request.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues. &lt;br /&gt;
&lt;br /&gt;
*The list of HTTP requests where &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; header is allowed to be sent must be exhaustive.&lt;br /&gt;
*The CSP policy should be allowed to contain URI that are excepted from &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; restrictions.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177728</id>
		<title>User:Mtl</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177728"/>
		<updated>2009-10-22T15:45:21Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* Threat Model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of [[http://en.wikipedia.org/wiki/Cross-site_request_forgery|cross-site request forgery]] vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other NECESSARY and SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive protects websites against CSRF attacks by preventing authorization tokens stored in cookies from being sent in different-origin HTTP requests.  Without &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;, the attacker is able to cause the user agent to submit fraudulent requests to websites where the user has an active, authenticated browsing session.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive DOES NOT protect a website against CSRF attacks against itself (where &amp;lt;i&amp;gt;itself&amp;lt;/i&amp;gt; is defined as the set of &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs).  Nor does &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; protect against CSRF for such websites that authorize HTTP requests by some mechanism other than &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request headers (e.g., implicit authorization based on requester&#039;s IP address).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Documents that enable &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; must not depend on external resources that are only accessible via &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; authenticated HTTP request.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues. &lt;br /&gt;
&lt;br /&gt;
*The list of HTTP requests where &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; header is allowed to be sent must be exhaustive.&lt;br /&gt;
*The CSP policy should be allowed to contain URI that are excepted from &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; restrictions.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177726</id>
		<title>User:Mtl</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177726"/>
		<updated>2009-10-22T15:44:21Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* Open Issues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of cross-site request forgery vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other NECESSARY and SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive protects websites against CSRF attacks by preventing authorization tokens stored in cookies from being sent in different-origin HTTP requests.  Without &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;, the attacker is able to cause the user agent to submit fraudulent requests to websites where the user has an active, authenticated browsing session.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive DOES NOT protect a website against CSRF attacks against itself (where &amp;lt;i&amp;gt;itself&amp;lt;/i&amp;gt; is defined as the set of &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs).  Nor does &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; protect against CSRF for such websites that authorize HTTP requests by some mechanism other than &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request headers (e.g., implicit authorization based on requester&#039;s IP address).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Documents that enable &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; must not depend on external resources that are only accessible via &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; authenticated HTTP request.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues. &lt;br /&gt;
&lt;br /&gt;
*The list of HTTP requests where &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; header is allowed to be sent must be exhaustive.&lt;br /&gt;
*The CSP policy should be allowed to contain URI that are excepted from &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; restrictions.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177723</id>
		<title>User:Mtl</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177723"/>
		<updated>2009-10-22T15:42:32Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* anti-csrf */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of cross-site request forgery vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other NECESSARY and SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive protects websites against CSRF attacks by preventing authorization tokens stored in cookies from being sent in different-origin HTTP requests.  Without &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;, the attacker is able to cause the user agent to submit fraudulent requests to websites where the user has an active, authenticated browsing session.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive DOES NOT protect a website against CSRF attacks against itself (where &amp;lt;i&amp;gt;itself&amp;lt;/i&amp;gt; is defined as the set of &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs).  Nor does &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; protect against CSRF for such websites that authorize HTTP requests by some mechanism other than &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request headers (e.g., implicit authorization based on requester&#039;s IP address).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Documents that enable &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; must not depend on external resources that are only accessible via &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; authenticated HTTP request.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues.&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
*The list of HTTP requests where &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; header is allowed to be sent must be made exhaustive.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177722</id>
		<title>User:Mtl</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177722"/>
		<updated>2009-10-22T15:40:51Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* Open Issues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of cross-site request forgery vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other NECESSARY and SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive protects websites against CSRF attacks by preventing authorization tokens stored in cookies from being sent in different-origin HTTP requests.  Without &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;, the attacker is able to cause the user agent to submit fraudulent requests to websites where the user has an active, authenticated browsing session.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive DOES NOT protect a website against CSRF attacks against itself (where &amp;lt;i&amp;gt;itself&amp;lt;/i&amp;gt; is defined as the set of &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs).  Nor does &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; protect against CSRF for such websites that authorize HTTP requests by some mechanism other than &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request headers (e.g., implicit authorization based on requester&#039;s IP address).&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues.&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
*The list of HTTP requests where &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; header is allowed to be sent must be made exhaustive.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177721</id>
		<title>User:Mtl</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177721"/>
		<updated>2009-10-22T15:37:52Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* anti-csrf */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of cross-site request forgery vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other NECESSARY and SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive protects websites against CSRF attacks by preventing authorization tokens stored in cookies from being sent in different-origin HTTP requests.  Without &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;, the attacker is able to cause the user agent to submit fraudulent requests to websites where the user has an active, authenticated browsing session.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive DOES NOT protect a website against CSRF attacks against itself (where &amp;lt;i&amp;gt;itself&amp;lt;/i&amp;gt; is defined as the set of &amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt; URIs).  Nor does &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; protect against CSRF for such websites that authorize HTTP requests by some mechanism other than &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request headers (e.g., implicit authorization based on requester&#039;s IP address).&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues.&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
*XBL bindings. &amp;amp;nbsp;We should disable XBL bindings for the block-xss directive, but they are a non-standard feature, so it&#039;s unclear how to write normative requirements for them.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177719</id>
		<title>User:Mtl</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177719"/>
		<updated>2009-10-22T15:34:31Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* anti-csrf */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of cross-site request forgery vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other NECESSARY and SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive protects websites against CSRF attacks by preventing authorization tokens stored in cookies from being sent in different-origin HTTP requests.  Without &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;, the attacker is able to cause the user agent to submit fraudulent requests to websites where the user has an active, authenticated browsing session.&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues.&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
*XBL bindings. &amp;amp;nbsp;We should disable XBL bindings for the block-xss directive, but they are a non-standard feature, so it&#039;s unclear how to write normative requirements for them.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177712</id>
		<title>User:Mtl</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177712"/>
		<updated>2009-10-22T15:21:38Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* anti-csrf */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of cross-site request forgery vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other NECESSARY and SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The block-xss directive blocks inline script because an XSS attacker can run JavaScript by inject script tags or inline event handlers into the target page. &amp;amp;nbsp;The block-xss directive also blocks loading external scripts and plug-ins from other origins to prevent the XSS attacker from injecting a script tag that loads a malicious script from attacker.com.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues.&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
*XBL bindings. &amp;amp;nbsp;We should disable XBL bindings for the block-xss directive, but they are a non-standard feature, so it&#039;s unclear how to write normative requirements for them.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177711</id>
		<title>User:Mtl</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177711"/>
		<updated>2009-10-22T15:20:16Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* anti-csrf */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of cross-site request forgery vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the user agent submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.  This is a NECESSARY condition for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header.  Other SUFFICIENT conditions for including a &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header are outside the scope of CSRFModule.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The block-xss directive blocks inline script because an XSS attacker can run JavaScript by inject script tags or inline event handlers into the target page. &amp;amp;nbsp;The block-xss directive also blocks loading external scripts and plug-ins from other origins to prevent the XSS attacker from injecting a script tag that loads a malicious script from attacker.com.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues.&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
*XBL bindings. &amp;amp;nbsp;We should disable XBL bindings for the block-xss directive, but they are a non-standard feature, so it&#039;s unclear how to write normative requirements for them.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177710</id>
		<title>User:Mtl</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177710"/>
		<updated>2009-10-22T15:15:02Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* anti-csrf */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of cross-site request forgery vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;When the browser submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;link activation,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;form action,&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
the HTTP request SHALL include &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The block-xss directive blocks inline script because an XSS attacker can run JavaScript by inject script tags or inline event handlers into the target page. &amp;amp;nbsp;The block-xss directive also blocks loading external scripts and plug-ins from other origins to prevent the XSS attacker from injecting a script tag that loads a malicious script from attacker.com.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues.&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
*XBL bindings. &amp;amp;nbsp;We should disable XBL bindings for the block-xss directive, but they are a non-standard feature, so it&#039;s unclear how to write normative requirements for them.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177709</id>
		<title>User:Mtl</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177709"/>
		<updated>2009-10-22T15:11:25Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* anti-csrf */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of cross-site request forgery vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
#When the browser submits any HTTP request in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, where such request is classified as one of:&lt;br /&gt;
## external resource load (e.g., &amp;lt;tt&amp;gt;img src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link href&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;script src&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;iframe src&amp;lt;/tt&amp;gt;, etc.),&lt;br /&gt;
## link activation,&lt;br /&gt;
## form action,&lt;br /&gt;
the HTTP request SHALL include &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header ONLY when the requested URI is contained in the [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]] set of URIs.&lt;br /&gt;
#For all other HTTP requests in context of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header SHALL NOT be included in the request.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The block-xss directive blocks inline script because an XSS attacker can run JavaScript by inject script tags or inline event handlers into the target page. &amp;amp;nbsp;The block-xss directive also blocks loading external scripts and plug-ins from other origins to prevent the XSS attacker from injecting a script tag that loads a malicious script from attacker.com.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues.&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
*XBL bindings. &amp;amp;nbsp;We should disable XBL bindings for the block-xss directive, but they are a non-standard feature, so it&#039;s unclear how to write normative requirements for them.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177699</id>
		<title>User:Mtl</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177699"/>
		<updated>2009-10-22T14:59:39Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* anti-csrf */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of cross-site request forgery vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
#When the browser submits any HTTP request for URI not contained in [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]], when such request is performed in context (e.g., load external resource, link activation, form action, etc.) of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header shall not be sent in the HTTP request.&lt;br /&gt;
&lt;br /&gt;
The block-xss directive blocks inline script because an XSS attacker can run JavaScript by inject script tags or inline event handlers into the target page. &amp;amp;nbsp;The block-xss directive also blocks loading external scripts and plug-ins from other origins to prevent the XSS attacker from injecting a script tag that loads a malicious script from attacker.com.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues.&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
*XBL bindings. &amp;amp;nbsp;We should disable XBL bindings for the block-xss directive, but they are a non-standard feature, so it&#039;s unclear how to write normative requirements for them.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177698</id>
		<title>User:Mtl</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177698"/>
		<updated>2009-10-22T14:58:23Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* anti-csrf */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of cross-site request forgery vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt;  ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive is designed to be a first line of defense against CSRF attacks. If the CSP policy contains the &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
#When the browser submits any HTTP request for URI not contained in [[Security/CSP/BaseModule#Semantics|&amp;lt;tt&amp;gt;self&amp;lt;/tt&amp;gt;]], when such request is performed in context (e.g., load external resource, form action, etc.) of the document with enabled CSP &amp;lt;tt&amp;gt;anti-csrf&amp;lt;/tt&amp;gt; directive, the &amp;lt;tt&amp;gt;Cookie&amp;lt;/tt&amp;gt; request header shall not be sent in the HTTP request.&lt;br /&gt;
&lt;br /&gt;
The block-xss directive blocks inline script because an XSS attacker can run JavaScript by inject script tags or inline event handlers into the target page. &amp;amp;nbsp;The block-xss directive also blocks loading external scripts and plug-ins from other origins to prevent the XSS attacker from injecting a script tag that loads a malicious script from attacker.com.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues.&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
*XBL bindings. &amp;amp;nbsp;We should disable XBL bindings for the block-xss directive, but they are a non-standard feature, so it&#039;s unclear how to write normative requirements for them.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177591</id>
		<title>User:Mtl</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177591"/>
		<updated>2009-10-21T22:18:21Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* anti-csrf */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of cross-site request forgery vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== anti-csrf  ==&lt;br /&gt;
&lt;br /&gt;
The anti-csrf directive is designed to be a first line of defense against CSRF attacks. If the csp-policy contains the anti-csrf directive, the directive has the following effects: &lt;br /&gt;
&lt;br /&gt;
#The browser MUST NOT execute inline script in the current web page, including inline script elements and inline event handles. &lt;br /&gt;
#The browser MUST NOT load external scripts or plug-in objects into the current web page from URLs other than &amp;quot;self&amp;quot;, defined above. &lt;br /&gt;
#The browser MUST ignore any JavaScript or Data URLs in the current web page.&lt;br /&gt;
&lt;br /&gt;
The block-xss directive blocks inline script because an XSS attacker can run JavaScript by inject script tags or inline event handlers into the target page. &amp;amp;nbsp;The block-xss directive also blocks loading external scripts and plug-ins from other origins to prevent the XSS attacker from injecting a script tag that loads a malicious script from attacker.com.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues.&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
*XBL bindings. &amp;amp;nbsp;We should disable XBL bindings for the block-xss directive, but they are a non-standard feature, so it&#039;s unclear how to write normative requirements for them.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177590</id>
		<title>User:Mtl</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177590"/>
		<updated>2009-10-21T22:16:53Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* Threat Model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of cross-site request forgery vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on the user&#039;s behalf.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== anti-csrf  ==&lt;br /&gt;
&lt;br /&gt;
The block-xss directive is designed to be a first line of defense against XSS attacks. &amp;amp;nbsp;The csp-policy contains at least one block-xss directive, the directive(s) have the following effects: &lt;br /&gt;
&lt;br /&gt;
#The browser MUST NOT execute inline script in the current web page, including inline script elements and inline event handles. &lt;br /&gt;
#The browser MUST NOT load external scripts or plug-in objects into the current web page from URLs other than &amp;quot;self&amp;quot;, defined above. &lt;br /&gt;
#The browser MUST ignore any JavaScript or Data URLs in the current web page.&lt;br /&gt;
&lt;br /&gt;
The block-xss directive blocks inline script because an XSS attacker can run JavaScript by inject script tags or inline event handlers into the target page. &amp;amp;nbsp;The block-xss directive also blocks loading external scripts and plug-ins from other origins to prevent the XSS attacker from injecting a script tag that loads a malicious script from attacker.com.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues.&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
*XBL bindings. &amp;amp;nbsp;We should disable XBL bindings for the block-xss directive, but they are a non-standard feature, so it&#039;s unclear how to write normative requirements for them.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177589</id>
		<title>User:Mtl</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177589"/>
		<updated>2009-10-21T22:16:21Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* Threat Model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of cross-site request forgery vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon rendering the target web page, to send fraudulent HTTP requests on behalf of the user.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== anti-csrf  ==&lt;br /&gt;
&lt;br /&gt;
The block-xss directive is designed to be a first line of defense against XSS attacks. &amp;amp;nbsp;The csp-policy contains at least one block-xss directive, the directive(s) have the following effects: &lt;br /&gt;
&lt;br /&gt;
#The browser MUST NOT execute inline script in the current web page, including inline script elements and inline event handles. &lt;br /&gt;
#The browser MUST NOT load external scripts or plug-in objects into the current web page from URLs other than &amp;quot;self&amp;quot;, defined above. &lt;br /&gt;
#The browser MUST ignore any JavaScript or Data URLs in the current web page.&lt;br /&gt;
&lt;br /&gt;
The block-xss directive blocks inline script because an XSS attacker can run JavaScript by inject script tags or inline event handlers into the target page. &amp;amp;nbsp;The block-xss directive also blocks loading external scripts and plug-ins from other origins to prevent the XSS attacker from injecting a script tag that loads a malicious script from attacker.com.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues.&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
*XBL bindings. &amp;amp;nbsp;We should disable XBL bindings for the block-xss directive, but they are a non-standard feature, so it&#039;s unclear how to write normative requirements for them.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177588</id>
		<title>User:Mtl</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177588"/>
		<updated>2009-10-21T22:15:59Z</updated>

		<summary type="html">&lt;p&gt;Mtl: /* Threat Model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of cross-site request forgery vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon viewing the target web page, to send fraudulent HTTP requests on behalf of the user.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== anti-csrf  ==&lt;br /&gt;
&lt;br /&gt;
The block-xss directive is designed to be a first line of defense against XSS attacks. &amp;amp;nbsp;The csp-policy contains at least one block-xss directive, the directive(s) have the following effects: &lt;br /&gt;
&lt;br /&gt;
#The browser MUST NOT execute inline script in the current web page, including inline script elements and inline event handles. &lt;br /&gt;
#The browser MUST NOT load external scripts or plug-in objects into the current web page from URLs other than &amp;quot;self&amp;quot;, defined above. &lt;br /&gt;
#The browser MUST ignore any JavaScript or Data URLs in the current web page.&lt;br /&gt;
&lt;br /&gt;
The block-xss directive blocks inline script because an XSS attacker can run JavaScript by inject script tags or inline event handlers into the target page. &amp;amp;nbsp;The block-xss directive also blocks loading external scripts and plug-ins from other origins to prevent the XSS attacker from injecting a script tag that loads a malicious script from attacker.com.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues.&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
*XBL bindings. &amp;amp;nbsp;We should disable XBL bindings for the block-xss directive, but they are a non-standard feature, so it&#039;s unclear how to write normative requirements for them.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177587</id>
		<title>User:Mtl</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177587"/>
		<updated>2009-10-21T22:14:04Z</updated>

		<summary type="html">&lt;p&gt;Mtl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of cross-site request forgery vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon viewing the target web page, to send fraudulent HTTP requests carrying the user&#039;s authorization credentials to a different web site.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule introduces the following directive: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;anti-csrf&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directive introduced in the CSRFModule.&lt;br /&gt;
&lt;br /&gt;
== anti-csrf  ==&lt;br /&gt;
&lt;br /&gt;
The block-xss directive is designed to be a first line of defense against XSS attacks. &amp;amp;nbsp;The csp-policy contains at least one block-xss directive, the directive(s) have the following effects: &lt;br /&gt;
&lt;br /&gt;
#The browser MUST NOT execute inline script in the current web page, including inline script elements and inline event handles. &lt;br /&gt;
#The browser MUST NOT load external scripts or plug-in objects into the current web page from URLs other than &amp;quot;self&amp;quot;, defined above. &lt;br /&gt;
#The browser MUST ignore any JavaScript or Data URLs in the current web page.&lt;br /&gt;
&lt;br /&gt;
The block-xss directive blocks inline script because an XSS attacker can run JavaScript by inject script tags or inline event handlers into the target page. &amp;amp;nbsp;The block-xss directive also blocks loading external scripts and plug-ins from other origins to prevent the XSS attacker from injecting a script tag that loads a malicious script from attacker.com.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues.&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
*XBL bindings. &amp;amp;nbsp;We should disable XBL bindings for the block-xss directive, but they are a non-standard feature, so it&#039;s unclear how to write normative requirements for them.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177571</id>
		<title>User:Mtl</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=User:Mtl&amp;diff=177571"/>
		<updated>2009-10-21T21:02:43Z</updated>

		<summary type="html">&lt;p&gt;Mtl: Created page with &amp;#039;= Overview =  This document defines the CSRFModule, which contains the cross-site request forgery mitigations. The CSRFModule lets web developers mitigate CSRF attacks by disabli…&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This document defines the CSRFModule, which contains the cross-site request forgery mitigations.&lt;br /&gt;
The CSRFModule lets web developers mitigate CSRF attacks by disabling unneeded functionality used by attackers to mount CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
= Dependencies  =&lt;br /&gt;
&lt;br /&gt;
This module depends on the [[Security/CSP/BaseModule|BaseModule]].&lt;br /&gt;
&lt;br /&gt;
= Threat Model  =&lt;br /&gt;
&lt;br /&gt;
The CSRFModule seeks to help web developers reduce the severity of cross-site request forgery vulnerabilities in web sites. In particular, the CSRFModule is concerned with defending against an attacker with the following abilities: &lt;br /&gt;
&lt;br /&gt;
*The attacker can inject a sequence of bytes into a target web page. &lt;br /&gt;
*The attacker can cause the user to visit the target web page.&lt;br /&gt;
&lt;br /&gt;
We further assume the web developer wishes to prevent the attacker from achieving the following goals: &lt;br /&gt;
&lt;br /&gt;
*The attacker causes the user&#039;s browser, upon viewing the target web page, to send fraudulent HTTP requests carrying the user&#039;s authorization credentials to a different web site.&lt;br /&gt;
&lt;br /&gt;
We assume that the browser properly implements the same-origin policy and does not contain any privilege escalation vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
= Syntax  =&lt;br /&gt;
&lt;br /&gt;
The XSSModule introduces the following directives: &lt;br /&gt;
&amp;lt;pre&amp;gt;directive               = &amp;quot;block-xss&amp;quot; / &amp;quot;block-eval&amp;quot; / &amp;quot;script-src&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Semantics  =&lt;br /&gt;
&lt;br /&gt;
This section describes the semantics of the directives introduced in the XSSModule.&lt;br /&gt;
&lt;br /&gt;
== block-xss  ==&lt;br /&gt;
&lt;br /&gt;
The block-xss directive is designed to be a first line of defense against XSS attacks. &amp;amp;nbsp;The csp-policy contains at least one block-xss directive, the directive(s) have the following effects: &lt;br /&gt;
&lt;br /&gt;
#The browser MUST NOT execute inline script in the current web page, including inline script elements and inline event handles. &lt;br /&gt;
#The browser MUST NOT load external scripts or plug-in objects into the current web page from URLs other than &amp;quot;self&amp;quot;, defined above. &lt;br /&gt;
#The browser MUST ignore any JavaScript or Data URLs in the current web page.&lt;br /&gt;
&lt;br /&gt;
The block-xss directive blocks inline script because an XSS attacker can run JavaScript by inject script tags or inline event handlers into the target page. &amp;amp;nbsp;The block-xss directive also blocks loading external scripts and plug-ins from other origins to prevent the XSS attacker from injecting a script tag that loads a malicious script from attacker.com.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== block-eval  ==&lt;br /&gt;
&lt;br /&gt;
The block-eval directive is designed to mitigate DOM-based XSS vulnerabilities caused by indiscriminate use of eval and other eval-like features. &amp;amp;nbsp;If the csp-policy contains at least one block-eval directive, the directive(s) have the following effects:&lt;br /&gt;
&lt;br /&gt;
#The eval API MUST ignore its arguments and return undefined. &lt;br /&gt;
#The setTimeout and setInterval APIs MUST ignore their argument if the first argument is a string (which would otherwise be evaluated after the given delay). &lt;br /&gt;
#The&amp;amp;nbsp;Function constructor MUST ignore its arguments if its first argument is a string (which would otherwise by evaluated when the function is called).&lt;br /&gt;
&lt;br /&gt;
The block-eval directive is not strictly necessary to mitigate reflective or stored XSS vulnerabilities. &amp;amp;nbsp;However, some web developer might find the directive useful as a second line of defense.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== script-src  ==&lt;br /&gt;
&lt;br /&gt;
The script-src directive is design give web developers more fine-grained control over from where their web page can load external script. &amp;amp;nbsp;If the csp-policy contains at least one script-src directive, let the &#039;&#039;effective origin-list&#039;&#039; be the intersection of the set of URLs denoted by all the script-src origin lists. &amp;amp;nbsp;The directive(s) have the following effects:&lt;br /&gt;
&lt;br /&gt;
#The browser MUST NOT enforce the restrictions on loading external scripts or plug-in objects given by the block-xss directive because the script-src overrides those restrictions with a finer-grained policy. &lt;br /&gt;
#The browser MUST NOT load an external script into the current web page unless loading that script respects the effective&amp;amp;nbsp;origin-list. &lt;br /&gt;
#The browser MUST NOT load an plug-in object into the current web page unless loading that script respects the effective origin-list.&lt;br /&gt;
&lt;br /&gt;
In order to mitigate XSS vulnerabilities, the script-src directive SHOULD be used in conjunction with the block-xss directive.&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
TODO: Add some examples.&lt;br /&gt;
&lt;br /&gt;
= Open Issues =&lt;br /&gt;
&lt;br /&gt;
This section contains a list of open issues.&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
*XBL bindings. &amp;amp;nbsp;We should disable XBL bindings for the block-xss directive, but they are a non-standard feature, so it&#039;s unclear how to write normative requirements for them. &lt;br /&gt;
*CSS expression. &amp;amp;nbsp;Attackers can also embed script in CSS in IE using CSS expressions. &amp;amp;nbsp;We should figure out how to recommend that this be disabled too.&lt;br /&gt;
*Strict MIME type handling for script-src. &amp;amp;nbsp;I&#039;m inclined to leave that for another directive (&amp;quot;strict-types&amp;quot; or some such). &amp;amp;nbsp;The attack vector is pretty obscure. &lt;br /&gt;
*Password theft. &amp;amp;nbsp;The XSSModule doesn&#039;t help with password theft because the attacker can make a fake password field. &amp;amp;nbsp;I think we should have a separate module targeted at that issue.&lt;/div&gt;</summary>
		<author><name>Mtl</name></author>
	</entry>
</feed>