Alert icon Keyboard navigation enabled.
Alert icon TAB or Shift+TAB to navigate across. Down ↓ to open menu. ESC to close menu.
Alert icon Down ↓ to select section. Right → to activate. Up ↑ / Down ↓ / Tab to traverse all. ESC to exit.
BeyondTrust
Skip to content Use space or enter to skip.

What can we help you find today?

Instant Results
  • Website Results
  • Technical Documentation

Filter Options

Focus your search

Filtering by

Your recent searches:

Contact Us Chat with Sales Get Support
  • English
  • Deutsch
  • français
  • español
  • 한국어
  • português
  • Home
  • Resources
  • Blog
  • Exploiting MS14-059 because sometimes XSS is fun, sometimes... current page
Link copied

Exploiting MS14-059 because sometimes XSS is fun, sometimes...

Oct 18, 2014
Author:
Slang
Scott Lang
Sr. Director, Product Marketing at BeyondTrust
Blog banner default
Exploiting MS14-059 because sometimes XSS is fun, sometimes...
Slang
Scott Lang
Sr. Director, Product Marketing at BeyondTrust

This October, Microsoft has provided a security update for System.Web.Mvc.dll which addresses a ‘Security Feature Bypass’. The vulnerability itself is in ASP.NET MVC technology and given its wide adoption we thought we would take a closer look.

Referring to the bulletin we can glean a few useful pieces of information:

“A cross-site scripting (XSS) vulnerability exists in ASP.NET MVC that could allow an attacker to inject a client-side script into the user's web browser… The vulnerability is caused when ASP.NET MVC fails to properly encode input.”

We looked at System.Web.Mvc.dll Version 5.1.20129.0 (unpatched) vs. System.Web.Mvc.dll Version 5.1.20821.0 (patched)

After decompiling each DLL with dotPeek (https://www.jetbrains.com/decompiler/) and diffing the output with WinMerge (http://winmerge.org/) we can see there are only a few files that have nontrivial changes.

[caption id="attachment_20567" align="alignnone" width="806"]Figure 1 - Changed Classes Figure 1 - Changed Classes[/caption]

After reviewing the few areas that actually had meaningful changes, it appeared that XSS could have been patched in a few places, but DisplayTextExtensions.cs contained the fix most interesting to us. The pre-patched code can be seen below.

[caption id="attachment_20568" align="alignnone" width="676"]Figured 2 - DisplayTextExtensions.cs (System.Web.MVC.dll 5.1.20129.0) Figured 2 - DisplayTextExtensions.cs (System.Web.MVC.dll 5.1.20129.0)[/caption]

We can now compare this code with the new logic which utilizes the new HtmlEncode property of the modelMetadata object to determine whether or not to HtmlEncode the string.

[caption id="attachment_20569" align="alignnone" width="662"]Figure 3 - DisplayTextExtensions.cs (System.Web.MVC.dll 5.1.20821.0) Figure 3 - DisplayTextExtensions.cs (System.Web.MVC.dll 5.1.20821.0)[/caption]

The metadata.HtmlEncode bool which the conditional is based upon can be found in ModelMetadata.cs.

[caption id="attachment_20570" align="alignnone" width="458"]Figure 4 - ModelMetadata.cs (System.Web.MVC.dll 5.1.20821.0) Figure 4 - ModelMetadata.cs (System.Web.MVC.dll 5.1.20821.0)[/caption]

We can see here that this added boolean defaults to true.

So to restate our discoveries, we think that the DisplayTextFor() function will call the DisplayTextHelper() function which in turn will allow for XSS due to its failure to encode HTML characters. The easiest thing to do here is mock up some sample code to see what happens. Obviously it was made quickly for brevity of this post so some parts will change in a real-world application. Most of that should be obvious but we made a couple extend notes before so there isn't any confusion.

mvc5

We first create a model ‘User’ with a property ‘name’.

mvc6

We then construct our Controller which contains a classical XSS vector in this Name property. Obviously in a real-world web application myUser.Name would have its data set from some user controlled area of web code like a form or related.

mvc7

The bug is as simple as now calling displayTextFor() on our Name property which triggers the underlying XSS. In a real-world scenario you would want to take into account ASP.NET and Internet Explorer's XSS filters. Those are always useful mitigation but never 100% in filtering out this type of data before it reaches a vulnerable function such as was fixed in this patch.

mvc8

It is important for web developers to review their servers to both make sure that this patch has been applied and that their MVC related projects have been updated to patched versions. For customers you can use the following vulnerability audits from Retina to determine if a server has been patched or not:

[MS14-059] – Vulnerability in ASP.NET MVC Could Allow Security Feature Bypass (2990942)

35434 – Microsoft ASP.NET MVC Security Feature Bypass (2990942) – MVC 2.0 35435 – Microsoft ASP.NET MVC Security Feature Bypass (2990942) – MVC 3.0 35436 – Microsoft ASP.NET MVC Security Feature Bypass (2990942) – MVC 4.0 35437 – Microsoft ASP.NET MVC Security Feature Bypass (2990942) – MVC 5.0 35439 – Microsoft ASP.NET MVC Security Feature Bypass (2990942) – MVC 5.1

Latest Posts
  • Hooked on Identity (Part 2): Abusing OAuth Trust Boundaries in Okta
    Jun 12, 2026 Hooked on Identity (Part 2): Abusing OAuth Trust Boundaries in Okta
    Blog
    7m
  • Hooked on Identity: Abusing SAML Assertion Inline Hooks in Okta
    Jun 9, 2026 Hooked on Identity: Abusing SAML Assertion Inline Hooks in Okta
    Blog
    6m
  • Joining Project Glasswing: Securing the Privilege Backbone of the AI Era
    Jun 8, 2026 Joining Project Glasswing: Securing the Privilege Backbone of the AI Era
    Blog
    5m
  • The Most Common & Most Dangerous Types of Shadow IT
    Jun 5, 2026 The Most Common & Most Dangerous Types of Shadow IT
    Blog
    19m
  • 14 Password Management Best Practices
    May 28, 2026 14 Password Management Best Practices
    Blog
    12m
Related
  • Meeting SWIFT Customer Security Controls Framework Requirements with BeyondTrust Privilege and Vulnerability Management Solutions
    Aug 14, 2017 Meeting SWIFT Customer Security Controls Framework Requirements with BeyondTrust Privilege and Vulnerability Management Solutions
    Blog
    1m
  • The Effectiveness of Identity-Based Security Controls on Breach Reduction: What New IDSA Research Spells Out
    May 20, 2020 The Effectiveness of Identity-Based Security Controls on Breach Reduction: What New IDSA Research Spells Out
    Blog
    1m
Share this Article
  • Link
Stay up to Date
Get the latest news, ideas, and tactics from BeyondTrust. You may unsubscribe at any time.

Keep up with BeyondTrust

Customer Support Get Started
  • LinkedIn
  • X
  • Facebook
  • Instagram
  • Add BeyondTrust as a preferred source on Google
  • Privacy
  • Security
  • Manage Cookies
  • Do Not Sell My Data
  • WEEE Compliance

Copyright © 2003 — 2026 BeyondTrust Corporation. All rights reserved. Other trademarks identified on this page are owned by their respective owners. BeyondTrust Corporation is not a chartered bank or trust company, or depository institution. It is not authorized to accept deposits or trust accounts and is not licensed or regulated by any state or federal banking authority.

Prefers reduced motion setting detected. Animations will now be reduced as a result.