<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: ASP.NET MVC: Preventing XSS attacks</title>
	<atom:link href="http://www.markhneedham.com/blog/2009/02/12/aspnet-mvc-preventing-xss-attacks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markhneedham.com/blog/2009/02/12/aspnet-mvc-preventing-xss-attacks/</link>
	<description>Thoughts on Software Development</description>
	<lastBuildDate>Wed, 17 Mar 2010 23:38:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: ASP.NET MVC: Pre-compiling views when using SafeEncodingCSharpCodeProvider at Mark Needham</title>
		<link>http://www.markhneedham.com/blog/2009/02/12/aspnet-mvc-preventing-xss-attacks/comment-page-1/#comment-12884</link>
		<dc:creator>ASP.NET MVC: Pre-compiling views when using SafeEncodingCSharpCodeProvider at Mark Needham</dc:creator>
		<pubDate>Tue, 24 Mar 2009 12:59:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=931#comment-12884</guid>
		<description>[...] I previously mentioned we&#039;re using Steve Sanderson&#039;s SafeEncodingHelper to protect our website from cross scripting [...]</description>
		<content:encoded><![CDATA[<p>[...] I previously mentioned we're using Steve Sanderson's SafeEncodingHelper to protect our website from cross scripting [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: C#: Extensions methods != Open classes at Mark Needham</title>
		<link>http://www.markhneedham.com/blog/2009/02/12/aspnet-mvc-preventing-xss-attacks/comment-page-1/#comment-9791</link>
		<dc:creator>C#: Extensions methods != Open classes at Mark Needham</dc:creator>
		<pubDate>Wed, 18 Feb 2009 20:23:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=931#comment-9791</guid>
		<description>[...] In this case it would have been nice to be able to open up the HtmlHelper class and change these methods. Unfortunately since they were defined as extension methods, extending HtmlHelper didn&#039;t give access to them so we ended up coming up with a solution which feels a bit too hacky for my liking. [...]</description>
		<content:encoded><![CDATA[<p>[...] In this case it would have been nice to be able to open up the HtmlHelper class and change these methods. Unfortunately since they were defined as extension methods, extending HtmlHelper didn't give access to them so we ended up coming up with a solution which feels a bit too hacky for my liking. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ASP.NET MVC Archived Blog Posts, Page 1</title>
		<link>http://www.markhneedham.com/blog/2009/02/12/aspnet-mvc-preventing-xss-attacks/comment-page-1/#comment-9333</link>
		<dc:creator>ASP.NET MVC Archived Blog Posts, Page 1</dc:creator>
		<pubDate>Mon, 16 Feb 2009 05:41:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=931#comment-9333</guid>
		<description>[...] to VoteASP.NET MVC: Preventing XSS attacks at Mark Needham (2/12/2009)Thursday, February 12, 2009 from Mark NeedhamXSS(Cross site scripting) attacks on websites seem to [...]</description>
		<content:encoded><![CDATA[<p>[...] to VoteASP.NET MVC: Preventing XSS attacks at Mark Needham (2/12/2009)Thursday, February 12, 2009 from Mark NeedhamXSS(Cross site scripting) attacks on websites seem to [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Needham: Encoding user entered data &#124; Enterprise Java</title>
		<link>http://www.markhneedham.com/blog/2009/02/12/aspnet-mvc-preventing-xss-attacks/comment-page-1/#comment-9284</link>
		<dc:creator>Mark Needham: Encoding user entered data &#124; Enterprise Java</dc:creator>
		<pubDate>Sun, 15 Feb 2009 22:34:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=931#comment-9284</guid>
		<description>[...] previously wrote about protecting websites from cross site scripting in the ASP.NET MVC framework by encoding user input when we are going to display it in the [...]</description>
		<content:encoded><![CDATA[<p>[...] previously wrote about protecting websites from cross site scripting in the ASP.NET MVC framework by encoding user input when we are going to display it in the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Needham: Encoding user entered data &#124; Enterprise Java</title>
		<link>http://www.markhneedham.com/blog/2009/02/12/aspnet-mvc-preventing-xss-attacks/comment-page-1/#comment-9285</link>
		<dc:creator>Mark Needham: Encoding user entered data &#124; Enterprise Java</dc:creator>
		<pubDate>Sun, 15 Feb 2009 22:34:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=931#comment-9285</guid>
		<description>[...] previously wrote about protecting websites from cross site scripting in the ASP.NET MVC framework by encoding user input when we are going to display it in the [...]</description>
		<content:encoded><![CDATA[<p>[...] previously wrote about protecting websites from cross site scripting in the ASP.NET MVC framework by encoding user input when we are going to display it in the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Encoding user entered data at Mark Needham</title>
		<link>http://www.markhneedham.com/blog/2009/02/12/aspnet-mvc-preventing-xss-attacks/comment-page-1/#comment-9070</link>
		<dc:creator>Encoding user entered data at Mark Needham</dc:creator>
		<pubDate>Sat, 14 Feb 2009 15:49:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=931#comment-9070</guid>
		<description>[...] previously wrote about protecting websites from cross site scripting in the ASP.NET MVC framework by encoding user input when we are going to display it in the [...]</description>
		<content:encoded><![CDATA[<p>[...] previously wrote about protecting websites from cross site scripting in the ASP.NET MVC framework by encoding user input when we are going to display it in the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Angus McDonald</title>
		<link>http://www.markhneedham.com/blog/2009/02/12/aspnet-mvc-preventing-xss-attacks/comment-page-1/#comment-8848</link>
		<dc:creator>Angus McDonald</dc:creator>
		<pubDate>Fri, 13 Feb 2009 09:20:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=931#comment-8848</guid>
		<description>Mark,

I keep wondering if there is some way to use the new XElement object from System.XML.Linq (currently only in VB.NET) to give us helpers that create strongly typed XHTML.

We are doing something at the moment with our CMS templates in ASP.NET webforms that will use this approach, I&#039;m pretty sure we could come up with something for ASP.NET MVC too - but that still leaves the problem of how to reference them. My gut feel is the HtmlHelper methods will end up being left behind as ASP.NET MVC matures anyway ...

Angus/Falkayn</description>
		<content:encoded><![CDATA[<p>Mark,</p>
<p>I keep wondering if there is some way to use the new XElement object from System.XML.Linq (currently only in VB.NET) to give us helpers that create strongly typed XHTML.</p>
<p>We are doing something at the moment with our CMS templates in ASP.NET webforms that will use this approach, I'm pretty sure we could come up with something for ASP.NET MVC too &#8211; but that still leaves the problem of how to reference them. My gut feel is the HtmlHelper methods will end up being left behind as ASP.NET MVC matures anyway &#8230;</p>
<p>Angus/Falkayn</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dew Drop - February 12, 2009 &#124; Alvin Ashcraft's Morning Dew</title>
		<link>http://www.markhneedham.com/blog/2009/02/12/aspnet-mvc-preventing-xss-attacks/comment-page-1/#comment-8710</link>
		<dc:creator>Dew Drop - February 12, 2009 &#124; Alvin Ashcraft's Morning Dew</dc:creator>
		<pubDate>Thu, 12 Feb 2009 14:43:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=931#comment-8710</guid>
		<description>[...] ASP.NET MVC: Preventing XSS Attacks (Mark Needham) [...]</description>
		<content:encoded><![CDATA[<p>[...] ASP.NET MVC: Preventing XSS Attacks (Mark Needham) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Needham</title>
		<link>http://www.markhneedham.com/blog/2009/02/12/aspnet-mvc-preventing-xss-attacks/comment-page-1/#comment-8705</link>
		<dc:creator>Mark Needham</dc:creator>
		<pubDate>Thu, 12 Feb 2009 14:16:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=931#comment-8705</guid>
		<description>Ah neat, didn&#039;t realise we had the ability to do that from the web.config - sounds like a pretty cool approach.

I like the idea of the code-gen - not only is it long and boring to manually write them but it&#039;s quite difficult to tell whether or not you&#039;ve covered everything since they&#039;re all extension methods rather than being overridable methods on a class for example.</description>
		<content:encoded><![CDATA[<p>Ah neat, didn't realise we had the ability to do that from the web.config &#8211; sounds like a pretty cool approach.</p>
<p>I like the idea of the code-gen &#8211; not only is it long and boring to manually write them but it's quite difficult to tell whether or not you've covered everything since they're all extension methods rather than being overridable methods on a class for example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Sanderson</title>
		<link>http://www.markhneedham.com/blog/2009/02/12/aspnet-mvc-preventing-xss-attacks/comment-page-1/#comment-8694</link>
		<dc:creator>Steve Sanderson</dc:creator>
		<pubDate>Thu, 12 Feb 2009 13:08:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=931#comment-8694</guid>
		<description>Hi Mark

The other way to intercept all the Html.* calls is to create your own set of wrapper methods in another namespace/assembly, and then to edit your web.config file. Under pages/namespaces, remove the reference to System.Web.Mvc.Html, and reference your wrapper methods&#039; namespace instead. That will change which methods all your views call without having to touch any of the views.

You would still have to create wrappers for all the Html.* helpers, which is a long and boring job. I was thinking of making a little tool that reflects over System.Web.Mvc.dll and generates C# code that wraps any string-emitting extension method on HtmlHelper. Then we get the benefits without the work, and can easily update the wrappers if Microsoft changes their code.

What do you think?</description>
		<content:encoded><![CDATA[<p>Hi Mark</p>
<p>The other way to intercept all the Html.* calls is to create your own set of wrapper methods in another namespace/assembly, and then to edit your web.config file. Under pages/namespaces, remove the reference to System.Web.Mvc.Html, and reference your wrapper methods' namespace instead. That will change which methods all your views call without having to touch any of the views.</p>
<p>You would still have to create wrappers for all the Html.* helpers, which is a long and boring job. I was thinking of making a little tool that reflects over System.Web.Mvc.dll and generates C# code that wraps any string-emitting extension method on HtmlHelper. Then we get the benefits without the work, and can easily update the wrappers if Microsoft changes their code.</p>
<p>What do you think?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
