GHSA-p32v-8v8j-j534

Suggest an improvement
Source
https://github.com/advisories/GHSA-p32v-8v8j-j534
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-p32v-8v8j-j534/GHSA-p32v-8v8j-j534.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-p32v-8v8j-j534
Aliases
Published
2026-11-20T00:06:52Z
Modified
2026-11-20T00:15:05Z
Severity
  • 9.3 (Critical) CVSS_V4 - 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 CVSS Calculator
Summary
Refitter allows arbitrary code execution through unescaped OpenAPI content-type values
Details

Summary

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 executes at application startup. Verified on Refitter 2.0.0 / .NET 8.

The malicious input is a content-type KEY such as: content: { 'application/': {schema} }. No --skip-validation is required.

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. reproduce.sh maintainer-report.txt make_spec.py

Database specific
{
    "cwe_ids": [
        "CWE-116",
        "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-20T00:06:52Z",
    "nvd_published_at": "2026-10-30T23:17:13Z",
    "severity": "CRITICAL"
}
References

Affected packages

NuGet / Refitter

Package

Name
Refitter
View open source insights on deps.dev
Purl
pkg:nuget/Refitter

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
2.1.2

Affected versions

0.*
0.1.2-alpha
0.1.3-alpha
0.1.4-alpha
0.1.5-alpha
0.2.0-alpha
0.2.1-alpha
0.2.2-alpha
0.2.3-alpha
0.2.4-alpha
0.3.0
0.3.1
0.3.2
0.3.3
0.3.4
0.3.16
0.3.17
0.4.0
0.4.1
0.4.2
0.5.0
0.5.1
0.5.2
0.5.3
0.5.25
0.5.26
0.5.27
0.5.28
0.5.29
0.5.30
0.6.0
0.6.1
0.6.2
0.6.3
0.7.0
0.7.0.20-preview
0.7.0.21-preview
0.7.0.22-preview
0.7.0.23-preview
0.7.0.26-preview
0.7.0.27-preview
0.7.0.28-preview
0.7.1
0.7.1.29-preview
0.7.1.30-preview
0.7.1.31-preview
0.7.2
0.7.2.32-preview
0.7.3
0.7.3.33-preview
0.7.3.34-preview
0.7.3.35-preview
0.7.3.36-preview
0.7.3.37-preview
0.7.4
0.7.5
0.8.0
0.8.1
0.8.2
0.8.3
0.8.4
0.8.5
0.8.6
0.8.6.38-preview
0.8.6.39-preview
0.8.7
0.8.7.40-preview
0.8.7.41-preview
0.9.0
0.9.1
0.9.2
0.9.3.42-preview
0.9.4
0.9.4.43-preview
0.9.5
0.9.6
0.9.7
0.9.8
0.9.9
0.9.9.44-preview
1.*
1.0.0
1.0.1
1.0.2
1.1.0.45-preview
1.1.1
1.1.2
1.1.3
1.2.0
1.3.0
1.3.1
1.3.2
1.4.0
1.4.1
1.5.0
1.5.1
1.5.2
1.5.3
1.5.4
1.5.5
1.5.6
1.6.0
1.6.1
1.6.2
1.6.3
1.6.4
1.6.5
1.7.0
1.7.1
1.7.2
1.7.3
2.*
2.0.0
2.1.0
2.1.1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-p32v-8v8j-j534/GHSA-p32v-8v8j-j534.json"