CVE-2021-41238 — Hangfire.Core
HIGHCVE-2021-41238 is a high-severity (CVSS 7.5) CWE-862 vulnerability in Hangfire.Core. A fix is available for Hangfire.Core — see the affected versions and patch details below.
Missing Authorization with Default Settings in Dashboard UI
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2021-41238 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 385,987 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
Hangfire.CoreReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects NuGet packages — download data is not available via public APIs for these ecosystems.
Description
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 documentation article.
Impacted
If you are using UseHangfireDashboard method with default DashboardOptions.Authorization property value, then your installation is impacted:
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:
app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
Authorization = new []{ new SomeAuthorizationFilter(); } // Not impacted
});
Patches
Patch is already available in version 1.7.26 and already available on NuGet.org, please see 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.
// using Hangfire.Dashboard;
app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
Authorization = new []{ new LocalRequestsOnlyAuthorizationFilter(); }
});
References
Original GitHub Issue: https://github.com/HangfireIO/Hangfire/issues/1958
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| .NETNuGet | Hangfire.Core | ≥ 1.7.25&&< 1.7.26 | 1.7.26dotnet add package Hangfire.Core --version 1.7.26 |
Affected Products
hangfirehangfireDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for Hangfire.Core, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update Hangfire.Core to 1.7.26 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-41238 is resolved across your whole dependency graph.
Workarounds
Put an independent control in front of the weakness: restrict the affected endpoint or interface to trusted networks, require an additional authentication factor or proxy-level check, and invalidate existing sessions and credentials in case the flaw has already been used.
Frequently Asked Questions
Is CVE-2021-41238 in your dependencies?
Find it across NuGet, including transitive dependencies.