Skip to content
DayZeroHub
Critical CVSS 9.3GHSA-58x9-vjvp-6mx8CVE-2026-63346

Refitter: code execution via unescaped OpenAPI header parameter names

Refitter

Summary

Refitter versions before 2.1.2 do not escape OpenAPI header parameter names when generating code, which allows injected code to run when the assembly loads. The source rates it critical (CVSS 4.0: 9.3).

What happened

Refitter writes the name of a spec header parameter (parameters[].name with in: header) verbatim into a Refit [Header("...")] 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 its enclosing block, and introduces additional code into the generated file, including a method marked with [ModuleInitializer]. Disabling validation is not required. The other emission points mentioned (query AliasAs, enum and default values) are escaped; the gap is in the attribute-string emission. The associated CWEs are CWE-94 and CWE-116.

Why it matters

According to the source, .NET runs [ModuleInitializer] methods when the assembly loads, so the injected code would execute at startup of an application that compiles a Refitter-generated client 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 per GHSA. CISA's KEV catalog does not list active exploitation; the source states it was verified on Refitter 2.0.0 with .NET 8.

Affected products and versions

Refitter (NuGet): versions before 2.1.2 (< 2.1.2). Fixed version: 2.1.2.

ProductVersionsFixed in
Refitter< 2.1.22.1.2

Action recommended by the source

The source indicates the fix is in Refitter version 2.1.2. The project's maintainers suggest escaping every spec-derived string before emitting it into a Refit attribute (escape double quotes and backslashes, reject newlines), validating characters, and auditing all attribute emissions with a shared encoder.

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