CVE-2026-63346: Refitter allows code execution through unescaped OpenAPI header parameter names
Refitter emits the spec’s header parameter name (parameters[].name with in: header) verbatim into a Refit [Header("<name>")] 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.
Notable: the breakout starts from a PARAMETER-LIST position (it closes the params and method first).
The malicious input is a header parameter name. No --skip-validation is required. The query
AliasAs and value sinks (enum, default) are escaped; the gap is in the attribute-string emission.
References
- github.com/advisories/GHSA-58x9-vjvp-6mx8
- github.com/christianhelle/refitter/commit/63a19b03699a9c267d6fab5f758ec26484db83a1
- github.com/christianhelle/refitter/pull/1178
- github.com/christianhelle/refitter/releases/tag/2.1.2
- github.com/christianhelle/refitter/security/advisories/GHSA-58x9-vjvp-6mx8
- github.com/user-attachments/files/29395048/maintainer-report.txt
- github.com/user-attachments/files/29395050/make_spec.py
- github.com/user-attachments/files/29395051/reproduce.sh
- nvd.nist.gov/vuln/detail/CVE-2026-63346
Code Behaviors & Features
Detect and mitigate CVE-2026-63346 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →