GHSA-58x9-vjvp-6mx8: Refitter: C# source injection through OpenAPI header parameter names

Published Oct 30, 2026
·
Updated

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.

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Refitter to a version that resolves this vulnerability.

    Fixed in 2.1.2

Event History

Oct 30, 2026
CVE Published
via OSV·10:17 PM
Data Sourced
via OSV·10:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Who is exposed to this issue?

Teams using Refitter to generate C# clients from OpenAPI descriptions that an attacker can influence are exposed. This includes descriptions that pass Refitter's normal default validation; use of --skip-validation is not required.

2

What must an attacker control to exploit it?

The attacker needs to influence a header parameter name in an OpenAPI document, specifically parameters[].name for a parameter whose location is header. A quotation mark in that name can escape the generated Refit Header attribute string and inject C# source.

3

Does the generated client need to make an API call for injected code to run?

No. The injected source can define a top-level class with a ModuleInitializer method, which runs when the compiled assembly is loaded at application startup even if the generated client is never called.

4

Which generated OpenAPI elements are implicated?

The vulnerable sink is header-name emission into the Refit [Header("<name>")] attribute. Query AliasAs values and enum/default value sinks are described as escaped and are not the issue covered here.

5

What version fixes the issue?

Upgrade Refitter to version 2.1.2, which fixes this issue. The vulnerable behavior was verified in Refitter 2.0.0 with .NET 8.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203