CVE-2026-63345
Critical 9.3No known exploitationFix availableRefitter allows arbitrary code execution through unescaped OpenAPI paths
Vendor advisory: GHSA-3fhm-p725-h3g3
Record last updated
CVSS score
Critical on a 0 to 10 scale
EPSS, chance of exploitation in 30 days
No EPSS score available
CISA remediation deadline
Not in the KEV catalog
Description
### Summary Refitter emits each OpenAPI path (the paths-object key) verbatim into a Refit `[Get(" ")]` 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 Dummy(); } } file class Evil { [System.Runtime.CompilerServices.ModuleInitializer] internal static void Init(){ /* attacker code */ } } namespace N2 { public partial interface I2 { [Get("/q")] Task 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(" ")]` attri…
Weakness: CWE-94, CWE-1116
Patching and mitigation
- Patch status
- Fix available (source: GitHub Advisory Database)
- Fix documented (source date)
- Mitigation
- None documented
- Vendor guidance
- github.com (opens in a new tab)
Affected products
| Vendor | Product | Affected versions | Fixed in | Per |
|---|---|---|---|---|
| nuget | Refitter | all versions before 2.1.2 | 2.1.2 | GitHub Advisory Database |
Timeline
Patch
Fix documented by GitHub Advisory Database
Vendor guidance and references
- GitHub Advisory GHSA-3fhm-p725-h3g3 (opens in a new tab)github-advisory