CVE-2026-63345: Refitter Refitter Allows Arbitrary Code Execution Vulnerability
CRITICALCVE-2026-63345 is a CRITICAL refitter allows arbitrary code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Refitter libraries in the NuGet ecosystem. The issue involves refitter allows arbitrary code execution through unescaped openapi paths. Remediation is available by upgrading affected packages to version 2.1.2.
CVE-2026-63345 at a Glance
How to Fix CVE-2026-63345
To remediate this vulnerability, upgrade all affected Refitter dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade Refitter to 2.1.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for Refitter
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-63345, inspect your project dependencies for Refitter:
inspect dependencies for Refitter
Analyze the terminal output to locate any version of Refitter in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Refitter, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-63345 Affected Refitter Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
Refitter
|
NuGet |
< 2.1.2
|
2.1.2
|
References
Frequently Asked Questions
What is CVE-2026-63345?
Which Refitter versions are affected?
What version fixes CVE-2026-63345?
Is Refitter affected?
What CWE is associated with CVE-2026-63345?
How can I check NuGet dependencies for CVE-2026-63345?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-3fhm-p725-h3g3",
"modified" : "2026-11-20T00:06:04Z",
"published" : "2026-11-20T00:06:04Z",
"aliases" : [ "CVE-2026-63345" ],
"summary" : "Refitter allows arbitrary code execution through unescaped OpenAPI paths",
"details" : "### Summary\n\nRefitter emits each OpenAPI path (the paths-object key) verbatim into a Refit `[Get(\"<path>\")]`\nattribute string, without escaping `\"` or restricting characters. A crafted single-line, /-prefixed\npath survives Refitter's default OpenAPI validation yet closes the attribute string and the enclosing\ninterface + namespace, injects a top-level `file class` with a `[ModuleInitializer]` method, and\nreopens a namespace + interface so the file stays valid. .NET runs `[ModuleInitializer]` methods when\nthe generated assembly is loaded, so the attacker's code executes at application startup. Verified on\nRefitter 2.0.0 / .NET 8.\n\n### Details\n\n```\n[Get(\"/p\")] Task<string> Dummy(); } }\nfile class Evil { [System.Runtime.CompilerServices.ModuleInitializer]\n internal static void Init(){ /* attacker code */ } }\nnamespace N2 { public partial interface I2 { [Get(\"/q\")]\n Task<string> GetU(string id);\n }\n}\n```\n\nNo `--skip-validation` is needed (the payload is a valid single-line path). The generated `.cs` is\ncompiled into the victim application; the module initializer runs at assembly load. This is distinct\nfrom the value sinks (enum/default), which are escaped; the path sink has no escaping. The\n`[Header(\"<name>\")]` attribute is likewise emitted raw (header parameter names), at minimum a\nbuild-breaking DoS.\n\n### PoC\n\n`reproduce.sh` (+ `make_spec.py`) attached: generates with default validation, compiles into a console\napp, runs it (Main does not touch the client), and shows a marker written at assembly load. Verified\non 2.0.0.\n\n### Impact\n\nCode execution at assembly load (process startup) in any application that compiles a Refitter client\ngenerated from an attacker-controlled or attacker-influenced OpenAPI description.\n\n### Suggested fix\n\nEscape the route template before emitting it into `[Get(\"…\")]` (escape `\"`, `\\`, reject newlines) and\nvalidate that paths contain only legal URI-template characters. Apply the same encoding to\n`[Header(…)]`, `[Post/Put/Delete(…)]`, and every attribute that embeds a spec-derived string.\n[maintainer-report.txt](https://github.com/user-attachments/files/29395228/maintainer-report.txt)\n[make_spec.py](https://github.com/user-attachments/files/29395229/make_spec.py)\n[reproduce.sh](https://github.com/user-attachments/files/29395230/reproduce.sh)",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "NuGet",
"name" : "Refitter"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.1.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/christianhelle/refitter/security/advisories/GHSA-3fhm-p725-h3g3"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-63345"
}, {
"type" : "WEB",
"url" : "https://github.com/christianhelle/refitter/pull/1178"
}, {
"type" : "WEB",
"url" : "https://github.com/christianhelle/refitter/commit/793d2632899c2022511dfc15e30725ef69073973"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/christianhelle/refitter"
}, {
"type" : "WEB",
"url" : "https://github.com/christianhelle/refitter/releases/tag/2.1.2"
}, {
"type" : "WEB",
"url" : "https://github.com/user-attachments/files/29395228/maintainer-report.txt"
}, {
"type" : "WEB",
"url" : "https://github.com/user-attachments/files/29395229/make_spec.py"
}, {
"type" : "WEB",
"url" : "https://github.com/user-attachments/files/29395230/reproduce.sh"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1116", "CWE-94" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-11-20T00:06:04Z",
"nvd_published_at" : "2026-10-30T23:17:13Z"
}
}