Advisories for Nuget/Refitter package

2026

Refitter allows code execution through unescaped OpenAPI header parameter names

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 …

Refitter allows arbitrary code execution through unescaped OpenAPI paths

Refitter emits each OpenAPI path (the paths-object key) verbatim into a Refit [Get("<path>")] attribute string, without escaping " or restricting characters. A crafted single-line, /-prefixed path survives Refitter's default OpenAPI validation yet closes the attribute string and the enclosing interface + namespace, injects a top-level file class with a [ModuleInitializer] method, and reopens a namespace + interface so the file stays valid. .NET runs [ModuleInitializer] methods when the generated assembly …

Refitter allows arbitrary code execution through unescaped OpenAPI content-type values

Refitter emits the spec's content-type key (content map key in requestBody/responses) verbatim into a Refit [Headers("Accept: <ct>", "Content-Type: <ct>")] 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 …