Marcus Mac Innes' Blog

Irish Views on .NET, C# and of course "Services"...
posts - 48, comments - 447, trackbacks - 64

ASP.Net 2.0 Roadshow in Dublin

Following my talk on Securing ASP.Net Applications at last Friday’s Dublin leg of Microsoft’s ASP.Net 2.0 European Roadshow, there were a couple of requests for the slides and code samples. They can be downloaded from here.

Talking with developers afterwards in the bar, it was really interesting to see how many of them had heard of SQL Injection and XSS attacks but had not actually realised how vulnerable an application and the other applications which share the same database can be. Most had never actually seen how an attack would be carried out.

I demonstrated how security on a web site can be compromised by taking advantage of holes within the application code. These holes can be discovered by using a series of probes which disclose whether or not vulnerability exists.

The demonstration attacked the site’s Login page to discover vulnerabilities. These were then exploited to bypass the application security altogether. We were then able to take control of the database for this and other applications which share the database, create our own login accounts with administrative privileges and access the site’s customer’s credit card information.

I also demonstrated using a Cross Site Scripting attack how the Forms Authentication cookie could be stolen and silently sent to an attacker’s website to be stored for later use. Once the attacker is in position of this cookie, they would be able to login to the original web site using someone else’s authentication token.

The key message of the talk was to ensure that all user input is validated before any other processing is done. This together with strict use of secure coding standards would have disabled any attacker’s opportunities.

For more information on writing secure code, please feel free to contact me.

And many thanks to Microsoft for asking me to speak at this great event with the ASP.NET team!

posted on Monday, March 07, 2005 10:14 AM

Feedback

# SQL Security and performances

3/7/2005 2:12 PM | Developer

# Marcus follows up: 'Best Practices for Hacking ASP.NET sites.'

3/11/2005 1:29 PM | Robert Burke's weblog

# Marcus follows up: 'Best Practices for Hacking ASP.NET sites.'

3/11/2005 1:52 PM | Robert Burke's weblog

# re: ASP.Net 2.0 Roadshow in Dublin

I am just wondering - is there any way to mark a string (or property) marked as "non validated" and have a security excetion thrown if the contect of the string is accessed before it is validated.

I assume that this can be done by inheriteing string but that class is sealed.
3/11/2005 3:13 PM | AIM48

# re: ASP.Net 2.0 Roadshow in Dublin

Aim48, that’s an interesting idea... Inheriting from a string (as you correctly point out) is not the way to go. There are two ways a website can receive input from the outside (discounting web services). The QueryString and HTML INPUT tags. I'm not sure if you were at the talk in Dublin, but I demonstrated the use of a server side SafeTextBox which automatically encodes the user's input to help guard against XSS attacks. In theory you could extend this class to include validation. The problem is going to be that each instance of an input will more than likely have very different validation requirements and hence you will either need to subclass the SafeTextBox control for each different validation or build a validation framework to cater for all the permutations. The QueryString will have to be dealt with separately. I normally split my applications between presentation and business processing. I consider anything that resides in the presentation layer (i.e the page, control or usercontrol classes) totally unsafe. The presentation layer does not do any business processing at all. It is just concerned with taking stuff in and sending stuff out. At the business layer, ALL public methods need to validate input parameters. This is a simple enough rule to follow since any deviation can be picked up relatively quickly in a code review. "Is the method public on a public class? Yes, check that all inputs are immediately validated". All other methods that are not called from the presentation layer should be marked "internal" or "private". There is no need to validate their input parameters. This method does not guard against internal or private methods being called via reflection, watch out! You also need to make sure that you are being called by a trusted assembly, and that’s where Code Access Security comes in…but that’s a whole different conversation. :)
3/11/2005 4:24 PM | Marcus Mac Innes

# re: String.Format: A Simple Tip

3/15/2005 10:39 AM | Living .NET...

# re: ASP.Net 2.0 Roadshow in Dublin


http://www.vatan.tc
http://www.internet7.org
http://www.e-sorgulama.com
http://www.forumitiraf.com
http://www.islamiruyatabirleri.com
http://forum.vatan.tc/sitemaps-0.html
http://forum.vatan.tc/sitemaps-1.html
http://forum.vatan.tc/sitemaps-2.html
http://forum.vatan.tc/sitemaps-3.html
http://forum.vatan.tc/sitemaps-4.html
http://forum.vatan.tc/sitemaps-5.html
http://forum.vatan.tc/sitemaps-6.html
http://forum.vatan.tc/sitemaps-7.html
http://forum.vatan.tc/sitemaps-8.html
http://forum.vatan.tc/sitemaps-9.html
http://forum.vatan.tc/sitemaps-10.html
http://forum.vatan.tc/sitemaps-11.html
http://forum.vatan.tc/sitemaps-12.html
http://forum.vatan.tc/sitemaps-13.html
http://forum.vatan.tc/sitemaps-14.html
http://forum.vatan.tc/sitemaps-15.html
http://forum.vatan.tc/sitemaps-16.html
http://forum.vatan.tc/sitemaps-17.html
http://forum.vatan.tc/sitemaps-18.html
http://forum.vatan.tc/sitemaps-19.html
http://forum.vatan.tc/sitemaps-20.html


4/10/2008 11:02 AM | forum
Post a new comment about this topic
Title  
Name  
Url

Comments   
Enter the code you see: