
Loading

Loading
We use strictly necessary cookies to run this site, and analytics cookies to understand how it's used. See our Privacy Policy for details.
A GitHub-reviewed security advisory, not necessarily under active exploitation the way our CISA KEV advisories are, but a real, disclosed vulnerability in an open-source dependency.
Affected packages
Vulnerable: < 2.1.2
Patched in 2.1.2
Details
Refitter emits each OpenAPI path (the paths-object key) verbatim into a Refit [Get("<path>")]
attribute string, without escaping " or restricting characters. A crafted single-line, /-prefixed
path survives Refitter's default OpenAPI validation yet closes the attribute string and the enclosing
interface + namespace, injects a top-level file class with a [ModuleInitializer] method, and
reopens a namespace + interface so the file stays valid. .NET runs [ModuleInitializer] methods when
the generated assembly is loaded, so the attacker's code executes at application startup. Verified on
Refitter 2.0.0 / .NET 8.
[Get("/p")] Task<string> Dummy(); } }
file class Evil { [System.Runtime.CompilerServices.ModuleInitializer]
internal static void Init(){ /* attacker code */ } }
namespace N2 { public partial interface I2 { [Get("/q")]
Task<string> GetU(string id);
}
}
No --skip-validation is needed (the payload is a valid single-line path). The generated .cs is
compiled into the victim application; the module initializer runs at assembly load. This is distinct
from the value sinks (enum/default), which are escaped; the path sink has no escaping. The
[Header("<name>")] attribute is likewise emitted raw (header parameter names), at minimum a
build-breaking DoS.
reproduce.sh (+ make_spec.py) attached: generates with default validation, compiles into a console
app, runs it (Main does not touch the client), and shows a marker written at assembly load. Verified
on 2.0.0.
Code execution at assembly load (process startup) in any application that compiles a Refitter client generated from an attacker-controlled or attacker-influenced OpenAPI description.
Escape the route template before emitting it into [Get("…")] (escape ", \, reject newlines) and
validate that paths contain only legal URI-template characters. Apply the same encoding to
[Header(…)], [Post/Put/Delete(…)], and every attribute that embeds a spec-derived string.
maintainer-report.txt
make_spec.py
reproduce.sh
EPSS, exploit probability
Low0.35%
estimated chance of real-world exploitation in the next 30 days, higher than 29.3% of every CVE FIRST.org scores
Refreshed 11/20/2026, via FIRST.org's EPSS model, not CVSS, this measures likelihood of exploitation, not how severe it would be.
More nuget advisories
Talk to us about this
Find out whether this dependency (or others like it) is actually reachable in your codebase.
Get help patching, or building dependency-scanning into your pipeline going forward.
A secure code review or supply chain review finds this before an advisory does.