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

Refitter: C# source injection through OpenAPI content-type map keys

Refitter 2.0.0 and earlier can generate C# clients that run code at process startup when built from an attacker-controlled or attacker-influenced OpenAPI description. 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. A crafted content-type key in an OpenAPI description can inject arbitrary C# code into the generated client, which runs automatically when the generated assembly loads at application startup.

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, 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.

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-63344

What does this mean?

A crafted OpenAPI content-type map key can inject C# source into the generated Refitter client. The injected code runs through a [ModuleInitializer] method when the compiled assembly loads, which is at process startup.Source: github.com

Am I affected, and how do I check?

Refitter versions 2.0.0 and earlier are affected, but only when the client is generated from an attacker-controlled or attacker-influenced OpenAPI description and that client is compiled into an application. To check, look at the Refitter version used to generate the client and where its OpenAPI description came from.Source: github.com

What should I do about it?

Upgrade Refitter to 2.1.2 or later and regenerate the client. Regenerating is needed because the vulnerable code is produced at generation time.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