Skip to main content

Deno EUVDEUVD-2026-38545

| CVE-2026-49406 MEDIUM
Path Traversal (CWE-22)
2026-06-16 https://github.com/denoland/deno GHSA-968w-xfqw-vp9q
5.5
CVSS 3.1 · Vendor: https://github.com/denoland/deno
View

Attack ChainAIDerived

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

  1. Access
    Attacker plants malicious npm package with path-traversal main field
  2. Delivery
    Victim installs package into BYONM node_modules tree
  3. Exploit
    Victim Deno app calls require('evil-pkg')
  4. Execution
    BYONM resolver joins traversal path, omits --allow-read check
  5. Persist
    Target JSON file parsed and returned to malicious package code
  6. Impact
    Sensitive file contents exfiltrated beyond --allow-read scope

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 three concurrent conditions to be true simultaneously: the target Deno application must be configured with BYONM mode enabled via nodeModulesDir: "manual" in deno.json (non-default; runs without this config are explicitly not affected); the attacker must be able to place or influence a package.json with a path-traversing main field within the project's node_modules directory, which requires either a supply-chain compromise of a dependency or local write access to node_modules; and the target exfiltration file must be a .json file reachable by the OS user running Deno (non-JSON entrypoints trigger code execution within the existing permission set rather than this data-exposure path). Limiting factors include: non-BYONM resolution is unaffected; only .json files are exposed via this vector; the attacker cannot exceed OS-user privilege; and exploitation requires prior supply-chain compromise or local node_modules write access - it cannot be triggered remotely without those prerequisites.

Impact

The vendor-assigned CVSS 3.1 score of 5.5 (AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N) accurately reflects the attack surface: local vector, low complexity once prerequisites are met, low privilege (local user or supply-chain actor with node_modules write access), confidentiality-only impact. No EPSS score was available in the provided data, so exploitation probability cannot be quantified numerically. This CVE is not in the CISA KEV catalog, meaning no confirmed active exploitation has been documented. However, a self-contained proof-of-concept was confirmed by the reporter and is detailed in the GHSA advisory, which elevates this above theoretical. The most significant risk signal is semantic: Deno's core value proposition is its permission sandbox, and this bypass directly undermines the --allow-read guarantee for BYONM users. Practical impact is bounded - only .json files are exposed, only up to OS-user privilege, and only in projects using BYONM mode with untrusted packages - making this a high-priority fix for Deno-native security-sensitive deployments rather than a broadly weaponizable remote vulnerability. CVSS signals and description are fully consistent; no conflicting data is present.

Exploit ScenarioDerived

An attacker publishes or compromises an npm package containing a package.json with a main field set to a path-traversing value such as ../../../.env.json, targeting credential or configuration files outside the Deno project directory. A developer running a BYONM-mode Deno project installs this package and their application calls require("evil-pkg"), causing the Deno resolver to read and parse the targeted JSON file and return its contents to the malicious package's code - even though the same file is correctly blocked when accessed via Deno.readTextFileSync(). A self-contained proof-of-concept demonstrating this exact scenario was supplied by the reporter and is documented in the GitHub Security Advisory.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.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 16, 2026

BYONM module resolution in Deno (≤ 2.7.11) allows path traversal via crafted package.json main fields, bypassing the --allow-read permission sandbox that is central to Deno's security model. A malicious npm package installed under a BYONM node_modules tree can cause require() to read and return the parsed contents of arbitrary JSON files outside the directory scope granted by --allow-read, while a direct Deno.readTextFileSync() call to the same path would be correctly blocked. No active exploitation is confirmed (not in CISA KEV), but a self-contained proof-of-concept was supplied by the reporter and is documented in the GitHub Security Advisory; real-world risk is meaningful in supply-chain scenarios where Deno's permission model is the primary isolation boundary.

RemediationAI

Upgrade to Deno 2.7.12 or later, which patches the BYONM module resolver to constrain resolved entrypoint paths to the package directory and reject .. traversal; this is the vendor-confirmed fix per GHSA-968w-xfqw-vp9q at https://github.com/denoland/deno/security/advisories/GHSA-968w-xfqw-vp9q. For users who cannot immediately upgrade, three workarounds are available with distinct trade-offs: first, disable BYONM mode by removing nodeModulesDir: "manual" from deno.json and switching to Deno's default managed npm resolution, which uses a separate code path that correctly rejects path traversal - this is the most effective workaround but may require restructuring dependency management and is incompatible with projects that depend on BYONM's user-managed tree; second, manually audit all package.json files within node_modules for .. segments in the main field before executing the application, which is operationally burdensome, error-prone at scale, and must be re-performed after any dependency change; third, grant --allow-read without scope restriction only when every file the OS user can access is already acceptable to expose, which eliminates the bypass boundary entirely but surrenders the filesystem isolation that Deno's permission model is designed to provide.

Affected VersionsENISA

deno < 2.7.12

Affected Packages

cargo deno fix: 2.7.12

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in cargo

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

Technical ContextAI · show details

Deno is a Rust-based JavaScript and TypeScript runtime (CPE: pkg:rust/deno) that implements a fine-grained permission system, including --allow-read to restrict filesystem reads to scoped directories. BYONM mode (nodeModulesDir: "manual" in deno.json) is an opt-in configuration allowing Deno to resolve npm packages from a user-managed node_modules directory rather than Deno's default managed resolution. Under this path, the resolver reads each package's package.json, extracts the main field, and joins it to the package directory to locate the entrypoint. The root cause is CWE-22 (Path Traversal): the BYONM permission checker only verified the presence of a node_modules component in the path string and did not reject or canonicalize .. segments, so a main value of ../../../secret.json escaped the package root entirely. Because JSON entrypoints are parsed and their contents returned through require(), the traversal specifically exposed .json file contents to requiring code - a distinct exposure path from the filesystem APIs, which correctly enforced the allowlist. Non-JSON entrypoints (.js, .cjs, .mjs) caused code execution within the granted permission set rather than this data-exfiltration vector.

Know when Node.js gets its next vulnerability

  • 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

Vendor (https://github.com/denoland/deno) PRIMARY 5.5 MEDIUM
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
vuln.today AI 5.5 MEDIUM

AV:L because the attacker must write to local node_modules; PR:L for local user or supply-chain actor; C:H for arbitrary JSON file exposure; I:N and A:N as no write or availability impact exists.

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

Primary rating from Vendor (https://github.com/denoland/deno).

CVSS VectorVendor: https://github.com/denoland/deno

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

DescriptionCVE.org

Summary

When Deno was run in BYONM mode (nodeModulesDir: "manual"), the module resolver did not validate that a package's resolved entrypoint stayed within its node_modules/<pkg>/ directory. A malicious package.json whose main field contained .. segments was able to resolve to an arbitrary path on disk, and the resolver then read that file without consulting the --allow-read allowlist. This let a require("evil-pkg") call return the contents of a file that a direct Deno.readTextFileSync(...) call would have been blocked from reading.

Details

In BYONM mode, Deno resolved npm packages directly from a user-managed node_modules tree. Resolution of require("pkg") proceeded by reading pkg/package.json, taking the main field, joining it to the package directory, and loading the result as a module.

The path joined from main was not constrained to the package root. A package.json such as:

json
{ "main": "../../../secret.json" }

resolved to node_modules/pkg/../../../secret.json, escaping node_modules entirely. The BYONM permission check accepted any path that contained a node_modules component and did not reject .. traversal, so the resolved path was loaded without a read-permission check.

Because resolution loaded JSON entrypoints by parsing their contents and returning them through require, this exposed the contents of arbitrary .json files reachable by the OS user to the requiring code, even when --allow-read had been narrowed to a specific directory.

The same file accessed via Deno.readTextFileSync was correctly blocked. The bug was that module resolution did not enforce the same read-permission boundary that the filesystem APIs enforced.

Proof of concept

The reporter supplied a self-contained PoC. Layout:

/tmp/deno_byonm_poc/
├── app/
│   ├── deno.json            (BYONM enabled)
│   ├── exploit.ts           (require("evil-pkg"))
│   └── node_modules/
│       └── evil-pkg/
│           └── package.json (main: "../../../secret.json")
└── secret.json              (outside --allow-read scope)

Run:

bash
deno run --no-prompt --allow-read=/tmp/deno_byonm_poc/app exploit.ts

Observed:

  • Deno.readTextFileSync("/tmp/deno_byonm_poc/secret.json") - blocked, as

expected.

  • require("evil-pkg") - returned the parsed contents of secret.json,

bypassing the read allowlist.

A control run with BYONM disabled (--no-config) blocked the require call.

Impact

The vulnerability allowed a hostile npm package installed under a BYONM node_modules to read JSON files outside the directories granted via --allow-read, up to the privileges of the OS user running Deno. In practice this exposed configuration and credential files (.env.json, cloud credentials, package lockfiles, etc.) that the user had deliberately excluded from the read scope.

The vulnerability did not grant any capability beyond what the OS user already held, did not affect runs that granted unrestricted --allow-read, and required the user to have installed and then required a hostile package, i.e. an existing supply-chain compromise. The reason it warranted a security advisory rather than a routine bug fix is that Deno's permission model promised that --allow-read=<scope> was a hard boundary *even over untrusted npm code*, and that promise was broken.

Not affected:

  • Runs without BYONM (default npm resolution went through a separate code

path that rejected the traversal).

  • Runs with full --allow-read (no boundary to bypass).
  • Non-JSON entrypoints, in practice - .js/.cjs/.mjs targets executed

rather than exposing file contents, which already implied attacker code execution within the granted permission set.

Workarounds

Users on unpatched versions could mitigate by:

  • Avoiding BYONM mode (nodeModulesDir: "manual") for projects that depended

on untrusted packages.

  • Auditing package.json main fields in node_modules for .. segments

before running.

  • Granting --allow-read only when the read scope already covered every file

the OS user could see (in which case there was no boundary to bypass and no additional exposure).

Threat Intelligence Overview

EPSS Score
0.1%
Top 97% exploitable
Threat Intel
1
1 source
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA 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 MEDIUM
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.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
Scheduled
Exploitation
Poc
System Exposure· derived
Small
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

28
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +28
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.

CVE-2025-68613 HIGH POC
8.8 Dec 19

Remote code execution in n8n's workflow expression evaluation system allows an authenticated user with workflow creation

CVE-2024-41713 CRITICAL POC
9.1 Oct 21

A vulnerability in the NuPoint Unified Messaging (NPM) component of Mitel MiCollab through 9.8 SP1 FP2 (9.8.1.201) could

CVE-2024-55591 CRITICAL POC
9.8 Jan 14

FortiOS and FortiProxy contain an authentication bypass via the Node.js websocket module allowing unauthenticated remote

CVE-2023-44487 HIGH POC
7.5 Oct 10

Denial of service against HTTP/2 server implementations allows remote unauthenticated attackers to exhaust server resour

CVE-2014-7205 CRITICAL POC
10.0 Oct 08

Eval injection vulnerability in the internals.batch function in lib/batch.js in the bassmaster plugin before 1.5.2 for t

CVE-2025-59528 CRITICAL POC
10.0 Sep 22

Flowise version 3.0.5 contains a remote code execution vulnerability in the CustomMCP node. The mcpServerConfig paramete

CVE-2017-14849 HIGH POC
7.5 Sep 28

Node.js 8.5.0 before 8.6.0 allows remote attackers to access unintended files, because a change to ".." handling was inc

CVE-2017-5941 CRITICAL POC
9.8 Feb 09

An issue was discovered in the node-serialize package 0.0.4 for Node.js. Rated critical severity (CVSS 9.8), this vulner

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2014-3744 HIGH POC
7.5 Oct 23

Directory traversal vulnerability in the st module before 0.2.5 for Node.js allows remote attackers to read arbitrary fi

CVE-2014-9566 HIGH POC
7.5 Mar 10

Multiple SQL injection vulnerabilities in the Manage Accounts page in the AccountManagement.asmx service in the Solarwin

CVE-2024-35286 CRITICAL POC
9.8 Oct 21

A vulnerability in NuPoint Messenger (NPM) of Mitel MiCollab through 9.8.0.33 allows an unauthenticated attacker to cond

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