Summary
Refitter versions before 2.1.2 emit OpenAPI content-type keys into generated C# code without escaping, which allows code injection. The source rates it critical (CVSS 4.0: 9.3).
What happened
Refitter copies the specification's content-type key (the key of the content map in requestBody or responses) verbatim into a Refit Headers attribute string without escaping double quotes. According to the source, a crafted value passes Refitter's default OpenAPI validation, breaks out of the attribute and the enclosing interface and namespace, and injects a top-level class with a method marked as ModuleInitializer. Because .NET runs such methods when the assembly loads, the attacker's code runs at application startup. Disabling validation is not required. The source states it was verified on Refitter 2.0.0 with .NET 8. The associated weaknesses are CWE-94 and CWE-116.
Why it matters
According to the source, the impact is code execution at assembly load (process startup) in any application that compiles a Refitter client generated from an attacker-controlled or attacker-influenced OpenAPI description. The score is CVSS 4.0: 9.3 (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), with critical severity. CISA's KEV catalog does not list active exploitation and the source does not state known exploitation. Identifiers: CVE-2026-63344 and GHSA-p32v-8v8j-j534.
Affected products and versions
NuGet package Refitter, versions before 2.1.2 (< 2.1.2). Fixed in 2.1.2.
| Product | Versions | Fixed in |
|---|---|---|
| Refitter | < 2.1.2 | 2.1.2 |
Action recommended by the source
The source lists version 2.1.2 as the fixed release. As a broader measure, the source suggests escaping every spec-derived string before emitting it into a Refit attribute (double quotes and backslashes, rejecting newlines), validating characters, and auditing all attribute emissions that embed spec-derived values using one shared encoder. References: the GHSA advisory, the NVD page for the CVE, pull request 1178 and the 2.1.2 release in the project repository.
Fixed in: 2.1.2
Sources and references
- https://github.com/advisories/GHSA-p32v-8v8j-j534 — GHSA
- https://github.com/christianhelle/refitter/security/advisories/GHSA-p32v-8v8j-j534 — GHSA
- https://nvd.nist.gov/vuln/detail/CVE-2026-63344 — GHSA
- https://github.com/christianhelle/refitter/pull/1178 — GHSA
- https://github.com/christianhelle/refitter/commit/ab4d8e439d6f0ee82ad49ee15323978d70fe5a67 — GHSA
- https://github.com/christianhelle/refitter/releases/tag/2.1.2 — GHSA
- https://github.com/user-attachments/files/29394848/reproduce.sh — GHSA
- https://github.com/user-attachments/files/29394851/maintainer-report.txt — GHSA
- https://github.com/user-attachments/files/29394853/make_spec.py — GHSA
Weaknesses (CWE): CWE-94, CWE-116
Relevant change history
Published
Advisory published.