CVE-2021-41238: Hangfire.Core Missing Authorization With Default Settings Vulnerability

HIGH
Advisory Identifier: GHSA-7rq6-7gv8-c37h
CVSS 8.6
CWE-862
Published
Advisory Summary

CVE-2021-41238 is a HIGH (CVSS 8.6) missing authorization with default settings vulnerability (CWE-862: Missing Authorization) affecting Hangfire.Core libraries in the NuGet ecosystem. The issue involves missing authorization with default settings in dashboard ui. Remediation is available by upgrading affected packages to version 1.7.26.

CVE-2021-41238 at a Glance

CVE Identifier CVE-2021-41238
GHSA Identifier GHSA-7rq6-7gv8-c37h
Severity HIGH
CVSS v3.1 Base Score 8.6
CWE Classification CWE-862: Missing Authorization
Affected Product Hangfire.Core
Package Ecosystem NuGet
Published Date
Last Updated

Security Impact

CVSS: 8.6

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

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

How to Fix CVE-2021-41238

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

Hangfire.Core fixed: 1.7.26
Upgrade Hangfire.Core to 1.7.26
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 Hangfire.Core

How to Check if You Are Affected

To determine whether your application is affected by CVE-2021-41238, inspect your project dependencies for Hangfire.Core:

inspect dependencies for Hangfire.Core

Analyze the terminal output to locate any version of Hangfire.Core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.7.26), 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 CWE-862: Missing Authorization, where the product does not perform an authorization check when an actor attempts to access a resource or perform an action. In Hangfire.Core, 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

Dashboard UI in Hangfire.Core uses authorization filters to protect it from showing sensitive data to unauthorized users. By default when no custom authorization filters specified, `LocalRequestsOnlyAuthorizationFilter` filter is being used to allow only local requests and prohibit all the remote requests to provide sensible, protected by default settings. However due to the recent changes, in version 1.7.25 no authorization filters are used by default, allowing remote requests to succeed. ### Impact Missing authorization when default options are used for the Dashboard UI, e.g. when no custom authorization rules are used as recommended in the [Using Dashboard](https://docs.hangfire.io/en/latest/configuration/using-dashboard.html#configuring-authorization) documentation article. #### Impacted If you are using `UseHangfireDashboard` method with default `DashboardOptions.Authorization` property value, then your installation is impacted: ```csharp app.UseHangfireDashboard(); // Impacted app.UseHangfireDashboard("/hangfire", new DashboardOptions()); // Impacted ``` #### Not Impacted If any other authorization filter is specified in the `DashboardOptions.Authorization` property, the you are not impacted: ```csharp app.UseHangfireDashboard("/hangfire", new DashboardOptions { Authorization = new []{ new SomeAuthorizationFilter(); } // Not impacted }); ``` ### Patches Patch is already available in version [1.7.26](https://github.com/HangfireIO/Hangfire/releases/tag/v1.7.26) and already available on NuGet.org, please see [Hangfire.Core 1.7.26](https://www.nuget.org/packages/Hangfire.Core/1.7.26). Default authorization rules now prohibit remote requests by default again by including the `LocalRequestsOnlyAuthorizationFilter` filter to the default settings. Please upgrade to the newest version in order to mitigate the issue. ### Workarounds It is possible to fix the issue by using the `LocalRequestsOnlyAuthorizationFilter` explicitly when configuring the Dashboard UI. In this case upgrade is not required. ```csharp // using Hangfire.Dashboard; app.UseHangfireDashboard("/hangfire", new DashboardOptions { Authorization = new []{ new LocalRequestsOnlyAuthorizationFilter(); } }); ``` ### References Original GitHub Issue: https://github.com/HangfireIO/Hangfire/issues/1958

CVE-2021-41238 Affected Hangfire.Core Versions

1 component(s)
Fixed Versions:
1.7.26
Product / Package Ecosystem Affected Versions Fixed Version
Hangfire.Core
NuGet
≥ 1.7.25
< 1.7.26
All 1 versions
1.7.25
1.7.26

References

Frequently Asked Questions

What is CVE-2021-41238?
CVE-2021-41238 is a security vulnerability in Hangfire.Core involving Missing Authorization with Default Settings in Dashboard UI under CWE-862: Missing Authorization.
Which Hangfire.Core versions are affected?
Affected versions include releases prior to 1.7.26 across affected packages: Hangfire.Core.
What version fixes CVE-2021-41238?
Upgrading to 1.7.26 (or the latest patched release for your respective branch) resolves the vulnerability.
Is Hangfire.Core affected?
Yes, Hangfire.Core is affected in releases prior to 1.7.26. Upgrade your dependency to 1.7.26 or later.
What is the CVSS score of CVE-2021-41238?
CVE-2021-41238 has a CVSS v3.1 base score of 8.6 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L.
What CWE is associated with CVE-2021-41238?
CVE-2021-41238 is classified under CWE-862: Missing Authorization (The product does not perform an authorization check when an actor attempts to access a resource or perform an action.).
How can I check NuGet dependencies for CVE-2021-41238?
Run the dependency tree command: 'inspect dependencies for Hangfire.Core'. 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-7rq6-7gv8-c37h",
  "modified" : "2021-11-03T14:35:35Z",
  "published" : "2021-11-03T17:30:59Z",
  "aliases" : [ "CVE-2021-41238" ],
  "summary" : "Missing Authorization with Default Settings in Dashboard UI",
  "details" : "Dashboard UI in Hangfire.Core uses authorization filters to protect it from showing sensitive data to unauthorized users. By default when no custom authorization filters specified, `LocalRequestsOnlyAuthorizationFilter` filter is being used to allow only local requests and prohibit all the remote requests to provide sensible, protected by default settings.\n\nHowever due to the recent changes, in version 1.7.25 no authorization filters are used by default, allowing remote requests to succeed.\n\n### Impact\n\nMissing authorization when default options are used for the Dashboard UI, e.g. when no custom authorization rules are used as recommended in the [Using Dashboard](https://docs.hangfire.io/en/latest/configuration/using-dashboard.html#configuring-authorization) documentation article. \n\n#### Impacted\n\nIf you are using `UseHangfireDashboard` method with default `DashboardOptions.Authorization` property value, then your installation is impacted:\n\n```csharp\napp.UseHangfireDashboard(); // Impacted\napp.UseHangfireDashboard(\"/hangfire\", new DashboardOptions()); // Impacted\n```\n\n#### Not Impacted\n\nIf any other authorization filter is specified in the `DashboardOptions.Authorization` property, the you are not impacted:\n\n```csharp\napp.UseHangfireDashboard(\"/hangfire\", new DashboardOptions\n{\n    Authorization = new []{ new SomeAuthorizationFilter(); } // Not impacted\n});\n```\n\n### Patches\n\nPatch is already available in version [1.7.26](https://github.com/HangfireIO/Hangfire/releases/tag/v1.7.26) and already available on NuGet.org, please see [Hangfire.Core 1.7.26](https://www.nuget.org/packages/Hangfire.Core/1.7.26). Default authorization rules now prohibit remote requests by default again by including the `LocalRequestsOnlyAuthorizationFilter` filter to the default settings. Please upgrade to the newest version in order to mitigate the issue.\n\n### Workarounds\n\nIt is possible to fix the issue by using the `LocalRequestsOnlyAuthorizationFilter` explicitly when configuring the Dashboard UI. In this case upgrade is not required.\n\n```csharp\n// using Hangfire.Dashboard;\n\napp.UseHangfireDashboard(\"/hangfire\", new DashboardOptions\n{\n    Authorization = new []{ new LocalRequestsOnlyAuthorizationFilter(); }\n});\n```\n\n### References\n\nOriginal GitHub Issue: https://github.com/HangfireIO/Hangfire/issues/1958",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "Hangfire.Core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.7.25"
      }, {
        "fixed" : "1.7.26"
      } ]
    } ],
    "versions" : [ "1.7.25" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/HangfireIO/Hangfire/security/advisories/GHSA-7rq6-7gv8-c37h"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-41238"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/HangfireIO/Hangfire/issues/1958"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/HangfireIO/Hangfire"
  }, {
    "type" : "WEB",
    "url" : "https://www.nuget.org/packages/Hangfire.Core"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-862" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-11-02T19:50:00Z",
    "nvd_published_at" : "2021-11-02T18:15:00Z"
  }
}