Skip to main content
← All vulnerabilities
CVE-2026-63346

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.

Published
Last modified
published
Not listed in CISA KEV
Specific setups only
Fix
Fixed in 2.1.2
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

  1. CVE published
  2. First seen by cve.now

Affected versions

  • christianhelle refitter

    fixed in 2.1.2

References 7

GitHub · christianhelle/refitter

GitHub · user-attachments/files

FAQ

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