Posts

Showing posts with the label Security

Mitigating cookies theft using HttpOnly

Image
Cross Side Scripting (XSS) Cross Side Scripting is a technique that enables attackers to inject client-side script into Web pages viewed by other users. It's a computer security vulnerability typically found in Web applications. This means that a hacker would be able to insert JavaScript in a text field, say a blog post. This script would be executed by the browser, through this page, for every user that reads the post thread after it is published. The script could in turn read the current users cookie and send it to a a remote service and store is for later use. To protect a cookie against the XSS vulnerability there is a header flag available for the “Set-Cookie” HTTP response header. This header will mitigate the risk of client side script accessing the protected cookie (if the browser supports it). Testing the theory To test this theory, I will demonstrate it using a test application. Our test application consists of a ASP.Net web application and some javascript. The fo...

Encrypted Cookies using ASP.NET

Image
Introduction In order to store use specific information during a ASP.Net session you have to option to place state data in a browser cookie . These cookie are send in plain text and using various tool it is possible to read the content of these cookies. Although reading might not always be a problem, the ability to change the content of a cookie is a big thread. Tampering with the cookie is actually very easy, and i will demonstrate this using a Firefox extension called TamperData . Tampering a Cookie Setup I started by creating a small ASP.NET application that checks the presence of our cookie. If not sets, a cookie is create and filled in the page load. After that i print the values on the page. 1: protected void Page_Load( object sender, EventArgs e) 2: { 3: if (Request.Cookies[" __IGUZA.NET "] == null ) 4: { 5: HttpCookie cookie = new HttpCookie(" __IGUZA.NET "); 6: cookie[" SomeKey "] = " Some...

Reliable Message Exchange Using XML Signing

Image
Introduction A well known service oriented scenario is where a client and service application communicate using message exchange over a channel. This channel is either secured, using for instance SSL, or unsecured where the data is send in plain text. One of the commonly used message bases is XML. XML is a standard way of describing relational data, and can be read by most platforms. This makes XML a interoperable message base. On the downside, this message type is easy to read and it therefore easy to change. If a third party where to intercept the message, for instance using a proxy server, it could easily change the content of the message and send it to the original endpoint. This is called tampering. To detect changes to the content, a message send through the channel can be signed. Signing is a way to provide reliable messaging over a non-secure channel. It also provides some sort of authentication because the message can be validate that is was send from the expected cli...