@babel/core: Arbitrary File Read via sourceMappingURL Comment
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/core@7.29.6 and @babel/core@8.0.0-rc.6.
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.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | @babel/core | >= 8.0.0-alpha.0, < 8.0.0-rc.6, < 7.29.6 | 8.0.0-rc.6, 7.29.6 |
References
- CVSS vector
CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:N/A:N- Weakness (CWE)
CWE-200, CWE-22- Platform
- npm
- Package
@babel/core- Disclosed
- 15.06.2026
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-4x5r-pxfx-6jf8 - CC BY 4.0
Vulnerability history: @babel/core
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
This is the only known vulnerability of this package.
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.