CSIRTS // UNIFIED SECURITY ADVISORY FEEDSYS ● ONLINE · POWERED BY INTELFUSIONS.COM

GHSA-968w-xfqw-vp9q: Deno: BYONM module resolution allows `package.json` main path traversal to bypass `--allow-read` restrictions

mediumCVSS 5.5CVE-2026-49406
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: { "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: deno run --no-prompt --all

Details

Source
GitHub Security Advisories (INTL · database · site)
Severity
medium — CVSS 5.5
Published
2026-06-16
Last updated
2026-07-20
Exploitation
Not in CISA KEV at last sync

Original advisory: https://github.com/advisories/GHSA-968w-xfqw-vp9q

Exploitation outlook

EPSS (FIRST.org) estimates each CVE’s probability of exploitation in the next 30 days — here is the CSIRTS.com read on those numbers.

Referenced CVEs

CVECSIRTS overviewExternal
CVE-2026-49406coverage & exploitation statusNVD · CVE.org

More from GitHub Security Advisories