Escape single quotes in content type media keys (GHSA-rcpr-mq4m-jx9j)
fix: escape single quotes in content type media keys (GHSA-rcpr-mq4m-jx9j) (#4005)
Escape single quotes in content type media keys (GHSA-rcpr-mq4m-jx9j)a2d4af-fix-escape-single-quotes-in-content-type-cve-2026-96757fixescape single quotes content type media
Committed by melloware
commit message
fix: escape single quotes in content type media keys (GHSA-rcpr-mq4m-jx9j) (#4005)
The OpenAPI requestBody.content / response media type key was interpolated into
single-quoted string literals in generated code without escaping. A single quote
in a media type terminated the literal, producing broken TypeScript or, with a
crafted key, valid-but-backdoored code (e.g. an extra header silently injected
into the generated request).
Applies the existing jsStringLiteralEscape (the same fix used for path segments
in v8.21.0) at every site that embeds a spec-controlled media type in a
generated string literal:
- @orval/core generateMutatorConfig Content-Type header (axios/angular/
solid-start mutator paths)
- @orval/fetch request headers
- @orval/solid-start mutator request headers
- @orval/core form-data Blob part content type
- @orval/mock msw response Content-Type headers
- @orval/angular http-client and http-resource accept media type literals
The advisory named the first three; the rest are the same class of bug reached
through the same untrusted input.
Reported-by: SnailSploit
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>Editor assessment
This commit patches CVE-2026-96757. Detailed and complete. The body lists every site embedding a spec-controlled media type in a generated literal - core mutator Content-Type, fetch headers, solid-start, form-data blob parts, msw responses and angular accept types - and explains the single-quote injection consequence, including a silently injected header. It also notes that the advisory named only three of the sites. Clear and well scoped. Formally the body is a clear, separated inventory; nothing structural is missing from the explanation.