Skip to main content
VulnerabilityPublished Updated

@typespec/openapi3 · OpenAPI3 version value escapes `emitterOutputDir` and overwrites YAML/JSON outside the output tree

Affects @typespec/openapi3Source GCVE Database

0

CVSS 7.1 High : upgrade to 1.16.0 soon.

Data as of 1 Dec 2026, 15:33 UTC

CVSS 3.1 base score
7.1High
How severe the flaw is on the 0–10 CVSS scale.
Patch
Available – fixed in 1.16.0
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H

What to do

Upgrade @typespec/openapi3 and @typespec/compiler to 1.16.0.

Affected software

ProductAffectedFixed in
npm@typespec/openapi3Affected
  • <1.16.0
Fixed in
  • 1.16.0
npm@typespec/compilerAffected
  • <1.16.0
Fixed in
  • 1.16.0

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

A patch is available in version 1.16.0 that addresses this vulnerability. The recommended remediation is to validate the fully interpolated output path against the emitterOutputDir and reject any paths that are not descendants. Additionally, sanitize or slugify any absolute paths, path separators, or traversal components in version-derived filename tokens. Users should upgrade to @typespec/openapi3 version 1.16.0 or later to mitigate this issue.

Description

A path traversal vulnerability in the @typespec/openapi3 emitter allows crafted version values to escape the configured output directory and overwrite YAML or JSON files elsewhere on the filesystem. This occurs because the version string is interpolated into output filenames without sanitizing path traversal components. The vulnerability affects versions prior to 1.16.0 and requires no executable code injection, only a maliciously crafted declarative input. The impact is limited to file creation or overwrite within the permissions of the compiler process, with no direct code execution or file disclosure claimed.

References

Community reviews

Loading reviews…