Critical

Refitter allows code execution through unescaped OpenAPI header parameter names

  • Disclosed: 20.11.2026
  • Updated: 21.11.2026 10:00

Summary

Refitter emits the spec's header parameter name (parameters[].name with in: header) verbatim into a Refit [Header("<name>")] attribute string without escaping ". A crafted value survives Refitter's default OpenAPI validation, breaks out of the attribute and the enclosing interface + namespace, injects a top-level file class with a [ModuleInitializer] method, and reopens so the file stays valid. .NET runs [ModuleInitializer] methods at assembly load, so the attacker's code executes at application startup. Verified on Refitter 2.0.0 / .NET 8.

Notable: the breakout starts from a PARAMETER-LIST position (it closes the params and method first). The malicious input is a header parameter name. No --skip-validation is required. The query AliasAs and value sinks (enum, default) are escaped; the gap is in the attribute-string emission.

PoC

reproduce.sh (+ make_spec.py) attached: generates with default validation, compiles into a console app, runs it (Main does not touch the client), and shows a marker written at assembly load.

Impact

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. Estimated Critical, e.g. 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).

Suggested fix

Escape every spec-derived string before emitting it into a Refit attribute (escape ", \, reject newlines) and validate characters. We recommend auditing all attribute emissions that embed spec-derived values, using one shared encoder.

maintainer-report.txt make_spec.py reproduce.sh

What to do

Upgrade to Refitter version 2.1.2 or later.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
.NET (NuGet) Refitter < 2.1.2 2.1.2

References

CVSS score -
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
Weakness (CWE)
CWE-116, CWE-94
Platform
.NET (NuGet)
Package
Refitter
Disclosed
20.11.2026
Updated
21.11.2026 10:00

Sources and licenses · Edited or translated by DockRay; source rights and applicable licenses are retained.

OSV / GitHub Advisory Database - GHSA-58x9-vjvp-6mx8 - CC BY 4.0

Vulnerability history: Refitter

All published vulnerabilities of this package (.NET (NuGet)), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
3
First → latest
11.2026 11.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Critical 3

Disclosures per year

  1. 2026: 3
  1. Refitter allows code execution through unescaped OpenAPI header parameter names this entry
    Critical CVE-2026-63346 < 2.1.2 2.1.2

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.