CVE-2026-63345
Refitter allows arbitrary code execution through unescaped OpenAPI paths
Also known as GHSA-3fhm-p725-h3g3
Mitigation
- Upgrade Refitter to 2.1.2 or later.
Who should check
- Projects that depend on NuGet package Refitter (< 2.1.2)
Vulnerability facts
- Affected
- Refitter < 2.1.2
- Fixed in
- 2.1.2
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 9.3 (v4.0, GitHub)CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:NOpen in CVSS calculator
Show all 11 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Attack requirements: None
- Privileges required: None
- User interaction: None
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: High
- Confidentiality impact on other systems: None
- Integrity impact on other systems: None
- Availability impact on other systems: None
- EPSS
- 0.62% chance of exploitation in 30 days (percentile 44, 2026-11-26)
- CWE
- CWE-94, CWE-1116
- Modified
Description
### Summary Refitter emits each OpenAPI path (the paths-object key) verbatim into a Refit `[Get("<path>")]` attribute string, without escaping `"` or restricting characters. A crafted single-line, /-prefixed path survives Refitter's default OpenAPI validation yet closes the attribute string and the enclosing interface + namespace, injects a top-level `file class` with a `[ModuleInitializer]` method, and reopens a namespace + interface so the file stays valid. .NET runs `[ModuleInitializer]` methods when the generated assembly is loaded, so the attacker's code executes at application startup. Verified on Refitter 2.0.0 / .NET 8. ### Details ``` [Get("/p")] Task<string> Dummy(); } } file class Evil { [System.Runtime.CompilerServices.ModuleInitializer] internal static void Init(){ /* attacker code */ } } namespace N2 { public partial interface I2 { [Get("/q")] Task<string> GetU(string id); } } ``` No `--skip-validation` is needed (the payload is a valid single-line path). The generated `.cs` is compiled into the victim application; the module initializer runs at assembly load. This is distinct from the value sinks (enum/default), which are escaped; the path sink has no escaping. The `[Header("<name>")]` attribute is likewise emitted raw (header parameter names), at minimum a build-breaking DoS. ### 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. Verified on 2.0.0. ### 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. ### Suggested fix Escape the route template before emitting it into `[Get("…")]` (escape `"`, `\`, reject newlines) and validate that paths contain only legal URI-template characters. Apply the same encoding to `[Header(…)]`, `[Post/Put/Delete(…)]`, and every attribute that embeds a spec-derived string. [maintainer-report.txt](https://github.com/user-attachments/files/29395228/maintainer-report.txt) [make_spec.py](https://github.com/user-attachments/files/29395229/make_spec.py) [reproduce.sh](https://github.com/user-attachments/files/29395230/reproduce.sh)
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| NuGet Refitter | < 2.1.2 | 2.1.2 | ghsa |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2026-63345. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2026-63345.md Affected: Refitter < 2.1.2 Fixed in: 2.1.2 Steps: 1. Search this machine and project for Refitter (NuGet): dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
Technologies
References
Patches
Other
- https://nvd.nist.gov/vuln/detail/CVE-2026-63345
- https://github.com/christianhelle/refitter/releases/tag/2.1.2
- https://github.com/user-attachments/files/29395228/maintainer-report.txt
- https://github.com/user-attachments/files/29395229/make_spec.py
- https://github.com/user-attachments/files/29395230/reproduce.sh
- https://github.com/advisories/GHSA-3fhm-p725-h3g3
FAQ
Is CVE-2026-63345 being exploited?
There is no confirmed exploitation: CVE-2026-63345 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.62% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2026-63345?
Critical: CVSS 9.3 (v4.0, scored by GitHub). Remote, no login needed.
Which versions are affected by CVE-2026-63345?
Refitter < 2.1.2.
Is there a fix for CVE-2026-63345?
Yes. Fixed in 2.1.2. Upgrade Refitter to 2.1.2 or later.
How do I check if I'm affected by CVE-2026-63345?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.
More Refitter vulnerabilities
See all| Severity | Identifier / vulnerability | Technology | Signals | Age |
|---|---|---|---|---|
| HIGH 7.1 | CVE-2026-63184 Refitter: Unrestricted OpenAPI references permit build-host SSRF and file inclusion | NuGet packages | EPSS 50% | |
| CRITICAL 9.3 | CVE-2026-63344 Refitter allows arbitrary code execution through unescaped OpenAPI content-type values | NuGet packages | EPSS 44% | |
| CRITICAL 9.3 | CVE-2026-63346 Refitter allows code execution through unescaped OpenAPI header parameter names | NuGet packages | EPSS 44% |