Cybersecurity Insurance Checklist - Meet Insurance Requirements with BeyondTrust PAM Download for Free

  • Partners
  • Support
  • Careers
  • English
    • Deutsch
    • français
    • español
    • 한국어
    • português
BeyondTrust
  • Products

    Privileged Password Management

    Discover, manage, audit, and monitor privileged accounts and credentials.

    • Password Safe
    • DevOps Secrets Safe
    • Privileged Access Discovery Application

    Endpoint Privilege Management

    Enforce least privilege across Windows, Mac, Linux, and Unix endpoints.

    • Windows and Mac
    • Unix and Linux
    • Active Directory Bridge

    Secure Remote Access

    Centrally manage remote access for service desks, vendors, and operators.

    • Remote Support
    • Privileged Remote Access
    • Privileged Access Discovery Application

    Cloud Security Management

    Automate the management of identities and assets across your multicloud footprint.

    • Cloud Privilege Broker

    BeyondInsight

    Experience the industry’s most innovative, comprehensive platform for privileged access management.

  • Solutions

    Use Cases

    • Cloud Security
    • Compliance
    • Cyber Insurance
    • Digital Transformation
    • Endpoint Security
    • Operational Technology
    • Ransomware
    • Service Desk Efficiency
    • Zero Trust

    Industry Applications

    • Financial Services
    • Government Agencies
    • Healthcare
    • Law Enforcement
    • Manufacturing
    • Schools & Universities

    Solutions

    The BeyondTrust Privileged Access Management portfolio is an integrated solution that provides visibility and control over all privileged accounts and users.

  • Resources

    Learn

    • Blog
    • Customer Stories
    • Competitor Comparisons
    • Datasheets
    • Demos
    • Glossary
    • Podcast
    • Whitepapers

    Attend

    • Events
    • Go Beyond
    • Training
    • Webinars

    Support

    • Changelog
    • Professional Services
    • Technical Documentation

    Universal Privilege Management

    Our innovative Universal Privilege Management approach secures every user, asset, and session across your entire enterprise.

  • Company
    • About
    • Leadership
    • Core Values
    • Partners
    • Careers
  • Watch Demo
  • Contact Sales

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

October 18, 2014

  • Blog
  • Archive

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

Photograph of Scott Lang

Scott Lang, Sr. Director, Product Marketing at BeyondTrust

Scott Lang has nearly 20 years of experience in technology product marketing, currently guiding the product marketing strategy for BeyondTrust’s privileged account management solutions and vulnerability management solutions. Prior to joining BeyondTrust, Scott was director of security solution marketing at Dell, formerly Quest Software, where he was responsible for global security campaigns, product marketing for identity and access management and Windows server management.

Stay Up To Date

Get the latest news, ideas, and tactics from BeyondTrust. You may unsubscribe at any time.

I agree to receive product related communications from BeyondTrust as detailed in the Privacy Policy, and I may manage my preferences or withdraw my consent at any time.

You May Also Be Interested In:

Whitepapers

Cybersecurity Insurance Checklist

Whitepapers

Microsoft Vulnerabilities Report 2021

Whitepapers

Privileged Access Management: PAM Checklist

Keep up with BeyondTrust

I agree to receive product related communications from BeyondTrust as detailed in the Privacy Policy, and I may manage my preferences or withdraw my consent at any time.

Customer Support
Contact Sales

Products

  • Endpoint Privilege Management
  • Password Management
  • Privileged Remote Access
  • DevOps Secrets Safe
  • Remote Support
  • Cloud Privilege Broker

Resources

  • Blog
  • Case Studies
  • Competitor Comparisons
  • Datasheets
  • Glossary
  • Podcast
  • Videos
  • Webcasts
  • Whitepapers

About

  • Company
  • Careers
  • Contact
  • Events
  • Leadership Team
  • Partner Program
  • Press
BeyondTrust Logo
  • Facebook
  • Twitter
  • LinkedIn
  • Privacy
  • Security
  • Manage Cookies
  • WEEE Compliance

Copyright © 1999 — 2022 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.