Skip to content
DayZeroHub
Critical CVSS 9.3GHSA-p32v-8v8j-j534CVE-2026-63344

Refitter: code execution via unescaped OpenAPI content-type values

Refitter

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.

ProductVersionsFixed in
Refitter< 2.1.22.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

Information taken from the source or the vendor. Verify it at the original link before acting.

Sources and references

Weaknesses (CWE): CWE-94, CWE-116

Relevant change history

  1. Published

    Advisory published.

Summary written with AI assistance from the source data. See the sources and references for complete information. View sources