GitHub Advisoryadvisory · npm

GHSA-4x5r-pxfx-6jf8 @babel/core: Arbitrary File Read via sourceMappingURL Comment

LOW Published 2026-06-15 Modified 2026-07-15 Official page ↗
Aliases
CVE-2026-49356
Ecosystem
npm
Packages
@babel/core
Severity
Low
CVSS vector
CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:N/A:N
Weaknesses
CWE-200, CWE-22
Reviewed
2026-06-15

Affected packages

• npm @babel/core: >= 8.0.0-alpha.0, < 8.0.0-rc.6 → fixed in 8.0.0-rc.6 • npm @babel/core: < 7.29.6 → fixed in 7.29.6

Description

Impact Using `@babel/core` to compile maliciously crafted code can allow ab attacker to read any source map from the system that is running Babel, if these conditions are _all_ true: • the attacker controls the input source code • the attacker can read the output source code • the attacker knows the path of the source map file that they want to read Users that only compile trusted code are not impacted. Patches The vulnerability has been fixed in `@babel/[email protected]` and `@babel/[email protected]`. Workarounds Callers can mitigate the issue without upgrading by setting `inputSourceMap: false` in their Babel options. Callers can also manually extract the `#sourceMappingURL` comment from the input source code, validate whether the source map that it links to is allowed to be read, and if it is pass an object to `inputSourceMap` (passing `false` when it's not). Credits Thanks Teodor-Cristian Radoi for reporting the vulnerability.

Related

Alias · CVE (1)

  • CVE-2026-49356 Babel is a compiler for writing next generation JavaScript. vulnerability

Weakness · CWE (2)

  • CWE-200 Exposure of Sensitive Information to an Unauthorized Actor weakness
  • CWE-22 Improper Limitation of a Pathname to a Restricted Directory weakness

References