CVE-2026-63345: Refitter allows arbitrary code execution through unescaped OpenAPI paths
Published 2026-11-20 · Updated 2026-11-20 · Also known as GHSA-3fhm-p725-h3g3
Summary
Refitter allows arbitrary code execution because it emits unescaped OpenAPI paths verbatim into Refit attributes, enabling syntax breakout and injected module initializers. Engineering teams using NuGet package Refitter should update immediately.
Who is affected
Deployments that compile Refitter-generated C# code from attacker-controlled or attacker-influenced OpenAPI descriptions are vulnerable. An attacker can craft a specific single-line OpenAPI path that closes code blocks, injects a top-level file class with a [ModuleInitializer] method, and executes arbitrary code at application startup when the assembly loads.
Exploitability
The vulnerability carries a CVSS 4.0 base score of CRITICAL with network attack vector, low complexity, no privileges required, and no user interaction needed, resulting in high impacts to confidentiality, integrity, and availability. The EPSS score is 0.004 (percentile 0.293) and it is not listed in the CISA Known Exploited Vulnerabilities catalog.
Remediation
- Upgrade the NuGet package Refitter to version 2.1.2 or later.
- Ensure OpenAPI specifications used for client generation are trusted and strictly validated.
How to check your project
- Check project dependency files (such as .csproj or packages.lock.json) for NuGet package Refitter versions introduced at 0 and prior to 2.1.2.
- Inspect build pipelines and code generation scripts for automated Refitter invocation targeting untrusted OpenAPI specifications.
Automated analysis of the published advisory data, generated 2026-11-20. Not human-reviewed; verify against the official advisory. How this works.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | Upgrade |
|---|---|---|---|---|
| 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 vector | Network |
|---|---|
| Attack complexity | Low |
| Attack requirements | None |
| Privileges required | None |
| User interaction | None |
| 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 OpenAPI paths and header parameter names directly into C# attributes without escaping double quotes or restricting characters, allowing syntax breakout.
When does the injected attacker code execute?
The injected code executes immediately at application startup when .NET runs [ModuleInitializer] methods upon loading the generated assembly.
Is a special flag required to bypass validation for the exploit?
No, a crafted single-line path successfully survives Refitter's default OpenAPI validation.
Original advisory description
References
- WEB https://github.com/christianhelle/refitter/security/advisories/GHSA-3fhm-p725-h3g3
- ADVISORY https://nvd.nist.gov/vuln/detail/CVE-2026-63345
- WEB https://github.com/christianhelle/refitter/pull/1178
- WEB https://github.com/christianhelle/refitter/commit/793d2632899c2022511dfc15e30725ef69073973
- PACKAGE https://github.com/christianhelle/refitter
- WEB https://github.com/christianhelle/refitter/releases/tag/2.1.2
- WEB https://github.com/user-attachments/files/29395228/maintainer-report.txt
- WEB https://github.com/user-attachments/files/29395229/make_spec.py
- WEB https://github.com/user-attachments/files/29395230/reproduce.sh
Source records: GHSA-3fhm-p725-h3g3 (OSV.dev) · EPSS by FIRST, 2026-11-22.