Vulnerabilities in pkg:nuget/Microsoft.AspNetCore.Authentication.JwtBearer

PACKAGE
Advisory Identifier: GHSA-q7cg-43mg-qp69
Advisory Summary

CVE-2021-34532 is a MODERATE (CVSS 5.5) asp.net core information disclosure vulnerability vulnerability (General Security Weakness) affecting Microsoft.AspNetCore.Authentication.JwtBearer libraries in the NuGet ecosystem. The issue involves asp.net core information disclosure vulnerability. Remediation is available by upgrading affected packages to version 2.1.29, 3.1.18, 5.0.9.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:nuget/Microsoft.AspNetCore.Authentication.JwtBearer

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:nuget/Microsoft.AspNetCore.Authentication.JwtBearer. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-q7cg-43mg-qp69 CVE-2021-34532 MODERATE ASP.NET Core Information Disclosure Vulnerability

CVE-2021-34532 at a Glance

CVE Identifier CVE-2021-34532
GHSA Identifier GHSA-q7cg-43mg-qp69
Severity MODERATE
CVSS v3.1 Base Score 5.5
CWE Classification General Security Weakness
Affected Product Microsoft.AspNetCore.Authentication.JwtBearer
Package Ecosystem NuGet
Published Date
Last Updated

Security Impact

CVSS: 5.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2021-34532

To remediate this vulnerability, upgrade all affected Microsoft.AspNetCore.Authentication.JwtBearer dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

Microsoft.AspNetCore.Authentication.JwtBearer fixed: 2.1.29
Upgrade Microsoft.AspNetCore.Authentication.JwtBearer to 2.1.29
Microsoft.AspNetCore.Authentication.JwtBearer fixed: 3.1.18
Upgrade Microsoft.AspNetCore.Authentication.JwtBearer to 3.1.18
Microsoft.AspNetCore.Authentication.JwtBearer fixed: 5.0.9
Upgrade Microsoft.AspNetCore.Authentication.JwtBearer to 5.0.9
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for Microsoft.AspNetCore.Authentication.JwtBearer

How to Check if You Are Affected

To determine whether your application is affected by CVE-2021-34532, inspect your project dependencies for Microsoft.AspNetCore.Authentication.JwtBearer:

inspect dependencies for Microsoft.AspNetCore.Authentication.JwtBearer

Analyze the terminal output to locate any version of Microsoft.AspNetCore.Authentication.JwtBearer in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.29), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Microsoft.AspNetCore.Authentication.JwtBearer, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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 * If you're using .NET 5.0, you should download and install Runtime 5.0.9 or SDK 5.0.206 (for Visual Studio 2019 v16.8) or SDK 5.0.303 (for Visual Studio 2019 V16.10) from https://dotnet.microsoft.com/download/dotnet-core/5.0. * If you're using .NET Core 3.1, you should download and install Runtime 3.1.18 or SDK 3.1.118 (for Visual Studio 2019 v16.4) or 3.1.412 (for Visual Studio 2019 v16.7 or later) from https://dotnet.microsoft.com/download/dotnet-core/3.1. * If you're using .NET Core 2.1, you should download and install Runtime 2.1.29 or SDK 2.1.525 (for Visual Studio 2019 v15.9) or 2.1.817 from https://dotnet.microsoft.com/download/dotnet-core/2.1. * If your application is using .NET Core 2.1 running on .NET Framework see the [Updating .NET Core 2.1 on .NET Framework](#updating-2.1) section below. ### <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: * In the Visual Studio Solution Explorer window, which supports searching. * By examining the `project.assets.json` file contained in the obj directory of your project for `csproj` based projects The `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: * Examine the line on which they are found, the version number is after the `/`. * Compare to the [vulnerable versions table](#affected-software). 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 * None of your direct dependencies depend on any vulnerable packages, or * You have already fixed the problem by updating the direct dependencies. #### Other Details - Announcement for this issue can be found at https://github.com/dotnet/announcements/issues/195 - An Issue for this can be found at https://github.com/dotnet/aspnetcore/issues/35246 - MSRC details for this can be found at https://msrc.microsoft.com/update-guide/en-US/vulnerability/CVE-2021-34532

CVE-2021-34532 Affected Microsoft.AspNetCore.Authentication.JwtBearer Versions

3 component(s)
Fixed Versions:
2.1.293.1.185.0.9
Product / Package Ecosystem Affected Versions Fixed Version
Microsoft.AspNetCore.Authentication.JwtBearer
NuGet
≥ 2.1.0
< 2.1.29
2.1.29
Microsoft.AspNetCore.Authentication.JwtBearer
NuGet
≥ 3.0.0
< 3.1.18
3.1.18
Microsoft.AspNetCore.Authentication.JwtBearer
NuGet
≥ 5.0.0
< 5.0.9
5.0.9

References

Frequently Asked Questions

What is CVE-2021-34532?
CVE-2021-34532 is a security vulnerability in Microsoft.AspNetCore.Authentication.JwtBearer involving ASP.NET Core Information Disclosure Vulnerability under General Security Weakness.
Which Microsoft.AspNetCore.Authentication.JwtBearer versions are affected?
Affected versions include releases prior to 2.1.29, 3.1.18, 5.0.9 across affected packages: Microsoft.AspNetCore.Authentication.JwtBearer.
What version fixes CVE-2021-34532?
Upgrading to 2.1.29, 3.1.18, 5.0.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is Microsoft.AspNetCore.Authentication.JwtBearer affected?
Yes, Microsoft.AspNetCore.Authentication.JwtBearer is affected in releases prior to 2.1.29, 3.1.18, 5.0.9. Upgrade your dependency to 2.1.29, 3.1.18, 5.0.9 or later.
What is the CVSS score of CVE-2021-34532?
CVE-2021-34532 has a CVSS v3.1 base score of 5.5 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2021-34532?
CVE-2021-34532 is classified under General Security Weakness.
How can I check NuGet dependencies for CVE-2021-34532?
Run the dependency tree command: 'inspect dependencies for Microsoft.AspNetCore.Authentication.JwtBearer'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-q7cg-43mg-qp69",
  "modified" : "2026-08-11T17:22:51Z",
  "published" : "2021-08-25T14:45:28Z",
  "aliases" : [ "CVE-2021-34532" ],
  "summary" : "ASP.NET Core Information Disclosure Vulnerability",
  "details" : "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.\n\nAn 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.\n\n### Patches\n\n* If you're using .NET 5.0, you should download and install Runtime 5.0.9 or SDK 5.0.206 (for Visual Studio 2019 v16.8) or SDK 5.0.303 (for Visual Studio 2019 V16.10) from https://dotnet.microsoft.com/download/dotnet-core/5.0.\n\n* If you're using .NET Core 3.1, you should download and install Runtime 3.1.18 or SDK 3.1.118 (for Visual Studio 2019 v16.4) or 3.1.412 (for Visual Studio 2019 v16.7 or later) from https://dotnet.microsoft.com/download/dotnet-core/3.1.\n\n* If you're using .NET Core 2.1, you should download and install Runtime 2.1.29 or SDK 2.1.525 (for Visual Studio 2019 v15.9) or 2.1.817 from https://dotnet.microsoft.com/download/dotnet-core/2.1.\n\n* If your application is using .NET Core 2.1 running on .NET Framework see the [Updating .NET Core 2.1 on .NET Framework](#updating-2.1) section below.\n\n### <a name=\"updating-2.1\"></a> Updating .NET Core 2.1 on .NET Framework\nIf you are running .NET Core 2.1 on .NET Framework you need to check your projects for dependencies and update them accordingly.\n\n#### Direct dependencies\n\nDirect 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.\n\n#### Transitive dependencies\n\nTransitive 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.\n\nTransitive dependencies are reviewable in two ways:\n\n* In the Visual Studio Solution Explorer window, which supports searching.\n* By examining the `project.assets.json` file contained in the obj directory of your project for `csproj` based projects\n\nThe `project.assets.json` files are the authoritative list of all packages used by your project, containing both direct and transitive dependencies.\n\nThere 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)).\n\n##### <a name=\"vs-solution-explorer\"></a>Using Visual Studio Solution Explorer\n\nTo 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.\n\nFor example, search for `Microsoft.AspNetCore.Authentication.JwtBearer` and update the package to the latest version\n\n\n##### <a name=\"project-assets-json\"></a> Manually reviewing project.assets.json\n\nOpen 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.\nVisual Studio and Visual Studio Code provide JSON friendly editing.\n\nSearch 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:\n\n* Examine the line on which they are found, the version number is after the `/`.\n* Compare to the [vulnerable versions table](#affected-software).\n\nFor 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`.\n\nIf your *project.assets.json* file includes references to the [vulnerable package](#affected-software), then you need to fix the transitive dependencies.\n\nIf you have not found any reference to any vulnerable packages, this means either\n\n* None of your direct dependencies depend on any vulnerable packages, or\n* You have already fixed the problem by updating the direct dependencies.\n\n#### Other Details\n\n- Announcement for this issue can be found at https://github.com/dotnet/announcements/issues/195\n- An Issue for this can be found at https://github.com/dotnet/aspnetcore/issues/35246\n- MSRC details for this can be found at https://msrc.microsoft.com/update-guide/en-US/vulnerability/CVE-2021-34532",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "Microsoft.AspNetCore.Authentication.JwtBearer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.1.0"
      }, {
        "fixed" : "2.1.29"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "Microsoft.AspNetCore.Authentication.JwtBearer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.1.18"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "Microsoft.AspNetCore.Authentication.JwtBearer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.0.9"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/dotnet/aspnetcore/security/advisories/GHSA-q7cg-43mg-qp69"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-34532"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/dotnet/aspnetcore"
  }, {
    "type" : "WEB",
    "url" : "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34532"
  }, {
    "type" : "WEB",
    "url" : "https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2021-34532"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-08-24T18:52:16Z",
    "nvd_published_at" : "2021-08-12T18:15:00Z"
  }
}