Skip to main content

@babel/core CVE-2026-49356

| EUVDEUVD-2026-38302 LOW
Path Traversal (CWE-22)
2026-06-15 https://github.com/babel/babel GHSA-4x5r-pxfx-6jf8
3.6
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit JS source with crafted #sourceMappingURL pointing to target file
  2. Delivery
    Babel resolves path and reads target .map file from host filesystem
  3. Exploit
    File contents embedded into Babel compilation output
  4. Execution
    Attacker reads build output or artifact
  5. Impact
    Target file contents exfiltrated

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires all three of the following conditions to be simultaneously true: (1) the attacker controls the content of the source code being compiled by @babel/core - this is the enabling condition and excludes all deployments that only compile internally authored, trusted code; (2) the attacker can read the output produced by Babel after compilation - this limits exploitation to scenarios where build artifacts, transpiled output, or logs are accessible to the attacker; (3) the attacker knows or can guess the absolute or relative path of the source map file they wish to read on the host system. Exploitation is also limited to files that the Babel process has read permissions for on the host filesystem. The inputSourceMap option must not have been explicitly set to false in the Babel configuration - the default behavior of following #sourceMappingURL comments is what creates the attack surface. Deployments that only compile trusted, internally controlled source code are explicitly not impacted.

Impact

The CVSS base score of 3.2 (Low) reflects a tightly constrained exploitation scenario: AV:L indicates the original assessment treats this as a local-vector attack, AC:H captures the high complexity due to three simultaneous conditions, S:C (Scope Changed) recognizes that Babel reads files outside its own data scope, and C:L reflects limited confidentiality impact. However, in real-world deployments where Babel compiles externally submitted or user-provided code - a common scenario in CI/CD systems accepting pull requests, online JavaScript playgrounds, or multi-tenant transpilation services - the effective attack vector is closer to network-accessible, making the practical risk materially higher than the raw score suggests. No EPSS data was provided in the input, and the vulnerability is not listed in CISA KEV, indicating no confirmed active exploitation. No public proof-of-concept is identified. The three-condition requirement (attacker controls input, attacker can read output, attacker knows the target path) meaningfully limits opportunistic exploitation, but in targeted scenarios - such as a malicious open-source contributor submitting code to a CI pipeline - all three conditions can plausibly be satisfied simultaneously. Teams running Babel against trusted-only code are explicitly not impacted per the vendor advisory.

Exploit ScenarioDerived

A malicious contributor submits a pull request to an open-source project whose CI pipeline compiles JavaScript using @babel/core. The submitted file contains a crafted #sourceMappingURL comment pointing to a sensitive file path on the CI runner - for example, an SSH private key stored as a .map-extension file, or a JSON configuration file with credentials. Babel resolves the path, reads the file, and embeds its contents in the compilation output; the attacker then reads the CI artifact or build log where the output is stored, recovering the file contents. No public proof-of-concept has been identified, but the attack requires no special tooling beyond a crafted source file.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 15, 2026

Arbitrary source map file read in @babel/core allows an attacker who controls Babel's input source code to exfiltrate any source map file (.map) accessible to the process running Babel, provided the attacker can also read the compilation output and knows the target file path. This affects all @babel/core versions up to and including 7.29.0 and the 8.0.0 alpha/rc series prior to 8.0.0-rc.6. No public exploit is identified at time of analysis, and exploitation is constrained by three simultaneous conditions, but the vulnerability is significant in environments that compile untrusted or externally submitted code - such as online transpilers, CI/CD pipelines accepting external PRs, or multi-tenant build services.

RemediationAI

The primary fix is to upgrade @babel/core to version 7.29.6 (for the stable 7.x series) or 8.0.0-rc.6 (for the 8.x pre-release series), as confirmed by the vendor advisory at https://github.com/babel/babel/security/advisories/GHSA-4x5r-pxfx-6jf8. For teams unable to upgrade immediately, the vendor provides two workarounds: the simplest is to set inputSourceMap: false in Babel configuration options, which prevents Babel from resolving any #sourceMappingURL hints and eliminates the attack vector entirely - the trade-off is that source map chaining for compiled output will not function, which may affect debugging workflows. A more surgical workaround is to pre-process the input source code before passing it to Babel: extract the #sourceMappingURL comment, validate that the referenced path is within an allowlisted set of locations, pass the validated source map as an object to the inputSourceMap option if allowed, or pass false if the path is not permitted. This preserves source map functionality for trusted inputs while blocking exploitation, but requires careful implementation to avoid incomplete validation. Reference for the inputSourceMap option: https://babeljs.io/docs/options#inputsourcemap.

Affected VersionsENISA

Babel < 7.29.6
Babel 8.0.0-alpha.0, < 8.0.0-rc.5

Affected Packages

npm @babel/core fix: 7.29.6, 8.0.0-rc.6
euvd babel fix: 7.29.6
euvd babel_8_0_0_alpha_0 fix: 8.0.0-rc.5

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 3 packages in npm, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The JavaScript ecosystem convention of embedding a #sourceMappingURL comment in source files allows debuggers and build tools to locate corresponding source maps. When @babel/core processes input source code containing this comment, it attempts to resolve and read the referenced source map file to preserve debug information across compilation steps - this is controlled by the inputSourceMap option, which defaults to following the #sourceMappingURL hint. CWE-22 (Path Traversal) applies here because Babel does not sufficiently restrict or validate the path embedded in the #sourceMappingURL comment, allowing a crafted comment to point to an arbitrary file path on the host filesystem. Because source map files conventionally use the .map extension and are JSON, the attacker is limited to reading files that Babel can interpret as source maps, but given that the path is attacker-controlled, any file with a path the attacker knows can potentially be targeted. The affected packages are pkg:npm/@babel_core versions <= 7.29.0 and >= 8.0.0-alpha.0 through < 8.0.0-rc.6.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

NVD PRIMARY 3.6 LOW
AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N
vuln.today AI 4.0 MEDIUM

AV:N reflects realistic deployment as a build service compiling external code; AC:H captures three simultaneous exploitation conditions; C:L for limited source map file read only.

3.1 AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:N/A:N
4.0 AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
None
Availability
None

Lifecycle Timeline

1
CVSS changed
Jun 26, 2026 - 20:07 NVD
3.2 (LOW) 3.6 (LOW)

DescriptionNVD

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.

Threat Intelligence Overview

EPSS Score
0.1%
Top 98% exploitable
Threat Intel
1
1 sources
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA MSRC GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity LOW
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact· derived
Low
Technical Impact
Partial

Priority Score

18
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +18
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy