{"id":"GHSA-58x9-vjvp-6mx8","summary":"Refitter allows code execution through unescaped 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(\"\u003cname\u003e\")]` 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)","aliases":["CVE-2026-63346"],"modified":"2026-11-20T00:15:05.562164021Z","published":"2026-11-20T00:06:28Z","database_specific":{"cwe_ids":["CWE-116","CWE-94"],"severity":"CRITICAL","github_reviewed":true,"github_reviewed_at":"2026-11-20T00:06:28Z","nvd_published_at":"2026-10-30T23:17:14Z"},"references":[{"type":"WEB","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":"WEB","url":"https://github.com/christianhelle/refitter/pull/1178"},{"type":"WEB","url":"https://github.com/christianhelle/refitter/commit/63a19b03699a9c267d6fab5f758ec26484db83a1"},{"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/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"}],"affected":[{"package":{"name":"Refitter","ecosystem":"NuGet","purl":"pkg:nuget/Refitter"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.1.2"}]}],"versions":["0.1.2-alpha","0.1.3-alpha","0.1.4-alpha","0.1.5-alpha","0.2.0-alpha","0.2.1-alpha","0.2.2-alpha","0.2.3-alpha","0.2.4-alpha","0.3.0","0.3.1","0.3.16","0.3.17","0.3.2","0.3.3","0.3.4","0.4.0","0.4.1","0.4.2","0.5.0","0.5.1","0.5.2","0.5.25","0.5.26","0.5.27","0.5.28","0.5.29","0.5.3","0.5.30","0.6.0","0.6.1","0.6.2","0.6.3","0.7.0","0.7.0.20-preview","0.7.0.21-preview","0.7.0.22-preview","0.7.0.23-preview","0.7.0.26-preview","0.7.0.27-preview","0.7.0.28-preview","0.7.1","0.7.1.29-preview","0.7.1.30-preview","0.7.1.31-preview","0.7.2","0.7.2.32-preview","0.7.3","0.7.3.33-preview","0.7.3.34-preview","0.7.3.35-preview","0.7.3.36-preview","0.7.3.37-preview","0.7.4","0.7.5","0.8.0","0.8.1","0.8.2","0.8.3","0.8.4","0.8.5","0.8.6","0.8.6.38-preview","0.8.6.39-preview","0.8.7","0.8.7.40-preview","0.8.7.41-preview","0.9.0","0.9.1","0.9.2","0.9.3.42-preview","0.9.4","0.9.4.43-preview","0.9.5","0.9.6","0.9.7","0.9.8","0.9.9","0.9.9.44-preview","1.0.0","1.0.1","1.0.2","1.1.0.45-preview","1.1.1","1.1.2","1.1.3","1.2.0","1.3.0","1.3.1","1.3.2","1.4.0","1.4.1","1.5.0","1.5.1","1.5.2","1.5.3","1.5.4","1.5.5","1.5.6","1.6.0","1.6.1","1.6.2","1.6.3","1.6.4","1.6.5","1.7.0","1.7.1","1.7.2","1.7.3","2.0.0","2.1.0","2.1.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-58x9-vjvp-6mx8/GHSA-58x9-vjvp-6mx8.json"}}],"schema_version":"1.9.2","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"}]}