# CVE-2021-41238: Missing Authorization with Default Settings in Dashboard UI


- **Severity:** High 8.6 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 2 Nov 2021
- **Updated:** 4 Aug 2024
- **Also known as:** GHSA-7rq6-7gv8-c37h

## What is CVE-2021-41238?

CVE-2021-41238 is a high-severity vulnerability in HangfireIO Hangfire, published on 2 Nov 2021. 

### Official description

Hangfire is an open source system to perform background job processing in a .NET or .NET Core applications. No Windows Service or separate process required. 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. If you are using `UseHangfireDashboard` method with default `DashboardOptions.Authorization` property value, then your installation is impacted. If any other authorization filter is specified in the `DashboardOptions.Authorization` property, the you are not impacted. Patched versions (1.7.26) are available both on Nuget.org and as a tagged release on the github repo. 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. For users who are unable to upgrade it is possible to mitigate the issue by using the `LocalRequestsOnlyAuthorizationFilter` explicitly when configuring the Dashboard UI.

Weakness: CWE-862 (Missing Authorization)

## Which versions are affected by CVE-2021-41238?

2 open source packages ship an affected version, including Hangfire.Core. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `Hangfire.Core` | NuGet | From 1.7.25 | 1.7.26 |
| `Hangfire.Core` | NuGet | From 1.7.25 | 1.7.26 |

Products: Hangfire Hangfire.

## How do I fix CVE-2021-41238?

Upgrade Hangfire.Core to 1.7.26 or later.

## Is CVE-2021-41238 being exploited?

There is no known exploitation of CVE-2021-41238 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-41238 and fix it if it is affected.

What it is: CVE-2021-41238 is a high-severity vulnerability in HangfireIO Hangfire, published on 2 Nov 2021. 
Exploitation: There is no known exploitation of CVE-2021-41238 in the wild and no public exploit code.

Affected packages and fixed versions:
- Hangfire.Core (NuGet): affected from 1.7.25; fixed in 1.7.26
- Hangfire.Core (NuGet): affected from 1.7.25; fixed in 1.7.26

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2021-41238/ (Markdown: https://insights.sbomify.com/CVE-2021-41238/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2021-41238
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2021-41238
- OSV: https://osv.dev/vulnerability/CVE-2021-41238

---
From sbomify Insights: https://insights.sbomify.com/CVE-2021-41238/
Summaries are generated and may contain mistakes; the official description above is the record.
