{"id":"CVE-2026-63344","aliases":["CVE-2026-63344","GHSA-p32v-8v8j-j534"],"related":[],"kind":"vulnerability","state":"published","title":"Refitter: C# source injection through OpenAPI content-type map keys","summary":"Refitter is a tool for generating a C# REST API client using the Refit library. Prior to 2.1.2, content-type keys in the content maps of `requestBody/responses` are emitted verbatim into a Refit `[Headers(\"Accept: <ct>\", \"Content-Type: <ct>\")]` attribute string without escaping quotation marks. A crafted content-type key in an attacker-influenced OpenAPI description survives default validation without `--skip-validation`, breaks out of the attribute string and enclosing interface and namespace, and can introduce a top-level file class while leaving valid generated C#. A `[ModuleInitializer]` method in that class executes attacker code when the generated assembly is loaded at application startup, without requiring a call to the client. The behavior was verified with Refitter 2.0.0 and .NET 8. This issue is fixed in version 2.1.2.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Refitter is a tool for generating a C# REST API client using the Refit library. Prior to 2.1.2, content-type keys in the content maps of `requestBody/responses` are emitted verbatim into a Refit `[Headers(\"Accept: <ct>\", \"Content-Type: <ct>\")]` attribute string without escaping quotation marks. A crafted content-type key in an attacker-influenced OpenAPI description survives default validation without `--skip-validation`, breaks out of the attribute string and enclosing interface and namespace, and can introduce a top-level file class while leaving valid generated C#. A `[ModuleInitializer]` method in that class executes attacker code when the generated assembly is loaded at application startup, without requiring a call to the client. The behavior was verified with Refitter 2.0.0 and .NET 8. This issue is fixed in version 2.1.2.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nRefitter emits the spec's content-type key (content map key in requestBody/responses) verbatim into a Refit `[Headers(\"Accept: <ct>\", \"Content-Type: <ct>\")]` 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\nThe malicious input is a content-type KEY such as: content: { 'application/<breakout>': {schema} }.\nNo `--skip-validation` is required.\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[reproduce.sh](https://github.com/user-attachments/files/29394848/reproduce.sh)\n[maintainer-report.txt](https://github.com/user-attachments/files/29394851/maintainer-report.txt)\n[make_spec.py](https://github.com/user-attachments/files/29394853/make_spec.py)","format":"markdown","source":"ghsa"}],"published":"2026-10-30T22:15:27.846Z","modified":"2026-11-20T00:15:05.570Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":8.6,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":8.6,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"CRITICAL"}],"cwes":["CWE-94","CWE-116"],"affected":[{"ranges":[{"version":"< 2.1.2","status":"affected"}],"vendor":"christianhelle","product":"refitter","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.1.2"}],"ecosystem":"NuGet","package":"Refitter","purl":"pkg:nuget/Refitter","source":"ghsa"}],"references":[{"url":"https://github.com/christianhelle/refitter/security/advisories/GHSA-p32v-8v8j-j534","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/christianhelle/refitter/pull/1178","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/christianhelle/refitter/commit/ab4d8e439d6f0ee82ad49ee15323978d70fe5a67","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/christianhelle/refitter/releases/tag/2.1.2","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/user-attachments/files/29394848/reproduce.sh","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/user-attachments/files/29394851/maintainer-report.txt","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/user-attachments/files/29394853/make_spec.py","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-63344","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/christianhelle/refitter","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-11-06T18:49:16.142Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-63344","url":"https://www.cve.org/CVERecord?id=CVE-2026-63344","licence":"CVE Terms of Use","modified":"2026-11-06T18:49:39.123Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-p32v-8v8j-j534","url":"https://github.com/advisories/GHSA-p32v-8v8j-j534","licence":"CC-BY-4.0","modified":"2026-11-20T00:15:05.570Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-63344","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-63344","licence":"Public domain","modified":"2026-11-06T19:17:55.310Z"}],"updatedAt":"2026-11-25T22:59:48.042Z","epss":{"score":0.00568,"percentile":0.48434,"date":"2026-12-01T12:00:22.000Z"}}