CVE-2026-63346: Refitter Refitter Allows Code Execution Through Vulnerability

CRITICAL
Advisory Identifier: GHSA-58x9-vjvp-6mx8
CWE-116 CWE-94
Published
Advisory Summary

CVE-2026-63346 is a CRITICAL refitter allows code execution through vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting Refitter libraries in the NuGet ecosystem. The issue involves refitter allows code execution through unescaped openapi header parameter names. Remediation is available by upgrading affected packages to version 2.1.2.

CVE-2026-63346 at a Glance

CVE Identifier CVE-2026-63346
GHSA Identifier GHSA-58x9-vjvp-6mx8
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-116: Improper Encoding or Escaping of Output
Affected Product Refitter
Package Ecosystem NuGet
Published Date
Last Updated

How to Fix CVE-2026-63346

To remediate this vulnerability, upgrade all affected Refitter dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

Refitter fixed: 2.1.2
Upgrade Refitter to 2.1.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for Refitter

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-63346, inspect your project dependencies for Refitter:

inspect dependencies for Refitter

Analyze the terminal output to locate any version of Refitter in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-116: Improper Encoding or Escaping of Output, where the product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. as a result, the intended structure of the message is not preserved. In Refitter, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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](https://github.com/user-attachments/files/29395048/maintainer-report.txt) [make_spec.py](https://github.com/user-attachments/files/29395050/make_spec.py) [reproduce.sh](https://github.com/user-attachments/files/29395051/reproduce.sh)

CVE-2026-63346 Affected Refitter Versions

1 component(s)
Fixed Versions:
2.1.2
Product / Package Ecosystem Affected Versions Fixed Version
Refitter
NuGet
< 2.1.2
2.1.2

References

Frequently Asked Questions

What is CVE-2026-63346?
CVE-2026-63346 is a security vulnerability in Refitter involving Refitter allows code execution through unescaped OpenAPI header parameter names under CWE-116: Improper Encoding or Escaping of Output.
Which Refitter versions are affected?
Affected versions include releases prior to 2.1.2 across affected packages: Refitter.
What version fixes CVE-2026-63346?
Upgrading to 2.1.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is Refitter affected?
Yes, Refitter is affected in releases prior to 2.1.2. Upgrade your dependency to 2.1.2 or later.
What CWE is associated with CVE-2026-63346?
CVE-2026-63346 is classified under CWE-116: Improper Encoding or Escaping of Output (The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.).
How can I check NuGet dependencies for CVE-2026-63346?
Run the dependency tree command: 'inspect dependencies for Refitter'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-58x9-vjvp-6mx8",
  "modified" : "2026-11-20T00:06:28Z",
  "published" : "2026-11-20T00:06:28Z",
  "aliases" : [ "CVE-2026-63346" ],
  "summary" : "Refitter allows code execution through unescaped OpenAPI header parameter names",
  "details" : "### Summary\n\nRefitter emits the spec's header parameter name (parameters[].name with in: header) verbatim into a Refit `[Header(\"<name>\")]` attribute string without escaping\n`\"`. A crafted value survives Refitter's default OpenAPI validation, breaks out of the attribute and\nthe enclosing interface + namespace, injects a top-level `file class` with a `[ModuleInitializer]`\nmethod, and reopens so the file stays valid. .NET runs `[ModuleInitializer]` methods at assembly\nload, so the attacker's code executes at application startup. Verified on Refitter 2.0.0 / .NET 8.\n\nNotable: the breakout starts from a PARAMETER-LIST position (it closes the params and method first).\nThe malicious input is a header parameter name. No `--skip-validation` is required. The query\n`AliasAs` and value sinks (enum, default) are escaped; the gap is in the attribute-string emission.\n\n### PoC\n\n`reproduce.sh` (+ `make_spec.py`) attached: generates with default validation, compiles into a\nconsole app, runs it (Main does not touch the client), and shows a marker written at assembly load.\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. Estimated Critical, e.g.\n`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).\n\n### Suggested fix\n\nEscape every spec-derived string before emitting it into a Refit attribute (escape `\"`, `\\`,\nreject newlines) and validate characters. We recommend auditing all attribute emissions that embed\nspec-derived values, using one shared encoder.\n[maintainer-report.txt](https://github.com/user-attachments/files/29395048/maintainer-report.txt)\n[make_spec.py](https://github.com/user-attachments/files/29395050/make_spec.py)\n[reproduce.sh](https://github.com/user-attachments/files/29395051/reproduce.sh)",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "Refitter"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.1.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/christianhelle/refitter/security/advisories/GHSA-58x9-vjvp-6mx8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-63346"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/christianhelle/refitter/pull/1178"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/christianhelle/refitter/commit/63a19b03699a9c267d6fab5f758ec26484db83a1"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/christianhelle/refitter"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/christianhelle/refitter/releases/tag/2.1.2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/user-attachments/files/29395048/maintainer-report.txt"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/user-attachments/files/29395050/make_spec.py"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/user-attachments/files/29395051/reproduce.sh"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-116", "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-11-20T00:06:28Z",
    "nvd_published_at" : "2026-10-30T23:17:14Z"
  }
}