Refitter code injection via unescaped OpenAPI strings — header names, content-types, paths (CVE-2026-63344/63346)
Severity: critical · Patch status: patched · Since 2026-11-20 · CVE-2026-63344, CVE-2026-63345, CVE-2026-63346
Three related advisories (CVE-2026-63346, CVE-2026-63344, and a path-based variant) describe critical code-injection flaws in Refitter < 2.1.2, a .NET tool that generates Refit API clients from OpenAPI specs. Refitter emits spec-derived strings — header parameter names, content-type map keys, and path keys — verbatim into Refit attribute strings without escaping double quotes. A crafted OpenAPI document passes default validation, breaks out of the attribute and enclosing interface/namespace, and injects a top-level file class with a [ModuleInitializer] method, whose code executes at assembly load (application startup) when the generated client is compiled into an app. Any application building clients from attacker-controlled or attacker-influenced OpenAPI descriptions is affected. Fixed in Refitter 2.1.2 by escaping/validating all spec-derived attribute strings.
What to do
- Upgrade Refitter to 2.1.2 or later and regenerate all clients
- Audit and rebuild any applications compiled with clients generated from untrusted or third-party OpenAPI specs
- Treat OpenAPI documents from partners, vendors, or URLs as untrusted input until regenerated with the patched version
- Scan build artifacts for unexpected file classes or ModuleInitializer methods in generated code
Fixed versions
Sources
All live incidents on Threat Watch