Refitter: C# source injection through OpenAPI header parameter names
Only Refitter 2.0.0 and earlier is affected, when an OpenAPI description has a header parameter with a crafted name and the generated client is compiled. Fixed in 2.1.2.
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- How many real-world setups can hit the bug, from the vendor's advisory and CISA data. It does not know your setup.What do these mean? →
- Specific setups only
- Fix
- Fixed in 2.1.2
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
Summary
Refitter, a tool that generates C# REST API clients for the Refit library, failed to escape header parameter names from OpenAPI specifications, so a malicious API description could inject arbitrary C# code into the generated client. That code can run automatically when the compiled application starts, even if the client is never used.
Summarized by anthropic/claude-haiku-5.5. Verify details against the original sources.
Read the original description
Refitter is a tool for generating a C# REST API client using the Refit library. Prior to 2.1.2, the header parameter name in `parameters[].name` with `in: header` is emitted verbatim into a Refit `[Header("<name>")]` attribute string without escaping quotation marks. An attacker-influenced OpenAPI description can pass default validation without `--skip-validation` and break out from the parameter-list position by closing the parameter and method syntax, attribute, interface, and namespace. The generated file can remain valid C# while containing a top-level file class with a `[ModuleInitializer]` method, which executes attacker code when the compiled assembly is loaded at application startup, even if the client is never called. Query `AliasAs` and enum/default value sinks are escaped; this flaw is in header-name attribute-string emission. The behavior was verified with Refitter 2.0.0 and .NET 8. This issue is fixed in version 2.1.2.
Timeline
- CVE published
- First seen by cve.now
Affected versions
- christianhelle refitter
fixed in 2.1.2
References 7
GitHub · christianhelle/refitter
GitHub · user-attachments/files
Questions about CVE-2026-63346
What does this mean?
A crafted header parameter name in an OpenAPI description is turned into C# source code by Refitter. The injected code runs when the compiled assembly loads at process startup, even if the generated client is never called.Source: github.com
Am I affected, and how do I check?
Refitter 2.0.0 and earlier is affected. The issue needs an OpenAPI description containing a header parameter with a crafted name, and a generated Refitter client compiled into an application. A reader can check the Refitter version in use and whether the OpenAPI description has such a header parameter.Source: github.com
What should I do about it?
Upgrade Refitter to 2.1.2 or later, which is the listed fixed version.Source: github.com
Is it being exploited?
It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.Source: cve.now feed data