OpenAPI3 version value escapes emitterOutputDir and overwrites YAML/JSON outside the output tree
What to do
Vendor response not established. Follow the primary source's mitigation guidance and check back for a fix.
This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.
Affected packages
npm @typespec/compiler
- Affected
- <= 1.15.0
- Fixed in
- no fixed version recorded
npm @typespec/openapi3
- Affected
- <= 1.15.0
- Fixed in
- no fixed version recorded
Sources
- GitHub Advisory Database and maintainer security advisories on GitHub
GitHub-reviewed advisory GHSA-2q42-4q24-7rgv lists affected ranges: npm @typespec/openapi3 >=0 =0 <=1.15.0
VerifiedObserved Structured GitHub Advisory Database record (type=reviewed) from the GitHub REST API.
- Open Source Vulnerabilities (OSV.dev), including the GitHub Advisory Database
OSV record GHSA-2q42-4q24-7rgv lists affected ranges: npm @typespec/openapi3 >=0 =0 <=1.15.0
VerifiedObserved Structured OSV record; GitHub-reviewed advisory.
Severity and exploitation
- Exploitation
- No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
- CVSS
- 7.1 · CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H
- EPSS
- No dated EPSS signal available.
Source description
As published by the source; long descriptions are shortened.
Summary The @typespec/openapi3 emitter retains the value of a @versioned enum member and interpolates it into the output filename as {version} without sanitizing path separators or traversal components. The completed path reaches the compiler's emitFile(), which creates the parent directory and writes the file without verifying containment under emitterOutputDir. A crafted declarative .tsp input can therefore create or overwrite an OpenAPI-formatted .yaml or .json file outside the configured output tree, subject to the compiler process's filesystem permissions. No executable TypeSpec extension or attacker-controlled JavaScript is required. Affected version Confirmed on: - @typespec/compiler 1.15.0 - @typespec/openapi3 1.15.0 - @typespec/http 1.15.0 - @typespec/versioning 0.85.0 - release tag commit f30cd352f93997e04c75d48c7ace6947a1d5d07a The critical openapi.ts and emitter-utils.ts blobs are unchanged on main commit 365ec52b50b82cd9e1e037de4c6fcd5de7e32e90 as checked on 2026-08-19.…
Dates and revisions
- Published by the source
- Last modified by the source
- Source last checked
- Revision 3 · amended ·
Amended from ghsa record GHSA-2q42-4q24-7rgv
- Revision 2 · amended ·
Amended from osv record GHSA-2q42-4q24-7rgv
- Revision 1 · created ·
Published from ghsa record GHSA-2q42-4q24-7rgv
Agent brief
Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.
# Patch Next advisory brief: GHSA-2q42-4q24-7rgv Advisory: OpenAPI3 version value escapes `emitterOutputDir` and overwrites YAML/JSON outside the output tree IDs: GHSA-2q42-4q24-7rgv Record: https://patchnext.com/advisories/ghsa-2q42-4q24-7rgv (revision 3, source checked 26 Oct 2026, 13:02 UTC) Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected. Severity: High (CVSS 7.1) Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV. Vendor response: Vendor response not established. A vendor fix does not mean a deployment is fixed. ## Affected components - npm @typespec/compiler: affected <= 1.15.0 - npm @typespec/openapi3: affected <= 1.15.0 ## Suggested inspection (read-only) - `npm ls @typespec/compiler --all`: lists every installed copy and version, including transitive ones. Run in the project root after `npm ci`. - `npm ls @typespec/openapi3 --all`: lists every installed copy and version, including transitive ones. Run in the project root after `npm ci`. ## Supported action No complete vendor fix is recorded. Follow the primary source's mitigation guidance and check this record again before closing anything. ## Required regression checks - Run the test suite and a production build. - Exercise the features that depend on @typespec/compiler, @typespec/openapi3. - Repeat the inspection and confirm that only fixed versions remain installed. ## Rollback considerations - Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward. ## Unresolved questions - Which deployments run an affected version? - Exploitation status can change. Check again before lowering the priority. - Mark the work resolved only after the fixed version is verified in production. ## Sources - Verified: https://github.com/advisories/GHSA-2q42-4q24-7rgv (GitHub-reviewed advisory GHSA-2q42-4q24-7rgv lists affected ranges: npm @typespec/openapi3 >=0 =0 <=1.15.0) - Verified: https://osv.dev/vulnerability/GHSA-2q42-4q24-7rgv (OSV record GHSA-2q42-4q24-7rgv lists affected ranges: npm @typespec/openapi3 >=0 =0 <=1.15.0) Commands are suggestions: review each one before running it.
Loading voting…