{"vuln_id":"CVE-2026-63345","aliases":["GHSA-3fhm-p725-h3g3"],"description":"Refitter allows arbitrary code execution through unescaped OpenAPI paths","published_at":"2026-11-20T00:06:04Z","modified_at":"2026-11-20T00:06:06Z","first_seen_at":"2026-11-21T19:15:19.334693Z","severity":"critical","severity_source":"ghsa","cvss_score":9.3,"cvss_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","cwe":["CWE-94","CWE-1116"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.00568,"epss_percentile":0.47949,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-63345"},"matched_alias":null,"items":[{"id":2343,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-3fhm-p725-h3g3 / CVE-2026-63345: Refitter allows arbitrary code execution through unescaped OpenAPI paths","summary":"Refitter allows arbitrary code execution through unescaped OpenAPI paths\n\n### Summary\n\nRefitter emits each OpenAPI path (the paths-object key) verbatim into a Refit `[Get(\"\n\")]`\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\nDummy(); } }\nfile class Evil { [System.Runtime.CompilerServices.ModuleInitializer]\ninternal static void Init(){ /* attacker code */ } }\nnamespace N2 { public partial interface I2 { [Get(\"/q\")]\nTask\nGetU(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(\"\n\")]` 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)\n\nAffected packages: nuget:Refitter\nPatched: Refitter 2.1.2","url":"https://github.com/advisories/GHSA-3fhm-p725-h3g3","published_at":"2026-11-20T00:06:04Z","updated_at":"2026-11-20T00:06:06Z","fetched_at":"2026-11-21T19:15:18.416764Z","severity":"critical","cvss_score":9.3,"epss":0.00568,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"Refitter","vuln_id":"CVE-2026-63345","vuln_ids":["CVE-2026-63345","GHSA-3FHM-P725-H3G3"],"tags":["ghsa","nuget","CWE-94","CWE-1116"],"cluster_id":2118,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2343","html":"https://vulnwatch.ve1ve2.com/item/2343"}}]}