---
id: "CVE-2026-63346"
kind: "vulnerability"
aliases: ["CVE-2026-63346"]
title: "Refitter: crafted OpenAPI header name injects code into generated C# client"
severity: "high"
cvss: 8.6
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["csharp", "dotnet", "openapi", "package", "refit", "refitter"]
not_affected_if: ["no-header-parameters", "refitter-2.1.2-or-later", "trusted-openapi-specs-only"]
published_at: "2026-10-30T23:17:14+00:00"
first_seen_at: "2026-10-30T23:26:12+00:00"
updated_at: "2026-10-30T23:28:02+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-63346", "first_seen_at": "2026-10-30T23:26:12+00:00"}]
---

# Refitter: crafted OpenAPI header name injects code into generated C# client

Refitter, a tool that generates C# REST clients from OpenAPI files, fails to escape quotation marks in header parameter names, so a crafted OpenAPI description can inject code. The injected [ModuleInitializer] runs attacker code when the compiled assembly loads, even if the client is never called.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed Refitter version (for example `refitter --version` or the version in your project's tool manifest); versions before `2.1.2` are affected.
- Look for generated C# clients whose `[Header("...")]` attributes contain unexpected quotation marks or a `[ModuleInitializer]` method in a top-level file class.
- Check whether generation runs on OpenAPI specs from outside your organisation.

## Fix

- Refitter: upgrade to `2.1.2`.

## Timeline

- 2026-10-30T23:26:12+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-63346

## From the sources

Refitter is a tool for generating a C# REST API client using the Refit library. Prior to 2.1.2, the header parameter name in `parameters[].name` with `in: header` is emitted verbatim into a Refit `[Header("<name>")]` attribute string without escaping quotation marks. An attacker-influenced OpenAPI description can pass default validation without `--skip-validation` and break out from the parameter-list position by closing the parameter and method syntax, attribute, interface, and namespace. The generated file can remain valid C# while containing a top-level file class with a `[ModuleInitializer]` method, which executes attacker code when the compiled assembly is loaded at application startup, even if the client is never called. Query `AliasAs` and enum/default value sinks are escaped; this flaw is in header-name attribute-string emission. The behavior was verified with Refitter 2.0.0 and .NET 8. This issue is fixed in version 2.1.2.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
