Microsoft.AspNetCore.Authentication.JwtBearer
Affected
- introduced
2.1.0, fixed2.1.29(ecosystem)
Fixed versions
2.1.29
Fix
The export has no generic command for this ecosystem.
Advisory
Also known as: BIT-aspnet-core-2021-34532, CVE-2021-34532
ASP.NET Core Information Disclosure Vulnerability
Microsoft is releasing this security advisory to provide information about a vulnerability in .NET 5.0, .NET Core 3.1 and .NET Core 2.1. This advisory also provides guidance on what developers can do to update their applications to remove this vulnerability.
An information disclosure vulnerability exists in .NET 5.0, .NET Core 3.1 and .NET Core 2.1 where a JWT token is logged if it cannot be parsed.
Patches
<a name="updating-2.1"></a> Updating .NET Core 2.1 on .NET Framework
If you are running .NET Core 2.1 on .NET Framework you need to check your projects for dependencies and update them accordingly.
Direct dependencies
Direct dependencies are discoverable by examining your csproj file. They can be fixed by [editing the project file](#fixing-direct-dependencies) or using NuGet to update the dependency.
Transitive dependencies
Transitive dependencies occur when you add a package to your project that in turn relies on another package. For example, if Contoso publishes a package Contoso.Utility which, in turn, depends on Contoso.Internals and you add the Contoso.Utility package to your project now your project has a direct dependency on Contoso.Utility and, because Contoso.Utility depends 'Contoso.Internals', your application gains a transitive dependency on the Contoso.Internals package.
Transitive dependencies are reviewable in two ways:
project.assets.json file contained in the obj directory of your project for csproj based projectsThe project.assets.json files are the authoritative list of all packages used by your project, containing both direct and transitive dependencies.
There are two ways to view transitive dependencies. You can either [use Visual Studio’s Solution Explorer](#vs-solution-explorer), or you can review [the project.assets.json file](#project-assets-json)).
<a name="vs-solution-explorer"></a>Using Visual Studio Solution Explorer
To use Solution Explorer, open the project in Visual Studio, and then press Ctrl+; to activate the search in Solution Explorer. Search for the [vulnerable package](#affected-software) and make a note of the version numbers of any results you find.
For example, search for Microsoft.AspNetCore.Authentication.JwtBearer and update the package to the latest version
<a name="project-assets-json"></a> Manually reviewing project.assets.json
Open the *project.assets.json* file from your project’s 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.
Visual Studio and Visual Studio Code provide JSON friendly editing.
Search the *project.assets.json* file for the [vulnerable package](#affected-software), using the format packagename/ for each of the package names from the preceding table. If you find the assembly name in your search:
/.For example, a search result that shows Microsoft.AspNetCore.Authentication.JwtBearer/2.1.0 is a reference to version 2.1.1 of Microsoft.AspNetCore.Authentication.JwtBearer.
If your *project.assets.json* file includes references to the [vulnerable package](#affected-software), then you need to fix the transitive dependencies.
If you have not found any reference to any vulnerable packages, this means either
Other Details
Medium Basis: The source's own band: MODERATE
2.1.0, fixed 2.1.29 (ecosystem)2.1.29
The export has no generic command for this ecosystem.
3.0.0, fixed 3.1.18 (ecosystem)3.1.18
The export has no generic command for this ecosystem.
5.0.0, fixed 5.0.9 (ecosystem)5.0.9
The export has no generic command for this ecosystem.
Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0