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

Refitter: C# source injection through OpenAPI path keys

Refitter versions before 2.1.2 are affected when the OpenAPI description is attacker-controlled or attacker-influenced and its generated client is compiled into an application. 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 .NET tool that generates C# REST API clients from OpenAPI specifications, is affected by this vulnerability. Attacker-controlled path keys in a crafted OpenAPI document can inject arbitrary C# code into generated client files, which may then run when the generated code is compiled and loaded by an application.

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, OpenAPI `paths`-object keys are emitted verbatim into Refit route attributes such as `[Get("<path>")]` without escaping quotation marks or restricting characters. An attacker-influenced single-line, slash-prefixed path survives default validation without `--skip-validation` and can close the attribute string, interface, and namespace while introducing a top-level file class and reopening the generated structure to keep valid C#. A `[ModuleInitializer]` method executes attacker code when an application compiles and loads the generated assembly at startup, even without calling the generated client. The enum and default value sinks are escaped and are not the vulnerable path-emission sink. The behavior was verified on Refitter 2.0.0 with .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-63345

What does this mean?

Refitter does not safely handle OpenAPI path keys when it generates C# source, so crafted path keys can inject C# code into the generated client. That code runs when the assembly loads at process startup in any application that compiles the client.Source: github.com

Am I affected, and how do I check?

Refitter versions before 2.1.2 are listed as affected. The exposure requires an OpenAPI description that is attacker-controlled or attacker-influenced and a generated client that is compiled into an application. Check the Refitter version used in the project's package references or tool installation.Source: github.com

What should I do about it?

Upgrade Refitter to 2.1.2 or later, the fixed version listed for this issue, and regenerate the client code.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