-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

===========================================================================
             AUSCERT External Security Bulletin Redistribution

                               ESB-2017.0250
       Microsoft Security Advisory 4010983 Vulnerability in ASP.NET
               Core MVC 1.1.0 Could Allow Denial of Service
                              30 January 2017

===========================================================================

        AusCERT Security Bulletin Summary
        ---------------------------------

Product:           Microsoft ASP.NET Core MVC
Publisher:         Microsoft
Operating System:  Windows
Impact/Access:     Denial of Service -- Remote/Unauthenticated
Resolution:        Patch/Upgrade

Original Bulletin: 
   https://technet.microsoft.com/library/security/4010983.aspx

- --------------------------BEGIN INCLUDED TEXT--------------------

Microsoft Security Advisory 4010983 Vulnerability in ASP.NET Core MVC 1.1.0 
Could Allow Denial of Service

Published: January 27, 2017

Version: 1.0

Executive Summary

Microsoft is releasing this security advisory to provide information about a 
vulnerability in the public versions of ASP.NET Core MVC 1.1.0. This advisory
also provides guidance on what developers can do to update their applications
correctly.

Microsoft is aware of a security vulnerability in the public version of 
ASP.NET Core MVC 1.1.0 where a malformed HTTP request could lead to a denial 
of service.

ASP.NET Core is next generation of ASP.NET that provides a familiar and modern
framework for web and cloud scenarios, running on top of .NET Core. These 
products are actively developed by the ASP.NET team in collaboration with a 
community of open source developers, running on Windows, Mac OS X and Linux. 
When ASP.NET Core was released, the version number was reset to 1.0.0 to 
reflect the fact that it is a separate product from its predecessor - ASP.NET.

Developers are advised to update all apps to use package version 1.1.1 or 
greater. Mitigating Factors

Only applications targeting ASP.NET Core 1.1.0 are affected. Applications 
targeting ASP.NET Core 1.0.0, 1.0.1 or 1.02 are not affected. Affected 
Software

The vulnerability affects any Microsoft ASP.NET Core project if it uses the 
following affected package version.

Affected package and version
Package name                    Package version
Microsoft.AspNetCore.Mvc.Core   1.1.0 

Advisory FAQ

How do I know if I am affected? ASP.NET Core has two different types of 
dependencies, direct and transitive. If your project has a direct or 
transitive dependency on Microsoft.AspNetCore.Mvc.Core version 1.1.0 you are 
affected. 

.NET Core Project formats
.NET Core has two different project file formats, depending on what software 
created the project.
project.json is the original format, included in .NET Core 1.0 and Visual
Studio 2015. csproj is the format used in Visual Studio 2017.
You must ensure you follow the correct update instructions for your project 
type. 

Direct Dependencies

Direct dependencies are dependencies where you specifically add a package to 
your project. For example, if you add the Microsoft.AspNetCore.Mvc package to
your project then you have taken a direct dependency on 
Microsoft.AspNetCore.Mvc.

Direct dependencies are discoverable by reviewing your project.json or csproj
file. 

Transitive Dependencies

Transitive dependencies occur when you add a package to your project that in 
turn relies on another package. For example, if you add the 
Microsoft.AspNetCore.Mvc package to your project it depends on the 
Microsoft.AspNetCore.Mvc.Core package (amongst others). Your project has a 
direct dependency on Microsoft.AspNetCore.Mvc and a transitive dependency on 
the Microsoft.AspNetCore.Mvc.Core package.

Transitive dependencies are reviewable in the Visual Studio Solution Explorer
window, which supports searching, or by reviewing the project.lock.json file 
contained in the root directory of your project for project.json projects or 
the project.assets.json file contained in the obj directory of your project 
for csproj projects. These files are the authoritative list of all packages 
used by your project, containing both direct and transitive dependencies.

Any ASP.NET Core MVC 1.1 application will have a dependency on the affected 
package, either direct or transitive 

How do I fix my affected app?

You will need to fix both direct dependencies and review and fix any 
transitive dependencies. Version 1.1.1 of the vulnerable package contains the
fixes required to secure your app. 

Fixing Direct Dependencies - project.json/VS2015

Open your project.json file in your editor. Look for the dependencies section.
Below is an example dependencies section:

  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.1.0",
      "type": "platform"
    },
    "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
    "Microsoft.AspNetCore.Mvc.Core": "1.1.0",
  }

This example has three direct dependencies, Microsoft.NetCore.App, 
Microsoft.AspNetCore.Server.Kestrel and Microsoft.AspNetCore.Mvc.Core.

Microsoft.NetCore.App is the platform the application targets, you should 
ignore this. The other packages expose their version is to the right of the 
package name, in our example our non-platform packages are version 1.1.0.

Review your direct dependencies for any instance of 
Microsoft.AspNetCore.Mvc.Core version 1.1.0, in the example above there is a 
direct dependency on the vulnerable package.

To update to the new package, change the version number to be 1.1.1. After 
updating the vulnerable package version save your project.json file. 
Mt778901.note(en-us,Security.10).gifNote: As part of patching ASP.NET Core MVC
we update every Microsoft.AspNetCore.Mvc.* package. If, for example, you have
a dependency on Microsoft.AspNetCore.Mvc you should update its version to 
1.1.1, and it will also update the vulnerable Microsoft.AspNetCore.Mvc.Core 
package.

The dependencies section in our example project.json would now look as 
follows:

  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.1.0",
      "type": "platform"
    },
    "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
    "Microsoft.AspNetCore.Mvc.Core": "1.1.1",
  }

If you are using Visual Studio and save your updated project.json file Visual
Studio will restore the new package version. You can see the restore results 
by opening the Output Window (Ctrl+Alt+O) and change the Show output from drop
down to Package Manager.

If you are not using Visual Studio open a command line and change to your 
project directory. Execute the dotnet restore command to restore your new 
dependency.

Once you have addressed all your direct dependencies you must also review your
transitive dependencies. 

Fixing Direct Dependencies csproj/VS2017

Open your projectname.csproj file in your editor, or right click on the 
project in Visual Studio 2017 and choose Edit projectname.csproj from the 
content menu, where projectname is the name of your project. Look for 
PackageReference nodes. Below shows an example project file:

<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp1.1</TargetFramework>
  </PropertyGroup>
  <PropertyGroup>
    <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore" Version="1.1.0" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="1.1.0" />
  </ItemGroup>
  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0-msbuild3-final" />
  </ItemGroup>
</Project> 

The example has two direct package dependencies, as seen by the two 
PackageReference elements. The name of the package is in the Include 
attribute, and the package version number is in the Version attribute expose 
their version is to the right of the package name. The example shows two 
packages Microsoft.AspNetCore and Microsoft.AspNetCore.Mvc.Core and each 
package is version 1.1.0.

Review your PackageReference elements for any instance of 
Microsoft.AspNetCore.Mvc.Core version 1.1.0.

If a reference is present update to the new package by change the Version 
attribute value to be 1.1.1. After updating the vulnerable package version 
save your csproj file. Mt778901.note(en-us,Security.10).gifNote: As part of 
patching ASP.NET Core MVC we update every Microsoft.AspNetCore.Mvc.* package.
If, for example, you have a dependency on Microsoft.AspNetCore.Mvc you should
update its version to 1.1.1, and it will also update the vulnerable 
Microsoft.AspNetCore.Mvc.Core package.

The example csproj would now look as follows:

<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp1.1</TargetFramework>
  </PropertyGroup>
  <PropertyGroup>
    <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore" Version="1.1.0" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="1.1.1" />
  </ItemGroup>
  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0-msbuild3-final" />
  </ItemGroup>
</Project> 

If you are using Visual Studio and save your updated csproj file Visual Studio
will restore the new package version. You can see the restore results by 
opening the Output Window (Ctrl+Alt+O) and change the Show output from drop 
down to Package Manager.

If you are not using Visual Studio open a command line and change to your 
project directory. Execute the dotnet restore command to restore your new 
dependency.

Once you have addressed all your direct dependencies you must also review your
transitive dependencies. 

Reviewing Transitive Dependencies

There are two ways to view transitive dependencies. You can use Visual Studios
Solution Explorer, or by reviewing your project.lock.json 
(project.json/VS2015) or project.assets.json (csproj/VS2017) file. Using 
Visual Studio Solution Explorer (VS2015)

If you want to use Visual Studio 2015 open your project in Visual Studio 2015
then press Ctrl+; to activate the search in Solution Explorer. Search for 
Microsoft.AspNetCore.Mvc.Core and make a note of the version numbers of any 
results you find.

For example, searching for Microsoft.AspNetCore.Mvc.Core in an example project
that contains a reference to Microsoft.AspNetCore.Mvc shows the following 
results in Visual Studio 2015;

Mt778901.9827B9BDFB5B91DF15829FAFEB42854E(en-us,Security.10).png

Figure 1: Searching references in Visual Studio 2015

The search results appear as a tree. In these results, you can see we have 
found references to Microsoft.AspNetCore.Mvc.Core, version 1.1.0, the 
vulnerable version.

The first entry under the References heading refers to the target framework 
your application is using. This will be .NETCoreApp, .NETStandard or 
.NET-Framework-vX.Y.Z (where X.Y.Z is an actual version number) depending on 
how you configured your application. Underneath your target framework will be
the list of packages you have directly taken a dependency on. In this example
the application takes a dependency on Microsoft.AspNetCore.Mvc. 
Microsoft.AspNetCore.Mvc in turn has leaf nodes that list its dependencies and
their versions. In this case the Microsoft.AspNetCore.Mvc package takes a 
dependency on a vulnerable version of Microsoft.AspNetCore.Mvc.Core and 
numerous other packages. Manually reviewing project.lock.json 
(project.json/VS2015)

Open the project.lock.json file in your editor. We suggest you use an editor 
that understands json and allows you to collapse and expand nodes to review 
this file; both Visual Studio and Visual Studio Code provide this 
functionality.

If you are using Visual Studio the project.lock.json file is underneath the 
project.json file. Click the right pointing triangle, , to the left of the 
project.json file to expand the solution tree to expose the project.lock.json
file. Figure 1 below shows a project with the project.json file expanded to 
show the project.lock.json file.

Mt778901.10871F6DAB46208F3A20B4D79DC43612(en-us,Security.10).png

Figure 2: project.lock.json file location

Search the project.lock.json file for the string 
Microsoft.AspNetCore.Mvc.Core/1.1.0. If your project.lock.json file includes 
this string, you have a dependency on the vulnerable package. Fixing 
transitive dependencies (project.json/VS2015)

If you have not found any reference to Microsoft.AspNetCore.Mvc.Core/1.1.0 
this means none of your direct dependencies depend on the vulnerable version 
of Microsoft.AspNetCore.Mvc.Core or you have already fixed the problem by 
updating the direct dependencies.

If your transitive dependency review found references to the vulnerable 
Microsoft.AspNetCore.Mvc.Core/1.1.0 you must add a direct dependency to the 
updated package to your project.json file to override the transitive 
dependency. Open your project.json and find the dependencies section. For 
example:

  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.1.0",
      "type": "platform"
    },
    "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
    "Microsoft.AspNetCore.Mvc": "1.1.0"
  }

The results of our transitive package search showed us that 
Microsoft.AspNet.Mvc depends on Microsoft.AspNet.Mvc.Core version 1.1.0. To 
fix this you must add a direct dependency by adding it to the project.json 
file. You do this by adding a new line to the dependencies section, referring
the fixed version. For example, to pull in the fixed version of 
Microsoft.AspNet.Mvc.Core, version 1.1.1 you edit the project.json file as 
follows;

  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.1.0",
      "type": "platform"
    },
    "Microsoft.AspNetCore.Mvc.Core": "1.1.1",
    "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
    "Microsoft.AspNetCore.Mvc.Core ": "1.1.0"
  }

Once you have added direct dependencies to the fixed packages save your 
project.json file.

If you are using Visual Studio save your updated project.json file and Visual
Studio will restore the new package versions. You can see the restore results
by opening the Output Window (Ctrl+Alt+O) and change the Show output from drop
down to Package Manager.

If you are not using Visual Studio open a command line and change to your 
project directory. Execute the dotnet restore command to restore your new 
dependencies. Using Visual Studio Solution Explorer (VS2017)

If you want to use Solution Explorer open your project in Visual Studio 2017,
then press Ctrl+; to activate the search in Solution Explorer. Search for 
Microsoft.AspNetCore.Mvc.Core and make a note of the version numbers of any 
results you find.

For example, searching for Microsoft.AspNetCore.Mvc.Core in an example project
that contains a package that takes a dependency on Microsoft.AspNetCore.Mvc 
shows the following results in Visual Studio 2017;

Mt778901.97811781D263F93FEA81D3888A3EC4D8(en-us,Security.10).png

Figure 3: Searching references in Visual Studio 2017

The search results appear as a tree. In these results, you can see we have 
found references to Microsoft.AspNetCore.Mvc.Core version 1.1.0.

Underneath the Dependencies node will be a NuGet node. Under the NuGet node 
will be the list of packages you have directly taken a dependency on and their
versions. In this example the application takes a direct dependency on 
Microsoft.AspNetCore.Mvc. Microsoft.AspNetCore.Mvc in turn has leaf nodes that
list its dependencies and their versions. In the example the 
Microsoft.AspNetCore.Mvc package takes a dependency on a version of 
Microsoft.AspNetCore.Mvc.ApiExplorer which in turn takes a dependency on a 
vulnerable version of Microsoft.AspNetCore.Mvc.Core. You can see that other 
packages also take a dependency on the vulnerable version of 
Microsoft.AspNetCore.Mvc.Core. Manually reviewing project.assets.json (VS2017)

Open the project.assets.json file from your projects obj directory in your 
editor. We suggest you use an editor that understands json and allows you to 
collapse and expand nodes to review this file; both Visual Studio and Visual 
Studio Code provide this functionality.

Search the project.assets.json file for the string 
Microsoft.AspNetCore.Mvc.Core/1.1.0. If your project.assets.json file includes
this string then you have a dependency on the vulnerable package. Fixing 
transitive dependencies (csproj/VS2017)

If you have not found any reference to Microsoft.AspNetCore.Mvc.Core/1.1.0 
this means none of your direct dependencies depend on the vulnerable version 
of Microsoft.AspNetCore.Mvc.Core or you have already fixed the problem by 
updating the direct dependencies.

If your transitive dependency review found references to the vulnerable 
Microsoft.AspNetCore.Mvc.Core/1.1.0 you must add a direct dependency to the 
updated package to your csproj file to override the transitive dependency. 
Open your projectname.csproj file in your editor, or right click on the 
project in Visual Studio 2017 and choose Edit projectname.csproj from the 
content menu, where projectname is the name of your project. Look for 
PackageReference nodes, for example;

<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp1.1</TargetFramework>
  </PropertyGroup>
  <PropertyGroup>
    <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore" Version="1.1.0" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.0" />
    <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.0" />
  </ItemGroup>
  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0-msbuild3-final" />
  </ItemGroup>
</Project>

In the example csproj file above there are 3 PackageReference nodes. The 
results of our transitive package search showed us that our application 
depends on the vulnerable Microsoft.AspNet.Mvc.Core version 1.1.0. To fix this
you must add a new direct dependency by adding it to the csproj file. You do 
this by adding a new PackageReference at the top of the PackageReference list,
referring the fixed version. For example, to pull in the fixed version of 
Microsoft.AspNet.Mvc.Core, version 1.1.1 in the example csproj file it would 
be changed as follows:

<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp1.1</TargetFramework>
  </PropertyGroup>
  <PropertyGroup>
    <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore" Version="1.1.0" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.0" />
    <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.0" />
  </ItemGroup>
  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0-msbuild3-final" />
  </ItemGroup>

Once you have added the direct dependency reference save your csproj file.

If you are using Visual Studio save your updated csproj file and Visual Studio
will restore the new package versions. You can see the restore results by 
opening the Output Window (Ctrl+Alt+O) and change the Show output from drop 
down to Package Manager.

If you are not using Visual Studio open a command line and change to your 
project directory. Execute the dotnet restore command to restore your new 
dependencies. 

Rebuilding your application

Finally rebuild your application, test as you would do normally and redeploy 
using your favored deployment mechanism. 

Other Information 

Support

You can ask questions about this issue on github, in the ASP.NET Core MVC
repo. This is located at https://github.com/aspnet/Mvc.

Reporting Security Issues

If you have found a potential security issue in .NET Core please email 
details to secure@microsoft.com. Reports may qualify for the .NET Core Bug 
Bounty. Details of the .NET Core Bug Bounty including Terms and Conditions are
at https://aka.ms/corebounty.

Microsoft Active Protections Program (MAPP)

To improve security protections for customers, Microsoft provides 
vulnerability information to major security software providers in advance of 
each monthly security update release. Security software providers can then use
this vulnerability information to provide updated protections to customers via
their security software or devices, such as antivirus, network-based intrusion
detection systems, or host-based intrusion prevention systems. To determine 
whether active protections are available from security software providers, 
please visit the active protections websites provided by program partners, 
listed in Microsoft Active Protections Program (MAPP) Partners. 

Feedback

You can provide feedback by completing the Microsoft Help and Support 
form, Customer Service Contact Us.

Support

You can ask questions about this advisory on GitHub in the Identity Model
Extensions repo. Customers in the United States and Canada can receive 
technical support from Security Support. For more information, see Microsoft 
Help and Support. International customers can receive support from their local
Microsoft subsidiaries. For more information, see International Support. 
Microsoft TechNet Security provides additional information about security in 
Microsoft products.

Disclaimer

The information provided in this advisory is provided "as is" without warranty
of any kind. Microsoft disclaims all warranties, either express or implied, 
including the warranties of merchantability and fitness for a particular 
purpose. In no event shall Microsoft Corporation or its suppliers be liable 
for any damages whatsoever including direct, indirect, incidental, 
consequential, loss of business profits or special damages, even if Microsoft
Corporation or its suppliers have been advised of the possibility of such 
damages. Some states do not allow the exclusion or limitation of liability for
consequential or incidental damages so the foregoing limitation may not apply.

Revisions

V1.0 (January 27, 2017): Advisory published.

- --------------------------END INCLUDED TEXT--------------------

You have received this e-mail bulletin as a result of your organisation's
registration with AusCERT. The mailing list you are subscribed to is
maintained within your organisation, so if you do not wish to continue
receiving these bulletins you should contact your local IT manager. If
you do not know who that is, please send an email to auscert@auscert.org.au
and we will forward your request to the appropriate person.

NOTE: Third Party Rights
This security bulletin is provided as a service to AusCERT's members.  As
AusCERT did not write the document quoted above, AusCERT has had no control
over its content. The decision to follow or act on information or advice
contained in this security bulletin is the responsibility of each user or
organisation, and should be considered in accordance with your organisation's
site policies and procedures. AusCERT takes no responsibility for consequences
which may arise from following or acting on information or advice contained in
this security bulletin.

NOTE: This is only the original release of the security bulletin.  It may
not be updated when updates to the original are made.  If downloading at
a later date, it is recommended that the bulletin is retrieved directly
from the author's website to ensure that the information is still current.

Contact information for the authors of the original document is included
in the Security Bulletin above.  If you have any questions or need further
information, please contact them directly.

Previous advisories and external security bulletins can be retrieved from:

        http://www.auscert.org.au/render.html?cid=1980

===========================================================================
Australian Computer Emergency Response Team
The University of Queensland
Brisbane
Qld 4072

Internet Email: auscert@auscert.org.au
Facsimile:      (07) 3365 7031
Telephone:      (07) 3365 4417 (International: +61 7 3365 4417)
                AusCERT personnel answer during Queensland business hours
                which are GMT+10:00 (AEST).
                On call after hours for member emergencies only.
===========================================================================
-----BEGIN PGP SIGNATURE-----
Comment: http://www.auscert.org.au/render.html?it=1967

iQIVAwUBWI6MpIx+lLeg9Ub1AQhgIxAAquB0CpZjGHOSnULLv0NA4FQNdMzUdIYU
UPhWbqUTopuKeZekjo2jokzuplAT25mXPyPDo5sDsm357nrGtSOzeXJQ4Wo/qal1
qbEoUj5T3CWPdfJLG0cXSPSP576y0uW8xn5ymPnuj8R4ASREHh8//u2IJrO8fIx6
J4YkA6IOrsZUqV9O/twXDFbtULfDpyN94xnx6b0+eBE8yhQ2EZLD5ga9/m/woMR8
8eYqQRaJnOD4T4Y993kqOHIFHM4pP7H2ksAQtlQHiwPL6EFYuwXWrZaOCHuMeU39
K5SfjEJVIF31Gxw4UVlak/Cz2wZxKPEM5tf1Si21kEN+i/6X72Fs5Yw4mygGQmRn
XLy4n80RlRkSEhozRQHGu+izcrNzpCBrWx7yLDyinCBiS9vlSUgmXmQPk5L3HKb6
+IqtRRf4/bh/cD6SUZPlV8mAKzfsJX2U42XYJm2HmR6KAsuvFIPWMASsJz9erGJQ
WV/eqkQCc3/mRmLQ3n7GPgvdbqpn9Uv4RhRlnYciTbumUa9If8L8SZVYymfxaqrD
VQ+0SLDGUWOXBRGqVOVermgWDLCfGtnW27CPNpv2PYzg8CHXM1GAlUKNeHkdkScS
q6le8FkzcxtVV55ScSpky2MGo6cEbkpaHP3q8KXfO/ClmyPbgPD/uUGCnC6xQcrN
N9BXI37mYqI=
=XCCP
-----END PGP SIGNATURE-----