Refitter
Refitter: C# source injection through OpenAPI content-type map keys
Refitter is a tool for generating a C# REST API client using the Refit library. Prior to 2.1.2, content-type keys in the content maps of `requestBody/responses` are emitted verbatim into a Refit `[Headers("Accept: <ct>", "Content-Type: <ct>")]` attribute string without escaping quotation marks. A crafted content-type key in an attacker-influenced OpenAPI description survives default validation without `--skip-validation`, breaks out of the attribute string and enclosing interface and namespace, and can introduce a top-level file class while leaving valid generated C#. A `[ModuleInitializer]` method in that class executes attacker code when the generated assembly is loaded at application startup, without requiring a call to the client. The behavior was verified with Refitter 2.0.0 and .NET 8. This issue is fixed in version 2.1.2.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- < 2.1.2
Fixed in 2.1.2
Mitigation
Upgrade refitter to 2.1.2 or later.
References
- Vendor advisory github.com/christianhelle/refitter/security/ad…
- Patch github.com/christianhelle/refitter/pull/1178
- Patch github.com/christianhelle/refitter/commit/ab4d…
1 more
- Release notes github.com/christianhelle/refitter/releases/ta…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.
Other public exploits
Exploit-DB, Metasploit and nuclei count as public PoCs. Exploit-tagged references from the CVE record and NVD are links only. None of these are analysed by us.| Source | Title | Published | Found by us |
|---|---|---|---|
| PoC Index | https://github.com/user-attachments/files/29394848/reproduce.sh | unknown | 14 Nov 2026 |