IT SBIT Services
Schneeberger
DEEN
CVE tracker

Refitter: Code injection via OpenAPI content-type keys in generated Refit clients

CVE-2026-63344High 8.6

← All vulnerabilities

Summary

Refitter, a tool that generates C# REST API clients for the Refit library from OpenAPI descriptions, does not escape content-type keys from the specification. A crafted content-type key in an attacker-influenced OpenAPI description breaks out of the generated attribute string and can add a top-level C# class with a ModuleInitializer method. This code runs when the generated assembly is loaded at application startup, even if the client is never called. The attack requires that a developer or pipeline generates code from the malicious specification and that a user interacts with the process.

Affected

  • Refitter versions before 2.1.2
  • Refitter.MSBuild: update to the matching version as well

Fixed in

  • Refitter 2.1.2 (released 29 July 2026, per the project changelog)
  • Later releases were not verified; use the latest stable release after checking it

Workaround

Unknown.

Exploitation

  • No known exploitation in the wild; no CISA KEV entry found at the time of research.
  • A public proof of concept has not been confirmed.
  • EPSS: 0.35 % (percentile 29).

Our recommendation

  • Upgrade Refitter and Refitter.MSBuild to 2.1.2 or later.
  • Generate clients only from specifications you control or have reviewed; treat third-party and partner specifications as untrusted.
  • Review generated .cs files for unexpected top-level classes or ModuleInitializer attributes before compiling.
  • Run code generation in CI without access to secrets.

Public exploits

PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.

Research sources

Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 1 Nov 2026, 06:42.

Original description (NVD)

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.

NVD references (7)

Sources

The tracker combines official, freely usable data sources – updated continuously:

This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.

Affected? We can help.

We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.