CRITICAL · CVSS 4.0 EPSS 0.6% · 48th percentile CWE-116CWE-94

CVE-2026-63344: Refitter allows arbitrary code execution through unescaped OpenAPI content-type values

Published 2026-11-20 · Updated 2026-11-20 · Also known as GHSA-p32v-8v8j-j534

Summary

Refitter allows arbitrary code execution because it emits unescaped OpenAPI content-type values directly into C# attribute strings. Engineering and security teams using Refitter must update their packages immediately.

Who is affected

Applications that compile a Refitter client generated from an attacker-controlled or attacker-influenced OpenAPI description are vulnerable. A crafted content-type key breaks out of the attribute and enclosing interface namespaces to inject a top-level file class with a ModuleInitializer method, executing arbitrary code upon assembly load.

Exploitability

The vulnerability is remotely exploitable over the network with low attack complexity and no privileges or user interaction required. It has a critical CVSS score of 9.3 (vector CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N), an EPSS score of 0.004, and is not listed in the CISA Known Exploited Vulnerabilities catalog.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-20. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
NuGet Refitter >= 0, < 2.1.2 2.1.2 dotnet add package Refitter --version 2.1.2

CVSS 4.0 vector

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Attack vectorNetwork
Attack complexityLow
Attack requirementsNone
Privileges requiredNone
User interactionNone
Confidentiality (vulnerable system)High
Integrity (vulnerable system)High
Availability (vulnerable system)High
Confidentiality (subsequent systems)None
Integrity (subsequent systems)None
Availability (subsequent systems)None

Base score is not computed for CVSS 4.0 vectors; severity is taken from the advisory.

FAQ

What causes the vulnerability in Refitter?

Refitter emits the spec's content-type key verbatim into a Refit attribute string without escaping quotation marks or validating characters.

When does the injected malicious code execute?

The injected code executes automatically at application startup because .NET runs [ModuleInitializer] methods during assembly load.

Is the --skip-validation flag required for this attack to succeed?

No, a crafted value can survive Refitter's default OpenAPI validation without requiring the --skip-validation flag.

Original advisory description
### Summary Refitter emits the spec's content-type key (content map key in requestBody/responses) verbatim into a Refit `[Headers("Accept: <ct>", "Content-Type: <ct>")]` attribute string without escaping `"`. A crafted value survives Refitter's default OpenAPI validation, breaks out of the attribute and the enclosing interface + namespace, injects a top-level `file class` with a `[ModuleInitializer]` method, and reopens so the file stays valid. .NET runs `[ModuleInitializer]` methods at assembly load, so the attacker's code executes at application startup. Verified on Refitter 2.0.0 / .NET 8. The malicious input is a content-type KEY such as: content: { 'application/<breakout>': {schema} }. No `--skip-validation` is required. ### PoC `reproduce.sh` (+ `make_spec.py`) attached: generates with default validation, compiles into a console app, runs it (Main does not touch the client), and shows a marker written at assembly load. ### Impact Code execution at assembly load (process startup) in any application that compiles a Refitter client generated from an attacker-controlled or attacker-influenced OpenAPI description. Estimated Critical, e.g. `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N` (the CNA sets the final score). ### Suggested fix Escape every spec-derived string before emitting it into a Refit attribute (escape `"`, `\`, reject newlines) and validate characters. We recommend auditing all attribute emissions that embed spec-derived values, using one shared encoder. [reproduce.sh](https://github.com/user-attachments/files/29394848/reproduce.sh) [maintainer-report.txt](https://github.com/user-attachments/files/29394851/maintainer-report.txt) [make_spec.py](https://github.com/user-attachments/files/29394853/make_spec.py)

References

Source records: GHSA-p32v-8v8j-j534 (OSV.dev) · EPSS by FIRST, 2026-11-22.