Refitter
CVE-2026-63346
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft OpenAPI header-name with quote breakout
-
DeliveryDeliver attacker-influenced spec to developer
-
ExploitRefitter emits unescaped [Header] attribute
-
ExecutionCompile client assembly containing [ModuleInitializer]
-
ImpactAttacker code executes at application startup
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires a victim to run Refitter version 2.0.0 or earlier to generate a Refit client from an attacker-controlled or attacker-influenced OpenAPI description, and then compile that generated code into an application. The specific trigger is an OpenAPI header parameter (parameters[].name with in: header, or an ApiKey security scheme with in: header) whose name contains a double-quote character, which breaks out of the generated [Header("<name>")] Refit attribute, closes the parameter list/method/interface/namespace, and injects a top-level file class with a [ModuleInitializer] method that .NET runs at assembly load. Crucially, no --skip-validation is required - the malicious name passes Refitter's default OpenAPI validation. Limiting factors that reduce real-world risk: the attack needs the developer to ingest an untrusted spec and perform a build/compile step (UI:A), and only the header-name attribute sink is vulnerable - query AliasAs and enum/default value sinks are already escaped. Fixed in 2.1.2, which escapes spec-derived strings and adds AttributeStringValidator to reject unsafe characters unless validation is skipped. |
| Impact | This is a genuine code-execution flaw (CWE-94/CWE-116) but its real-world risk is gated by a developer-in-the-loop precondition rather than being a drive-by remote exploit. The input CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H) scores 8.6: network-reachable, low complexity, no privileges, but requiring active user interaction - consistent with the mechanism, since a victim developer must generate a Refit client from an attacker-influenced OpenAPI description and compile it. KEV status is not present in the input, so there is no confirmed active exploitation; the vuln.today Decision label is 'this_week' (not act_now/emergency), indicating prompt-but-not-crisis prioritization. No EPSS score is provided, so probabilistic exploitation likelihood cannot be weighed. A public PoC reference exists (reproduce.sh + make_spec.py attached to the advisory), but it is not verified as working exploit code; PoC availability is a distinct signal from active exploitation and should not be read as 'in the wild.' The notable escalators are that the payload survives Refitter's DEFAULT validation (no --skip-validation needed) and that [ModuleInitializer] executes at assembly load even if the generated client is never called - so impact is high once the preconditions are met. Net: a real priority for anyone who generates Refit clients from untrusted specs, but mitigated in practice by the niche footprint and the need for a build/compile step. |
| Exploit ScenarioDerived | An attacker publishes or influences an OpenAPI description whose header parameter (in: header) carries a name containing a double-quote that closes the [Header("...")] attribute and injects a top-level file class with a [ModuleInitializer] method. A developer runs Refitter (<= 2.0.0) against that spec under default validation, generates the client, and compiles it into their application; the injected code then runs at assembly load during application startup even though Main never calls the client. A public PoC reference (reproduce.sh/make_spec.py) demonstrates this chain, though it is not verified as a packaged working exploit. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 30, 2026
Code execution at assembly load in Refitter-generated C
clients (CWE-94/CWE-116): a header parameter name taken from an OpenAPI description is emitted unescaped into a Refit [Header("...")] attribute, letting a crafted spec close the parameter list, method, interface and namespace and inject a top-level file class with a [ModuleInitializer] that .NET runs when the compiled assembly loads, even if the generated client is never called. Affected are Refitter releases prior to 2.1.2 (the behavior was reproduced on 2.0.0 with .NET 8), and exploitation requires a developer to generate and compile a client from an attacker-controlled or attacker-influenced OpenAPI description, which is why the assessed vector carries UI:R despite the 8.6 severity. The malicious header name survives Refitter's default OpenAPI validation (no --skip-validation needed), a public PoC reproduction harness (make_spec.py and reproduce.sh) is attached to GitHub advisory GHSA-58x9-vjvp-6mx8, and the supplied intelligence contains no CISA KEV entry for this issue.
RemediationAI
Vendor-released patch: Refitter 2.1.2 - upgrade the Refitter tool/package to 2.1.2 or later, which escapes spec-derived strings via ParameterNaming.EscapeString in the header-name attribute sink (and in the Accept/Content-Type header values, operation path and security-scheme header names) and adds AttributeStringValidator that rejects quotes, backslashes and control characters in paths, header names and content-type keys with a clear diagnostic (see https://github.com/christianhelle/refitter/releases/tag/2.1.2, https://github.com/christianhelle/refitter/pull/1178 and https://github.com/christianhelle/refitter/security/advisories/GHSA-58x9-vjvp-6mx8). If upgrading immediately is not possible, the actionable compensating control is to stop generating clients from untrusted or attacker-influenced OpenAPI documents (for example, restrict generation to specs vendored from a trusted source and reviewed through change control) and, where untrusted specs must still be processed, treat the generated .cs output as untrusted code: review it before compiling and reject any output containing [ModuleInitializer], top-level file classes or unexpected namespace re-openings - a manual review step that does not scale well and only catches payloads visible in the diff. Note that --skip-validation is not a mitigation here (validation skipping is not required to exploit the flaw) and would in fact bypass the new AttributeStringValidator rejection added in 2.1.2, so it should not be used as a workaround; there is no documented configuration switch that disables header-attribute emission, since header parameter generation is core to client fidelity.
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Refitter is a .NET code generator that consumes an OpenAPI document and emits C
Refit client interfaces, where Refit expresses HTTP behavior through attributes such as [Get("path")], [Header("name")] and [AliasAs("name")]. The flaw is a classic improper-encoding-of-output / code-injection pair (CWE-116 mapping to CWE-94): the generator builds attribute strings by interpolating spec-derived text directly into C
source, and the header-name sink (parameters[].name with in: header, plus ApiKey security schemes with in: header) was written without escaping the double-quote, backslash or control characters. Because the injection originates in a parameter-list position, a crafted name first terminates the parameter and method signatures and then closes the enclosing attribute, interface and namespace; the payload reopens a namespace and declares a top-level file class carrying a [ModuleInitializer] method, keeping the emitted file syntactically valid C
while the .NET runtime executes module initializers at assembly load, i.e. at application startup. The advisory notes the query AliasAs and enum/default value sinks were already escaped, and the upstream fix (PR #1178, commit 63a19b0) routes the header name, the Accept/Content-Type header values, the operation path, and security-scheme header names through ParameterNaming.EscapeString (now also expanding control characters to \uXXXX escapes) and adds an AttributeStringValidator that rejects quotes, backslashes and control characters in paths, header parameter names and content-type keys unless validation is skipped; the same validator references sibling advisories GHSA-3fhm-p725-h3g3 (path) and GHSA-p32v-8v8j-j534 (content-type), indicating a shared root-cause class across attribute emissions.
Know when Refitter gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
AV:N and PR:N because a malicious spec can be delivered remotely with no privileges; UI:R because a developer must generate and compile the client; full C/I/A as arbitrary code runs at assembly load.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
DescriptionCVE.org
Refitter is a tool for generating a C
REST API client using the Refit library. Prior to 2.1.2, the header parameter name in parameters[].name with in: header is emitted verbatim into a Refit [Header("<name>")] attribute string without escaping quotation marks. An attacker-influenced OpenAPI description can pass default validation without --skip-validation and break out from the parameter-list position by closing the parameter and method syntax, attribute, interface, and namespace. The generated file can remain valid C
while containing a top-level file class with a [ModuleInitializer] method, which executes attacker code when the compiled assembly is loaded at application startup, even if the client is never called. Query AliasAs and enum/default value sinks are escaped; this flaw is in header-name attribute-string emission. The behavior was verified with Refitter 2.0.0 and .NET 8. This issue is fixed in version 2.1.2.
Technical POC Analysis
Refitter's C# generator constructs the Refit interface by string interpolation.
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
CVE-2026-63346 is a high-severity vulnerability in Refitter, a tool that generates C
clients from OpenAPI specifications. A malicious OpenAPI spec can inject code that executes when a developer compiles the generated client, even without calling it. This affects any organization using Refitter prior to version 2.1.2, potentially compromising developer workstations and source code.
No vendor-released patch identified at time of analysis
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Affected Products (CPE)CVE.org
Refitter, the .NET tool that generates C# Refit clients from OpenAPI descriptions, writes content-type keys from request
Code execution at assembly load in applications built from Refitter 2.0.0 and earlier: the generator copies each OpenAPI
Generation-time server-side request forgery, remote file inclusion and out-of-tree local file inclusion in the Refitter
NVD
CVE.org
EPSS
GitHub
Exploit-DB