CVE-2026-49356: Babel @babel/core Arbitrary Source Map File Read Vulnerability
Babel, a widely used JavaScript compiler, contains a vulnerability that allows attackers to read arbitrary source map files from systems running the compiler. If an attacker can control the JavaScript code being compiled and see the compiler's output, they can craft malicious code containing a sourceMappingURL comment that tricks Babel into exposing source map files they know the path to. This is a low-severity issue because it requires multiple preconditions: the attacker must have input control, output visibility, and knowledge of the exact file path of the target source map.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 3.2 LOW · CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:N/A:N
- Weaknesses (CWE)
- CWE-200, CWE-22
- Affected products
- 29 configuration(s)
- Published / Modified
- 2026-06-22 / 2026-06-26
NVD description (verbatim)
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.
1 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability exists in @babel/core versions prior to 8.0.0-rc.6 and 7.29.6. During compilation, Babel processes sourceMappingURL comments in JavaScript files. An attacker can inject a malicious sourceMappingURL that references an arbitrary file path on the system. If Babel attempts to resolve and read this file as a source map, an attacker with access to the compiler output can infer file contents through observable differences in behavior or error messages. The issue is rooted in insufficient validation of sourceMappingURL paths before file access (CWE-22: Improper Limitation of a Pathname to a Restricted Directory, also known as path traversal) and uncontrolled information disclosure (CWE-200).
Business impact
Organizations using Babel in build pipelines or development environments may inadvertently expose source map contents if untrusted code is compiled. Source maps typically contain unminified source code, variable names, and file structure information that can aid reverse engineering. The risk is primarily relevant in scenarios where external or partially-trusted code is processed through Babel during CI/CD pipelines, though the practical exploitation barrier is high due to the preconditions required.
Affected systems
Babel @babel/core versions before 8.0.0-rc.6 and before 7.29.6 are affected. Any development environment, build system, or continuous integration pipeline that uses these versions to compile JavaScript is in scope. Organizations should inventory their use of Babel across all projects, including transitive dependencies, as Babel is a foundational tool in many JavaScript toolchains.
Exploitability
Exploitation requires three simultaneous conditions: the attacker must control the input source code being compiled, must be able to observe or exfiltrate the compilation output, and must know the exact file system path of the source map to target. This combination of constraints significantly limits real-world exploitation. The vulnerability does not allow unauthenticated remote exploitation and requires local system access or prior compromise of the code supply chain.
Remediation
Update @babel/core to version 8.0.0-rc.6 or later (for the 8.x line) or 7.29.6 or later (for the 7.x line). Verify against the official Babel release notes to confirm patch versions. After patching, rebuild all artifacts to ensure Babel processes code with the fixed compiler.
Patch guidance
Verify your current Babel version using npm list @babel/core or yarn list @babel/core. For npm-based projects, update using npm install --save-dev @babel/core@latest or npm install --save-dev @babel/[email protected] (for v7 projects). For yarn, use yarn upgrade @babel/core. Test your build pipeline thoroughly after updating to ensure compatibility with your project configuration. If you maintain a monorepo or manage multiple projects, prioritize those that compile untrusted or external code.
Detection guidance
Review your package-lock.json or yarn.lock files to identify @babel/core versions in use. Automated dependency scanning tools (npm audit, yarn audit, Snyk) will flag outdated versions. In your build logs, check for any sourceMappingURL resolution errors or unexpected file access attempts during Babel compilation. If you have security monitoring in place, look for file access patterns where Babel reads files outside the expected source directory.
Why prioritize this
While Babel is a ubiquitous tool in the JavaScript ecosystem, the low CVSS score (3.2) reflects the high exploitation friction. Prioritize patching if your organization compiles externally-sourced or user-supplied code, or if source maps contain sensitive intellectual property. For typical projects that only compile internal, trusted code, this is a medium-priority update suitable for the next regular maintenance cycle.
Risk score, explained
The CVSS 3.1 score of 3.2 (LOW) reflects a local attack vector (AV:L), high complexity (AC:H) requiring multiple conditions to align, no privileges needed (PR:N), unchanged scope (S:C), and only confidentiality impact (C:L). The high complexity factor is the primary driver of the low score—exploitation requires attacker control over input, visibility of output, and advance knowledge of file paths, making opportunistic exploitation impractical.
Frequently asked questions
Could this vulnerability be exploited in a typical open-source project?
Unlikely. Open-source projects that compile only their own source code and do not accept untrusted code as input face minimal risk. The vulnerability requires the attacker to control the code being compiled, which is the highest bar to clear in most development scenarios.
What are source maps and why should I care about exposing them?
Source maps are files that map minified or transpiled code back to the original source, used by developers for debugging. They contain unminified source code, variable names, and project structure. Exposing them can aid reverse engineering and may leak proprietary logic or hardcoded secrets if they exist in source code.
Do I need to rotate secrets if I was using a vulnerable version of Babel?
Only if your source maps or compiled output was publicly accessible and an attacker knew the source map file path. If source maps were private and never served to the internet, the risk is significantly lower. Review your build artifact storage and CI/CD logs for any anomalies.
Is this vulnerability exploitable via a JavaScript library I installed?
If you installed a malicious or compromised npm package that includes Babel as a dependency, and that package's build script runs Babel on untrusted input, yes—this could be a supply-chain vector. Audit your dependencies using npm audit and keep Babel updated.
This analysis is based on the official CVE record and Babel project disclosures. No public exploit code is known at this time. Always verify patch version availability against the official Babel repository and release notes before deploying. This vulnerability requires multiple preconditions and is not known to be actively exploited in the wild. For organizations with custom Babel configurations or plugins, conduct testing in a staging environment before deploying patches to production build systems. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-49219MEDIUMImageMagick Policy Bypass via Symlink Path Traversal
- CVE-2026-53571HIGHVite Windows Path Traversal Exposes .env and Certificates
- CVE-2026-10011LOWChrome Skia Cross-Origin Data Leak
- CVE-2026-10264LOWPath Traversal in lharries whatsapp-mcp 0.0.1
- CVE-2026-11459LOWSecureAge CatchPulse Information Disclosure Vulnerability
- CVE-2026-11464LOWJeecgBoot User List Information Disclosure via Salt Parameter
- CVE-2026-12211LOWIntelbras iNVU 7016 FT Path Traversal Vulnerability Analysis
- CVE-2026-45277LOWNextcloud Approval Information Disclosure Vulnerability