<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>AntiCSRF Wiki &amp; Documentation Rss Feed</title><link>http://www.codeplex.com/AntiCSRF/Wiki/View.aspx?title=Home</link><description>AntiCSRF Wiki Rss Description</description><item><title>Updated Wiki: Home</title><link>http://anticsrf.codeplex.com/Wiki/View.aspx?title=Home&amp;version=16</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;AntiCSRF - A Cross Site Request Forgery (CSRF) module for ASP.NET&lt;/h1&gt;
&lt;h2&gt;Description&lt;/h2&gt;AntiCSRF makes it easier for ASP.NET developers to guard themselves against Cross Site Request Forgery. You&amp;#39;ll no longer have to manually add and check protection tokens to protected yourself against CSRF attacks.&lt;br /&gt;&lt;br /&gt;AntiCSRF developed in C&amp;#35;. 
&lt;h2&gt;Notes&lt;/h2&gt;The normal recommended way of adding a CSRF token to an ASP.NET application is to use ViewState in combination with a ViewStateUserKey. This requires ViewState to be enabled and an application to have some way of identifying a user uniquely, usually via a SessionID which in turn requires session state to be enabled. AntiCSRF does not have these requirements; instead if requires cookies to be enabled on the user's browser and uses a temporary cookie, cleared when the browser is closed, to identify a user and a hidden form field to carry the CSRF token.&lt;br /&gt;&lt;br /&gt;The ViewStateUserKey approach protects against One-Click Attacks. One-Click Attack is sometimes incorrectly referred to as Microsoft's name for Cross-Site Request Forgery. However, this is not entirely correct. One-Click Attacks refer to a subset of CSRF attacks - one that use a malicious ViewState to perform the request. Because web forms developed with ASP.NET use ViewState for post-backs, an attacker can perform the post-back they want the user to perform unknowingly, and record the ViewState. Due to the way that ASP.NET ignores HTTP verbs when using Request.Params versus Request.Form, and in web controls, this request can often be made via GET. For more&lt;br /&gt;details please see Alex Smolen's blog entry &lt;a href="http://keepitlocked.net/archive/2008/05/29/viewstateuserkey-doesn-t-prevent-cross-site-request-forgery.aspx" class="externalLink"&gt;http://keepitlocked.net/archive/2008/05/29/viewstateuserkey-doesn-t-prevent-cross-site-request-forgery.aspx&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;
&lt;h2&gt;Usage instructions&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Add a reference the AntiCSRF assembly, or copy the assembly to your web applications BIN folder.&lt;/li&gt;
&lt;li&gt;Add a reference to the module into your web.config;
&lt;ul&gt;&lt;li&gt;For IIS6/IIS7 in Classic ASP.NET mode&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;&amp;lt;system.web&amp;gt;
  ....
  &amp;lt;httpModules&amp;gt;
    &amp;lt;add name=&amp;quot;AntiCSRF&amp;quot; type=&amp;quot;Idunno.AntiCsrf.AntiCsrfModule, Idunno.AntiCsrf&amp;quot;/&amp;gt;
  &amp;lt;/httpModules&amp;gt;
  ....
&amp;lt;/system.web&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;For IIS7 in integrated pipeline mode&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;&amp;lt;system.webmodules&amp;gt;
  ....
  &amp;lt;modules&amp;gt;
    &amp;lt;add name=&amp;quot;AntiCSRF&amp;quot; type=&amp;quot;Idunno.AntiCsrf.AntiCsrfModule, Idunno.AntiCsrf&amp;quot;/&amp;gt;
  &amp;lt;/modules&amp;gt;
  ....
&amp;lt;/system.webmodules&amp;gt;
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;Optout any pages you do not want protected by adding the &lt;a href="http://anticsrf.codeplex.com/Wiki/View.aspx?title=Idunno.AntiCsrf.SuppressCsrfCheck"&gt;Idunno.AntiCsrf.SuppressCsrfCheck&lt;/a&gt; attribute to their declarations, for example&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;[Idunno.AntiCsrf.SuppressCsrfCheck]
public partial class unprotectedPage : System.Web.UI.Page  
&lt;/pre&gt;
&lt;ul&gt;&lt;li&gt;For pages without a CodeBehind class you can optout by implementing the Idunno.AntiCsrf.ISuppressCsrfCheck interface, for example&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; EnableViewState=&amp;quot;false&amp;quot; %&amp;gt;
&amp;lt;%@ Implements Interface=&amp;quot;Idunno.AntiCsrf.ISuppressCsrfCheck&amp;quot; %&amp;gt;&lt;/pre&gt;
&lt;h2&gt;Configuration&lt;/h2&gt;The module supports configuration via web.config. In order to utilise the configuration options you must first add a custom configuration section to your web.config&lt;br /&gt;&lt;pre&gt;&amp;lt;configuration&amp;gt;
    ....
    &amp;lt;configSections&amp;gt;
        ....
        &amp;lt;section name=&amp;quot;csrfSettings&amp;quot;  type=&amp;quot;Idunno.AntiCsrf.Configuration.CsrfSettings, Idunno.AntiCsrf&amp;quot; /&amp;gt;   
        ....
    &amp;lt;/configSections&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt; &lt;br /&gt;Then create a configuration section in your web.config&lt;br /&gt;&lt;pre&gt;&amp;lt;configuration&amp;gt;
    ....
    &amp;lt;csrfSettings cookieName=&amp;quot;__CSRFCOOKIE&amp;quot; formFieldName=&amp;quot;__CSRFTOKEN&amp;quot; detectionResult=&amp;quot;RaiseException&amp;quot; errorPage=&amp;quot;&amp;quot; /&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;&lt;br /&gt;The configuration options are as follows&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt; Name &lt;/th&gt;&lt;th&gt; Purpose &lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; cookieName &lt;/td&gt;&lt;td&gt; specifies the name of the cookie used to hold the anti-CSRF token. This defaults to &lt;i&gt;&lt;/i&gt;CSRFCOOKIE. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; formfieldName &lt;/td&gt;&lt;td&gt; specifies the name of the form field used to hold the anti-CSRF token This defatults to &lt;i&gt;&lt;/i&gt;CSRFTOKEN. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; detectionResult &lt;/td&gt;&lt;td&gt; this may be either &lt;b&gt;RaiseException&lt;/b&gt;, which throws exceptions on a potential CSRF attack or &lt;b&gt;Redirect&lt;/b&gt; which will redirect to the URL specified in the errorPage setting.  You &lt;i&gt;must&lt;/i&gt; set a URL in the errorPage setting if you choose Redirect. This defaults to RaiseException. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; errorPage &lt;/td&gt;&lt;td&gt; a page name to redirect to if the detectionResult is set to Redirect. &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;h2&gt;Limitations&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;You, the developer, must ensure your GET requests are idempotent (i.e. the side-effects of multiple identical requests are the same as for a single request). GET requests are not protected with this module. See &lt;a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1.2" class="externalLink"&gt;http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1.2&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Non-ASP.NET forms are not protected with this module.&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;Disclaimer&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;This software is provided &amp;quot;as-is&amp;quot;. You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. Like any security software this should become part of your defence in depth strategy and should not be solely relied upon for protection.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>blowdart</author><pubDate>Tue, 18 Aug 2009 17:17:07 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20090818051707P</guid></item><item><title>Updated Wiki: Home</title><link>http://anticsrf.codeplex.com/Wiki/View.aspx?title=Home&amp;version=15</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;AntiCSRF - A Cross Site Request Forgery (CSRF) module for ASP.NET&lt;/h1&gt;
&lt;h2&gt;Description&lt;/h2&gt;AntiCSRF makes it easier for ASP.NET developers to guard themselves against Cross Site Request Forgery. You&amp;#39;ll no longer have to manually add and check protection tokens to protected yourself against CSRF attacks.&lt;br /&gt;&lt;br /&gt;AntiCSRF developed in C&amp;#35;. 
&lt;h2&gt;Notes&lt;/h2&gt;The normal recommended way of adding a CSRF token to an ASP.NET application is to use ViewState in combination with a ViewStateUserKey. This requires ViewState to be enabled and an application to have some way of identifying a user uniquely, usually via a SessionID which in turn requires session state to be enabled. AntiCSRF does not have these requirements; instead if requires cookies to be enabled on the user's browser and uses a temporary cookie, cleared when the browser is closed, to identify a user and a hidden form field to carry the CSRF token.&lt;br /&gt;&lt;br /&gt;The ViewStateUserKey approach protects against One-Click Attacks. One-Click Attack is sometimes incorrectly referred to as Microsoft's name for Cross-Site Request Forgery. However, this is not entirely correct. One-Click Attacks refer to a subset of CSRF attacks - one that use a malicious ViewState to perform the request. Because web forms developed with ASP.NET use ViewState for post-backs, an attacker can perform the post-back they want the user to perform unknowingly, and record the ViewState. Due to the way that ASP.NET ignores HTTP verbs when using Request.Params versus Request.Form, and in web controls, this request can often be made via GET. For more&lt;br /&gt;details please see Alex Smolen's blog entry &lt;a href="http://keepitlocked.net/archive/2008/05/29/viewstateuserkey-doesn-t-prevent-cross-site-request-forgery.aspx" class="externalLink"&gt;http://keepitlocked.net/archive/2008/05/29/viewstateuserkey-doesn-t-prevent-cross-site-request-forgery.aspx&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;
&lt;h2&gt;Usage instructions&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Add a reference the AntiCSRF assembly, or copy the assembly to your web applications BIN folder.&lt;/li&gt;
&lt;li&gt;Add a reference to the module into your web.config;
&lt;ul&gt;&lt;li&gt;For IIS6/IIS7 in Classic ASP.NET mode&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;&amp;lt;system.web&amp;gt;
  ....
  &amp;lt;httpModules&amp;gt;
    &amp;lt;add name=&amp;quot;AntiCSRF&amp;quot; type=&amp;quot;Idunno.AntiCsrf.AntiCsrfModule, Idunno.AntiCsrf&amp;quot;/&amp;gt;
  &amp;lt;/httpModules&amp;gt;
  ....
&amp;lt;/system.web&amp;gt;
&lt;/pre&gt;** For IIS7 in integrated pipeline mode&lt;br /&gt;&lt;pre&gt;&amp;lt;system.webmodules&amp;gt;
  ....
  &amp;lt;modules&amp;gt;
    &amp;lt;add name=&amp;quot;AntiCSRF&amp;quot; type=&amp;quot;Idunno.AntiCsrf.AntiCsrfModule, Idunno.AntiCsrf&amp;quot;/&amp;gt;
  &amp;lt;/modules&amp;gt;
  ....
&amp;lt;/system.webmodules&amp;gt;
&lt;/pre&gt;* Optout any pages you do not want protected by adding the &lt;a href="http://anticsrf.codeplex.com/Wiki/View.aspx?title=Idunno.AntiCsrf.SuppressCsrfCheck"&gt;Idunno.AntiCsrf.SuppressCsrfCheck&lt;/a&gt; attribute to their declarations, for example&lt;br /&gt;&lt;pre&gt;[Idunno.AntiCsrf.SuppressCsrfCheck]
public partial class unprotectedPage : System.Web.UI.Page  
&lt;/pre&gt;* For pages without a CodeBehind class you can optout by implementing the Idunno.AntiCsrf.ISuppressCsrfCheck interface, for example&lt;br /&gt;&lt;pre&gt;&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; EnableViewState=&amp;quot;false&amp;quot; %&amp;gt;
&amp;lt;%@ Implements Interface=&amp;quot;Idunno.AntiCsrf.ISuppressCsrfCheck&amp;quot; %&amp;gt;&lt;/pre&gt;!! Configuration&lt;br /&gt;The module supports configuration via web.config. In order to utilise the configuration options you must first add a custom configuration section to your web.config&lt;br /&gt;&lt;pre&gt;&amp;lt;configuration&amp;gt;
    ....
    &amp;lt;configSections&amp;gt;
        ....
        &amp;lt;section name=&amp;quot;csrfSettings&amp;quot;  type=&amp;quot;Idunno.AntiCsrf.Configuration.CsrfSettings, Idunno.AntiCsrf&amp;quot; /&amp;gt;   
        ....
    &amp;lt;/configSections&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt; Then create a configuration section in your web.config&lt;br /&gt;&lt;pre&gt;&amp;lt;configuration&amp;gt;
    ....
    &amp;lt;csrfSettings cookieName=&amp;quot;__CSRFCOOKIE&amp;quot; formFieldName=&amp;quot;__CSRFTOKEN&amp;quot; detectionResult=&amp;quot;RaiseException&amp;quot; errorPage=&amp;quot;&amp;quot; /&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;The configuration options are as follows&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt; Name &lt;/th&gt;&lt;th&gt; Purpose &lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; cookieName &lt;/td&gt;&lt;td&gt; specifies the name of the cookie used to hold the anti-CSRF token. This defaults to &lt;i&gt;&lt;/i&gt;CSRFCOOKIE. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; formfieldName &lt;/td&gt;&lt;td&gt; specifies the name of the form field used to hold the anti-CSRF token This defatults to &lt;i&gt;&lt;/i&gt;CSRFTOKEN. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; detectionResult &lt;/td&gt;&lt;td&gt; this may be either &lt;b&gt;RaiseException&lt;/b&gt;, which throws exceptions on a potential CSRF attack or &lt;b&gt;Redirect&lt;/b&gt; which will redirect to the URL specified in the errorPage setting.  You &lt;i&gt;must&lt;/i&gt; set a URL in the errorPage setting if you choose Redirect. This defaults to RaiseException. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; errorPage &lt;/td&gt;&lt;td&gt; a page name to redirect to if the detectionResult is set to Redirect. &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;h2&gt;Limitations&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;You, the developer, must ensure your GET requests are idempotent (i.e. the side-effects of multiple identical requests are the same as for a single request). GET requests are not protected with this module. See &lt;a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1.2" class="externalLink"&gt;http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1.2&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Non-ASP.NET forms are not protected with this module.&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;Disclaimer&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;This software is provided &amp;quot;as-is&amp;quot;. You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. Like any security software this should become part of your defence in depth strategy and should not be solely relied upon for protection.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>blowdart</author><pubDate>Tue, 18 Aug 2009 11:47:09 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20090818114709A</guid></item><item><title>Updated Wiki: Home</title><link>http://anticsrf.codeplex.com/Wiki/View.aspx?title=Home&amp;version=14</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;AntiCSRF - A Cross Site Request Forgery (CSRF) module for ASP.NET&lt;/h1&gt;
&lt;i&gt;Discussion forums are currently disabled&lt;/i&gt;&lt;br /&gt;The discussion forums are currently disabled thanks to someone from Web.Com(India) Pvt. Ltd. who signed up to codeplex using an email address with an autoresponder on it in order to leave a message on the discussion boards. When he left the message codeplex sent a confirmation email, which triggered the auto-responder, which replied to codeplex, which trigger a new discussion post and so on. Right now there are over 200 new discussion posts with WebCom's auto responder message as the sole content. As an added bonus they replied to a post where I asked them to turn the autoresponder off with an apology, which then caused a confirmation email to be sent, an auto response to be returned, etc.&lt;br /&gt;&lt;br /&gt;Until Web.Com(India) Pvt. Ltd. manage to fix their broken email system or have the sense to use individual email addresses for codeplex accounts which do not have an auto responder the discussion forums for this project are useless as every new post will start the process over again.&lt;br /&gt;&lt;br /&gt;Please accept my apologies.&lt;br /&gt;
&lt;h2&gt;Description&lt;/h2&gt;AntiCSRF makes it easier for ASP.NET developers to guard themselves against Cross Site Request Forgery. You&amp;#39;ll no longer have to manually add and check protection tokens to protected yourself against CSRF attacks.&lt;br /&gt;&lt;br /&gt;AntiCSRF developed in C&amp;#35;. &lt;br /&gt;
&lt;h2&gt;Notes&lt;/h2&gt;The normal recommended way of adding a CSRF token to an ASP.NET application is to use ViewState in combination with a ViewStateUserKey. This requires ViewState to be enabled and an application to have some way of identifying a user uniquely, usually via a SessionID which in turn requires session state to be enabled. AntiCSRF does not have these requirements; instead if requires cookies to be enabled on the user's browser and uses a temporary cookie, cleared when the browser is closed, to identify a user and a hidden form field to carry the CSRF token.&lt;br /&gt;&lt;br /&gt;The ViewStateUserKey approach protects against One-Click Attacks. One-Click Attack is sometimes incorrectly referred to as Microsoft's name for Cross-Site Request Forgery. However, this is not entirely correct. One-Click Attacks refer to a subset of CSRF attacks - one that use a malicious ViewState to perform the request. Because web forms developed with ASP.NET use ViewState for post-backs, an attacker can perform the post-back they want the user to perform unknowingly, and record the ViewState. Due to the way that ASP.NET ignores HTTP verbs when using Request.Params versus Request.Form, and in web controls, this request can often be made via GET. For more&lt;br /&gt;details please see Alex Smolen's blog entry &lt;a href="http://keepitlocked.net/archive/2008/05/29/viewstateuserkey-doesn-t-prevent-cross-site-request-forgery.aspx" class="externalLink"&gt;http://keepitlocked.net/archive/2008/05/29/viewstateuserkey-doesn-t-prevent-cross-site-request-forgery.aspx&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;
&lt;h2&gt;Usage instructions&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Add a reference the AntiCSRF assembly, or copy the assembly to your web applications BIN folder.&lt;/li&gt;
&lt;li&gt;Add a reference to the module into your web.config;
&lt;ul&gt;&lt;li&gt;For IIS6/IIS7 in Classic ASP.NET mode&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;&amp;lt;system.web&amp;gt;
  ....
  &amp;lt;httpModules&amp;gt;
    &amp;lt;add name=&amp;quot;AntiCSRF&amp;quot; type=&amp;quot;Idunno.AntiCsrf.AntiCsrfModule, Idunno.AntiCsrf&amp;quot;/&amp;gt;
  &amp;lt;/httpModules&amp;gt;
  ....
&amp;lt;/system.web&amp;gt;
&lt;/pre&gt;** For IIS7 in integrated pipeline mode&lt;br /&gt;&lt;pre&gt;&amp;lt;system.webmodules&amp;gt;
  ....
  &amp;lt;modules&amp;gt;
    &amp;lt;add name=&amp;quot;AntiCSRF&amp;quot; type=&amp;quot;Idunno.AntiCsrf.AntiCsrfModule, Idunno.AntiCsrf&amp;quot;/&amp;gt;
  &amp;lt;/modules&amp;gt;
  ....
&amp;lt;/system.webmodules&amp;gt;
&lt;/pre&gt;* Optout any pages you do not want protected by adding the &lt;a href="http://anticsrf.codeplex.com/Wiki/View.aspx?title=Idunno.AntiCsrf.SuppressCsrfCheck"&gt;Idunno.AntiCsrf.SuppressCsrfCheck&lt;/a&gt; attribute to their declarations, for example&lt;br /&gt;&lt;pre&gt;[Idunno.AntiCsrf.SuppressCsrfCheck]
public partial class unprotectedPage : System.Web.UI.Page  
&lt;/pre&gt;* For pages without a CodeBehind class you can optout by implementing the Idunno.AntiCsrf.ISuppressCsrfCheck interface, for example&lt;br /&gt;&lt;pre&gt;&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; EnableViewState=&amp;quot;false&amp;quot; %&amp;gt;
&amp;lt;%@ Implements Interface=&amp;quot;Idunno.AntiCsrf.ISuppressCsrfCheck&amp;quot; %&amp;gt;&lt;/pre&gt;!! Configuration&lt;br /&gt;The module supports configuration via web.config. In order to utilise the configuration options you must first add a custom configuration section to your web.config&lt;br /&gt;&lt;pre&gt;&amp;lt;configuration&amp;gt;
    ....
    &amp;lt;configSections&amp;gt;
        ....
        &amp;lt;section name=&amp;quot;csrfSettings&amp;quot;  type=&amp;quot;Idunno.AntiCsrf.Configuration.CsrfSettings, Idunno.AntiCsrf&amp;quot; /&amp;gt;   
        ....
    &amp;lt;/configSections&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt; Then create a configuration section in your web.config&lt;br /&gt;&lt;pre&gt;&amp;lt;configuration&amp;gt;
    ....
    &amp;lt;csrfSettings cookieName=&amp;quot;__CSRFCOOKIE&amp;quot; formFieldName=&amp;quot;__CSRFTOKEN&amp;quot; detectionResult=&amp;quot;RaiseException&amp;quot; errorPage=&amp;quot;&amp;quot; /&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;The configuration options are as follows&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt; Name &lt;/th&gt;&lt;th&gt; Purpose &lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; cookieName &lt;/td&gt;&lt;td&gt; specifies the name of the cookie used to hold the anti-CSRF token. This defaults to &lt;i&gt;&lt;/i&gt;CSRFCOOKIE. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; formfieldName &lt;/td&gt;&lt;td&gt; specifies the name of the form field used to hold the anti-CSRF token This defatults to &lt;i&gt;&lt;/i&gt;CSRFTOKEN. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; detectionResult &lt;/td&gt;&lt;td&gt; this may be either &lt;b&gt;RaiseException&lt;/b&gt;, which throws exceptions on a potential CSRF attack or &lt;b&gt;Redirect&lt;/b&gt; which will redirect to the URL specified in the errorPage setting.  You &lt;i&gt;must&lt;/i&gt; set a URL in the errorPage setting if you choose Redirect. This defaults to RaiseException. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; errorPage &lt;/td&gt;&lt;td&gt; a page name to redirect to if the detectionResult is set to Redirect. &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;h2&gt;Limitations&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;You, the developer, must ensure your GET requests are idempotent (i.e. the side-effects of multiple identical requests are the same as for a single request). GET requests are not protected with this module. See &lt;a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1.2" class="externalLink"&gt;http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1.2&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Non-ASP.NET forms are not protected with this module.&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;Disclaimer&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;This software is provided &amp;quot;as-is&amp;quot;. You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. Like any security software this should become part of your defence in depth strategy and should not be solely relied upon for protection.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>blowdart</author><pubDate>Mon, 17 Aug 2009 12:57:20 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20090817125720P</guid></item><item><title>Updated Wiki: Home</title><link>http://www.codeplex.com/AntiCSRF/Wiki/View.aspx?title=Home&amp;version=13</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
AntiCSRF - A Cross Site Request Forgery (CSRF) module for ASP.NET
&lt;/h1&gt;&lt;h2&gt;
Description
&lt;/h2&gt;AntiCSRF makes it easier for ASP.NET developers to guard themselves against Cross Site Request Forgery. You&amp;#39;ll no longer have to manually add and check protection tokens to protected yourself against CSRF attacks.&lt;br /&gt;&lt;br /&gt;AntiCSRF developed in C&amp;#35;. &lt;br /&gt;&lt;h2&gt;
Notes
&lt;/h2&gt;The normal recommended way of adding a CSRF token to an ASP.NET application is to use ViewState in combination with a ViewStateUserKey. This requires ViewState to be enabled and an application to have some way of identifying a user uniquely, usually via a SessionID which in turn requires session state to be enabled. AntiCSRF does not have these requirements; instead if requires cookies to be enabled on the user's browser and uses a temporary cookie, cleared when the browser is closed, to identify a user and a hidden form field to carry the CSRF token.&lt;br /&gt; &lt;br /&gt;The ViewStateUserKey approach protects against One-Click Attacks. One-Click Attack is sometimes incorrectly referred to as Microsoft's name for Cross-Site Request Forgery. However, this is not entirely correct. One-Click Attacks refer to a subset of CSRF attacks - one that use a malicious ViewState to perform the request. Because web forms developed with ASP.NET use ViewState for post-backs, an attacker can perform the post-back they want the user to perform unknowingly, and record the ViewState. Due to the way that ASP.NET ignores HTTP verbs when using Request.Params versus Request.Form, and in web controls, this request can often be made via GET. For more&lt;br /&gt;details please see Alex Smolen's blog entry &lt;a href="http://keepitlocked.net/archive/2008/05/29/viewstateuserkey-doesn-t-prevent-cross-site-request-forgery.aspx" class="externalLink"&gt;http://keepitlocked.net/archive/2008/05/29/viewstateuserkey-doesn-t-prevent-cross-site-request-forgery.aspx&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;h2&gt;
Usage instructions
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Add a reference the AntiCSRF assembly, or copy the assembly to your web applications BIN folder.&lt;/li&gt;&lt;li&gt;Add a reference to the module into your web.config;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;For IIS6/IIS7 in Classic ASP.NET mode&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
&amp;lt;system.web&amp;gt;
  ....
  &amp;lt;httpModules&amp;gt;
    &amp;lt;add name=&amp;quot;AntiCSRF&amp;quot; type=&amp;quot;Idunno.AntiCsrf.AntiCsrfModule, Idunno.AntiCsrf&amp;quot;/&amp;gt;
  &amp;lt;/httpModules&amp;gt;
  ....
&amp;lt;/system.web&amp;gt;
&lt;/pre&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;For IIS7 in integrated pipeline mode&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
&amp;lt;system.webmodules&amp;gt;
  ....
  &amp;lt;modules&amp;gt;
    &amp;lt;add name=&amp;quot;AntiCSRF&amp;quot; type=&amp;quot;Idunno.AntiCsrf.AntiCsrfModule, Idunno.AntiCsrf&amp;quot;/&amp;gt;
  &amp;lt;/modules&amp;gt;
  ....
&amp;lt;/system.webmodules&amp;gt;
&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;Optout any pages you do not want protected by adding the &lt;a href="http://www.codeplex.com/AntiCSRF/Wiki/View.aspx?title=Idunno.AntiCsrf.SuppressCsrfCheck&amp;amp;referringTitle=Home"&gt;Idunno.AntiCsrf.SuppressCsrfCheck&lt;/a&gt; attribute to their declarations, for example&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
[Idunno.AntiCsrf.SuppressCsrfCheck]
public partial class unprotectedPage : System.Web.UI.Page  
&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;For pages without a CodeBehind class you can optout by implementing the Idunno.AntiCsrf.ISuppressCsrfCheck interface, for example&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; EnableViewState=&amp;quot;false&amp;quot; %&amp;gt;
&amp;lt;%@ Implements Interface=&amp;quot;Idunno.AntiCsrf.ISuppressCsrfCheck&amp;quot; %&amp;gt;
&lt;/pre&gt;&lt;h2&gt;
Configuration
&lt;/h2&gt;The module supports configuration via web.config. In order to utilise the configuration options you must first add a custom configuration section to your web.config&lt;br /&gt;&lt;pre&gt;
&amp;lt;configuration&amp;gt;
    ....
    &amp;lt;configSections&amp;gt;
        ....
        &amp;lt;section name=&amp;quot;csrfSettings&amp;quot;  type=&amp;quot;Idunno.AntiCsrf.Configuration.CsrfSettings, Idunno.AntiCsrf&amp;quot; /&amp;gt;   
        ....
    &amp;lt;/configSections&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/pre&gt; Then create a configuration section in your web.config&lt;br /&gt;&lt;pre&gt;
&amp;lt;configuration&amp;gt;
    ....
    &amp;lt;csrfSettings cookieName=&amp;quot;__CSRFCOOKIE&amp;quot; formFieldName=&amp;quot;__CSRFTOKEN&amp;quot; detectionResult=&amp;quot;RaiseException&amp;quot; errorPage=&amp;quot;&amp;quot; /&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/pre&gt;The configuration options are as follows&lt;br /&gt;&lt;table&gt;
&lt;tr&gt;
&lt;th&gt; Name &lt;/th&gt;&lt;th&gt; Purpose &lt;/th&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; cookieName &lt;/td&gt;&lt;td&gt; specifies the name of the cookie used to hold the anti-CSRF token. This defaults to __CSRFCOOKIE. &lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; formfieldName &lt;/td&gt;&lt;td&gt; specifies the name of the form field used to hold the anti-CSRF token This defatults to __CSRFTOKEN. &lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; detectionResult &lt;/td&gt;&lt;td&gt; this may be either &lt;b&gt;RaiseException&lt;/b&gt;, which throws exceptions on a potential CSRF attack or &lt;b&gt;Redirect&lt;/b&gt; which will redirect to the URL specified in the errorPage setting.  You &lt;i&gt;must&lt;/i&gt; set a URL in the errorPage setting if you choose Redirect. This defaults to RaiseException. &lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; errorPage &lt;/td&gt;&lt;td&gt; a page name to redirect to if the detectionResult is set to Redirect. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;h2&gt;
Limitations
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;You, the developer, must ensure your GET requests are idempotent (i.e. the side-effects of multiple identical requests are the same as for a single request). GET requests are not protected with this module. See &lt;a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1.2" class="externalLink"&gt;http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1.2&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Non-ASP.NET forms are not protected with this module.&lt;/li&gt;
&lt;/ul&gt;&lt;h2&gt;
Disclaimer
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;This software is provided &amp;quot;as-is&amp;quot;. You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. Like any security software this should become part of your defence in depth strategy and should not be solely relied upon for protection.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>blowdart</author><pubDate>Fri, 13 Feb 2009 14:36:41 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20090213023641P</guid></item><item><title>Updated Wiki: Home</title><link>http://www.codeplex.com/AntiCSRF/Wiki/View.aspx?title=Home&amp;version=12</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
AntiCSRF - A Cross Site Request Forgery (CSRF) module for ASP.NET
&lt;/h1&gt;&lt;h2&gt;
Description
&lt;/h2&gt;AntiCSRF makes it easier for ASP.NET developers to guard themselves against Cross Site Request Forgery. You&amp;#39;ll no longer have to manually add and check protection tokens to protected yourself against CSRF attacks.&lt;br /&gt;&lt;br /&gt;AntiCSRF developed in C&amp;#35;. &lt;br /&gt;&lt;h2&gt;
Notes
&lt;/h2&gt;The normal recommended way of adding a CSRF token to an ASP.NET application is to use ViewState in combination with a ViewStateUserKey. This requires ViewState to be enabled and an application to have some way of identifying a user uniquely, usually via a SessionID which in turn requires session state to be enabled. AntiCSRF does not have these requirements; instead if requires cookies to be enabled on the user's browser and uses a temporary cookie, cleared when the browser is closed, to identify a user and a hidden form field to carry the CSRF token.&lt;br /&gt; &lt;br /&gt;The ViewStateUserKey approach protects against One-Click Attacks. One-Click Attack is sometimes incorrectly referred to as Microsoft's name for Cross-Site Request Forgery. However, this is not entirely correct. One-Click Attacks refer to a subset of CSRF attacks - one that use a malicious ViewState to perform the request. Because web forms developed with ASP.NET use ViewState for post-backs, an attacker can perform the post-back they want the user to perform unknowingly, and record the ViewState. Due to the way that ASP.NET ignores HTTP verbs when using Request.Params versus Request.Form, and in web controls, this request can often be made via GET. For more&lt;br /&gt;details please see Alex Smolen's blog entry &lt;a href="http://keepitlocked.net/archive/2008/05/29/viewstateuserkey-doesn-t-prevent-cross-site-request-forgery.aspx" class="externalLink"&gt;http://keepitlocked.net/archive/2008/05/29/viewstateuserkey-doesn-t-prevent-cross-site-request-forgery.aspx&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;h2&gt;
Usage instructions
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Add a reference the AntiCSRF assembly, or copy the assembly to your web applications BIN folder.&lt;/li&gt;&lt;li&gt;Add a reference to the module into your web.config;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;For IIS6/IIS7 in Classic ASP.NET mode&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
&amp;lt;system.web&amp;gt;
  ....
  &amp;lt;httpModules&amp;gt;
    &amp;lt;add name=&amp;quot;AntiCSRF&amp;quot; type=&amp;quot;Idunno.AntiCsrf.AntiCsrfModule, Idunno.AntiCsrf&amp;quot;/&amp;gt;
  &amp;lt;/httpModules&amp;gt;
  ....
&amp;lt;/system.web&amp;gt;
&lt;/pre&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;For IIS7 in integrated pipeline mode&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
&amp;lt;system.webmodules&amp;gt;
  ....
  &amp;lt;modules&amp;gt;
    &amp;lt;add name=&amp;quot;AntiCSRF&amp;quot; type=&amp;quot;Idunno.AntiCsrf.AntiCsrfModule, Idunno.AntiCsrf&amp;quot;/&amp;gt;
  &amp;lt;/modules&amp;gt;
  ....
&amp;lt;/system.webmodules&amp;gt;
&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;Optout any pages you do not want protected by adding the &lt;a href="http://www.codeplex.com/AntiCSRF/Wiki/View.aspx?title=Idunno.AntiCsrf.SuppressCsrfCheck&amp;amp;referringTitle=Home"&gt;Idunno.AntiCsrf.SuppressCsrfCheck&lt;/a&gt; attribute to their declarations, for example&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
[Idunno.AntiCsrf.SuppressCsrfCheck]
public partial class unprotectedPage : System.Web.UI.Page  
&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;For pages without a CodeBehind class you can optout by implementing the Idunno.AntiCsrf.ISuppressCsrfCheck interface, for example&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; EnableViewState=&amp;quot;false&amp;quot; %&amp;gt;
&amp;lt;%@ Implements Interface=&amp;quot;Idunno.AntiCsrf.ISuppressCsrfCheck&amp;quot; %&amp;gt;
&lt;/pre&gt;&lt;h2&gt;
Configuration
&lt;/h2&gt;The module supports configuration via web.config. In order to utilise the configuration options you must first add a custom configuration section to your web.config&lt;br /&gt;&lt;pre&gt;
&amp;lt;configuration&amp;gt;
    ....
    &amp;lt;configSections&amp;gt;
        ....
        &amp;lt;section name=&amp;quot;csrfSettings&amp;quot;  type=&amp;quot;Idunno.AntiCsrf.Configuration.CsrfSettings, Idunno.AntiCsrf&amp;quot; /&amp;gt;   
        ....
    &amp;lt;/configSections&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/pre&gt; Then create a configuration section in your web.config&lt;br /&gt;&lt;pre&gt;
&amp;lt;configuration&amp;gt;
    ....
    &amp;lt;csrfSettings cookieName=&amp;quot;__CSRFCOOKIE&amp;quot; formFieldName=&amp;quot;__CSRFTOKEN&amp;quot; detectionResult=&amp;quot;RaiseException&amp;quot; errorPage=&amp;quot;&amp;quot; /&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/pre&gt;The configuration options are as follows&lt;br /&gt;&lt;table&gt;
&lt;tr&gt;
&lt;th&gt; Name &lt;/th&gt;&lt;th&gt; Purpose &lt;/th&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; cookieName &lt;/td&gt;&lt;td&gt; specifies the name of the cookie used to hold the anti-CSRF token. This defaults to __CSRFCOOKIE. &lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; formfieldName &lt;/td&gt;&lt;td&gt; specifies the name of the form field used to hold the anti-CSRF token This defatults to __CSRFTOKEN. &lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; detectionResult &lt;/td&gt;&lt;td&gt; this may be either &lt;b&gt;RaiseException&lt;/b&gt;, which throws exceptions on a potential CSRF attack or &lt;b&gt;Redirect&lt;/b&gt; which will redirect to the URL specified in the errorPage setting.  You &lt;i&gt;must&lt;/i&gt; set a URL in the errorPage setting if you choose Redirect. This defaults to RaiseException. &lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; errorPage &lt;/td&gt;&lt;td&gt; a page name to redirect to if the detectionResult is set to Redirect. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;h2&gt;
Limitations
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;You, the developer, must ensure your GET requests are idempotent (i.e. they do not cause state changes within your application). GET requests are not protected with this module. See &lt;a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1.2" class="externalLink"&gt;http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1.2&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; which specifies that the GET and HEAD HTTP methods SHOULD NOT have the significance of taking an action other than retrieval.&lt;/li&gt;&lt;li&gt;Non-ASP.NET forms are not protected with this module.&lt;/li&gt;
&lt;/ul&gt;&lt;h2&gt;
Disclaimer
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;This software is provided &amp;quot;as-is&amp;quot;. You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. Like any security software this should become part of your defence in depth strategy and should not be solely relied upon for protection.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>blowdart</author><pubDate>Mon, 15 Dec 2008 22:29:59 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20081215102959P</guid></item><item><title>Updated Wiki: Home</title><link>http://www.codeplex.com/AntiCSRF/Wiki/View.aspx?title=Home&amp;version=11</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
AntiCSRF - A Cross Site Request Forgery (CSRF) module for ASP.NET
&lt;/h1&gt;&lt;h2&gt;
Description
&lt;/h2&gt;AntiCSRF makes it easier for ASP.NET developers to guard themselves against Cross Site Request Forgery. You&amp;#39;ll no longer have to manually add and check protection tokens to protected yourself against CSRF attacks.&lt;br /&gt;&lt;br /&gt;AntiCSRF developed in C&amp;#35;. &lt;br /&gt;&lt;h2&gt;
Notes
&lt;/h2&gt;The normal recommended way of adding a CSRF token to an ASP.NET application is to use ViewState in combination with a ViewStateUserKey. This requires ViewState to be enabled and an application to have some way of identifying a user uniquely, usually via a SessionID which in turn requires session state to be enabled. AntiCSRF does not have these requirements; instead if requires cookies to be enabled on the user's browser and uses a temporary cookie, cleared when the browser is closed, to identify a user and a hidden form field to carry the CSRF token.&lt;br /&gt; &lt;br /&gt;The ViewStateUserKey approach protects against One-Click Attacks. One-Click Attack is sometimes incorrectly referred to as Microsoft's name for Cross-Site Request Forgery. However, this is not entirely correct. One-Click Attacks refer to a subset of CSRF attacks - one that use a malicious ViewState to perform the request. Because web forms developed with ASP.NET use ViewState for post-backs, an attacker can perform the post-back they want the user to perform unknowingly, and record the ViewState. Due to the way that ASP.NET ignores HTTP verbs when using Request.Params versus Request.Form, and in web controls, this request can often be made via GET. For more&lt;br /&gt;details please see Alex Smolen's blog entry &lt;a href="http://keepitlocked.net/archive/2008/05/29/viewstateuserkey-doesn-t-prevent-cross-site-request-forgery.aspx" class="externalLink"&gt;http://keepitlocked.net/archive/2008/05/29/viewstateuserkey-doesn-t-prevent-cross-site-request-forgery.aspx&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;h2&gt;
Usage instructions
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Add a reference to the AntiCSS project or DLL, or copy the DLL to your web applications BIN folder.&lt;/li&gt;&lt;li&gt;Add a reference to the module into your web.config;&lt;/li&gt;&lt;ul&gt;
&lt;li&gt;For IIS6/IIS7 in Classic ASP.NET mode&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
&amp;lt;system.web&amp;gt;
  ....
  &amp;lt;httpModules&amp;gt;
    &amp;lt;add name=&amp;quot;AntiCSRF&amp;quot; type=&amp;quot;Idunno.AntiCsrf.AntiCsrfModule, Idunno.AntiCsrf&amp;quot;/&amp;gt;
  &amp;lt;/httpModules&amp;gt;
  ....
&amp;lt;/system.web&amp;gt;
&lt;/pre&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;For IIS7 in integrated pipeline mode&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;pre&gt;
&amp;lt;system.webmodules&amp;gt;
  ....
  &amp;lt;modules&amp;gt;
    &amp;lt;add name=&amp;quot;AntiCSRF&amp;quot; type=&amp;quot;Idunno.AntiCsrf.AntiCsrfModule, Idunno.AntiCsrf&amp;quot;/&amp;gt;
  &amp;lt;/modules&amp;gt;
  ....
&amp;lt;/system.webmodules&amp;gt;
&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;Optout any pages you do not want protected by adding the &lt;a href="http://www.codeplex.com/AntiCSRF/Wiki/View.aspx?title=Idunno.AntiCsrf.SuppressCsrfCheck&amp;amp;referringTitle=Home"&gt;Idunno.AntiCsrf.SuppressCsrfCheck&lt;/a&gt; attribute to their declarations, for example&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
[Idunno.AntiCsrf.SuppressCsrfCheck]
public partial class unprotectedPage : System.Web.UI.Page  
&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;For pages without a CodeBehind class you can optout by implementing the Idunno.AntiCsrf.ISuppressCsrfCheck interface, for example&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;
&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; EnableViewState=&amp;quot;false&amp;quot; %&amp;gt;
&amp;lt;%@ Implements Interface=&amp;quot;Idunno.AntiCsrf.ISuppressCsrfCheck&amp;quot; %&amp;gt;
&lt;/pre&gt;&lt;h2&gt;
Configuration
&lt;/h2&gt;The module supports configuration via web.config. In order to utilise the configuration options you must first add a custom configuration section to your web.config&lt;br /&gt;&lt;pre&gt;
&amp;lt;configuration&amp;gt;
    ....
    &amp;lt;configSections&amp;gt;
        ....
        &amp;lt;section name=&amp;quot;csrfSettings&amp;quot;  type=&amp;quot;Idunno.AntiCsrf.Configuration.CsrfSettings, Idunno.AntiCsrf&amp;quot; /&amp;gt;   
        ....
    &amp;lt;/configSections&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/pre&gt; Then create a configuration section in your web.config&lt;br /&gt;&lt;pre&gt;
&amp;lt;configuration&amp;gt;
    ....
    &amp;lt;csrfSettings cookieName=&amp;quot;__CSRFCOOKIE&amp;quot; formFieldName=&amp;quot;__CSRFTOKEN&amp;quot; detectionResult=&amp;quot;RaiseException&amp;quot; errorPage=&amp;quot;&amp;quot; /&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/pre&gt;The configuration options are as follows&lt;br /&gt;&lt;table&gt;
&lt;tr&gt;
&lt;th&gt; Name &lt;/th&gt;&lt;th&gt; Purpose &lt;/th&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; cookieName &lt;/td&gt;&lt;td&gt; specifies the name of the cookie used to hold the anti-CSRF token. This defaults to __CSRFCOOKIE. &lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; formfieldName &lt;/td&gt;&lt;td&gt; specifies the name of the form field used to hold the anti-CSRF token This defatults to __CSRFTOKEN. &lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; detectionResult &lt;/td&gt;&lt;td&gt; this may be either &lt;b&gt;RaiseException&lt;/b&gt;, which throws exceptions on a potential CSRF attack or &lt;b&gt;Redirect&lt;/b&gt; which will redirect to the URL specified in the errorPage setting.  You &lt;i&gt;must&lt;/i&gt; set a URL in the errorPage setting if you choose Redirect. This defaults to RaiseException. &lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt; errorPage &lt;/td&gt;&lt;td&gt; a page name to redirect to if the detectionResult is set to Redirect. &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;h2&gt;
Limitations
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;You, the developer, must ensure your GET requests are idempotent (i.e. they do not cause state changes within your application). GET requests are not protected with this module. See &lt;a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1.2" class="externalLink"&gt;http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1.2&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; which specifies that the GET and HEAD HTTP methods SHOULD NOT have the significance of taking an action other than retrieval.&lt;/li&gt;&lt;li&gt;Non-ASP.NET forms are not protected with this module.&lt;/li&gt;
&lt;/ul&gt;&lt;h2&gt;
Disclaimer
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;This software is provided &amp;quot;as-is&amp;quot;. You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. Like any security software this should become part of your defence in depth strategy and should not be solely relied upon for protection.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>blowdart</author><pubDate>Mon, 15 Dec 2008 09:19:30 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20081215091930A</guid></item></channel></rss>