CVE-2026-49356

Babel: Arbitrary File Read via sourceMappingURL Comment in @babel/core

Published Jun 22, 2026 CVSS 3.1 · 3.2 Low EPSS < 1% KEV · Not listed
Description
Babel is a compiler for writing next generation JavaScript. Prior to 8.0.0-rc.6 and 7.29.6, @babel/core affected by an arbitrary file read via a sourceMappingURL comment. Using @babel/core to compile maliciously crafted code can allow an attacker to read any source map from the system that is running Babel, if the attacker controls the input source code, can read the output source code, and knows the path of the source map file that they want to read. This vulnerability is fixed in 8.0.0-rc.6 and 7.29.6.

Analysis

AI-generated

Technical impact

The vulnerability lies in the handling of a sourceMappingURL comment by @babel/core. Injecting a specially crafted comment allows a code consumer who controls the input source text to trigger Babel to read any source map file that is present on the host system, provided the path of the desired file is known. This results in an information‑exposure flaw, potentially revealing source map contents that may contain source code or configuration data. The weaknesses underlying the issue correspond to information exposure (CWE-200) and path traversal (CWE-22), and the impact is limited to reading the contents of arbitrary files on the system.

Affected Systems

Vendors and products affected are Babel’s @babel/core compiler. All versions prior to 8.0.0-rc.6 and 7.29.6 are vulnerable; the problem is fixed in 8.0.0-rc.6 and 7.29.6 and later releases.

Risk and Exploitability

The CVSS score of 3.2 indicates a low severity assessment; no EPSS score is provided, and the vulnerability is not listed in CISA KEV. The exploit requires that an attacker can supply input source code that is processed by a running instance of Babel, which is typically a local or trusted‑code scenario. Based on the description, it is inferred that an attacker without network access would need to obtain execution privileges on the host executing Babel to supply malicious code. The low CVSS score reflects that the primary consequence is confidential data exposure via file reads, rather than code execution or denial of service.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade @babel/core to 7.29.6 or later, or 8.0.0-rc.6 or later.
  • If an upgrade is not possible, sanitize or strip sourceMappingURL comments from any code before it is processed by Babel.
  • Disable source‑map generation or store source maps in a directory that is inaccessible to the process running the compiler.

Generated by OpenCVE AI on June 22, 2026 at 18:24 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-4x5r-pxfx-6jf8 @babel/core: Arbitrary File Read via sourceMappingURL Comment
History
Type Values Removed Values Added
First Time appeared Babel
Babel babel
Vendors & Products Babel
Babel babel
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description Babel is a compiler for writing next generation JavaScript. Prior to 8.0.0-rc.6 and 7.29.6, @babel/core affected by an arbitrary file read via a sourceMappingURL comment. Using @babel/core to compile maliciously crafted code can allow an attacker to read any source map from the system that is running Babel, if the attacker controls the input source code, can read the output source code, and knows the path of the source map file that they want to read. This vulnerability is fixed in 8.0.0-rc.6 and 7.29.6.
Title Babel: Arbitrary File Read via sourceMappingURL Comment in @babel/core
Weaknesses CWE-200
CWE-22
References
Metrics cvssV3_1

{'score': 3.2, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:N/A:N'}

Weaknesses
  • CWE-200

    Exposure of Sensitive Information to an Unauthorized Actor

  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jun 22, 2026, 5:23 PM
Reserved
May 29, 2026, 2:35 PM
Status
Analyzed
Published
Jun 22, 2026, 6:16 PM
Modified
Jun 26, 2026, 8:04 PM
Severity
Low
Public date
Jun 22, 2026, 4:07 PM