{"id":"CVE-2026-63346","aliases":["GHSA-58x9-vjvp-6mx8"],"url":"https://o3.security/vulnerability/CVE-2026-63346","summary":"Refitter: C# source injection through OpenAPI header parameter names","details":"### Summary\n\nRefitter emits the spec's header parameter name (parameters[].name with in: header) verbatim into a Refit `[Header(\"<name>\")]` attribute string without escaping\n`\"`. A crafted value survives Refitter's default OpenAPI validation, breaks out of the attribute and\nthe enclosing interface + namespace, injects a top-level `file class` with a `[ModuleInitializer]`\nmethod, and reopens so the file stays valid. .NET runs `[ModuleInitializer]` methods at assembly\nload, so the attacker's code executes at application startup. Verified on Refitter 2.0.0 / .NET 8.\n\nNotable: the breakout starts from a PARAMETER-LIST position (it closes the params and method first).\nThe malicious input is a header parameter name. No `--skip-validation` is required. The query\n`AliasAs` and value sinks (enum, default) are escaped; the gap is in the attribute-string emission.\n\n### PoC\n\n`reproduce.sh` (+ `make_spec.py`) attached: generates with default validation, compiles into a\nconsole app, runs it (Main does not touch the client), and shows a marker written at assembly load.\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. Estimated Critical, e.g.\n`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` (the CNA sets the final score).\n\n### Suggested fix\n\nEscape every spec-derived string before emitting it into a Refit attribute (escape `\"`, `\\`,\nreject newlines) and validate characters. We recommend auditing all attribute emissions that embed\nspec-derived values, using one shared encoder.\n[maintainer-report.txt](https://github.com/user-attachments/files/29395048/maintainer-report.txt)\n[make_spec.py](https://github.com/user-attachments/files/29395050/make_spec.py)\n[reproduce.sh](https://github.com/user-attachments/files/29395051/reproduce.sh)","published":"2026-10-30T22:17:02.231Z","modified":"2026-11-04T02:30:48.878967555Z","cvss":null,"epss":{"score":0.0035,"percentile":0.2932,"asOf":"2026-11-19"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"NuGet","name":"Refitter","fixedVersion":"2.1.2"}],"fix":{"url":"https://github.com/christianhelle/refitter/commit/63a19b03699a9c267d6fab5f758ec26484db83a1","label":"christianhelle/refitter@63a19b0"},"references":[{"type":"WEB","url":"https://github.com/christianhelle/refitter/releases/tag/2.1.2"},{"type":"WEB","url":"https://github.com/user-attachments/files/29395048/maintainer-report.txt"},{"type":"WEB","url":"https://github.com/user-attachments/files/29395050/make_spec.py"},{"type":"WEB","url":"https://github.com/user-attachments/files/29395051/reproduce.sh"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/63xxx/CVE-2026-63346.json"},{"type":"ADVISORY","url":"https://github.com/christianhelle/refitter/security/advisories/GHSA-58x9-vjvp-6mx8"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-63346"},{"type":"FIX","url":"https://github.com/christianhelle/refitter/commit/63a19b03699a9c267d6fab5f758ec26484db83a1"},{"type":"FIX","url":"https://github.com/christianhelle/refitter/pull/1178"},{"type":"PACKAGE","url":"https://github.com/christianhelle/refitter"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-11-04T02:30:48.878967555Z"}}