{"id":"CVE-2026-49983","aliases":["CVE-2026-49983","GHSA-4c8g-jvcx-v4hv"],"related":[],"kind":"vulnerability","state":"published","title":"Deno: process.loadEnvFile() bypasses env permission checks and mutates process.env with only read access","summary":"Deno is a JavaScript, TypeScript, and WebAssembly runtime. Prior to 2.8.1, environment access is gated by the env permission. You can deny it with --deny-env, or restrict it to a specific allowlist with --allow-env=FOO,BAR. The expectation is that a program running without env permission cannot change process.env. process.loadEnvFile() (the Node-compatible API for loading variables from a .env file) does not honor this. It only checks that the program has read permission for the dotenv file, then writes every key in that file into the process environment — even when env access is denied. In effect, --allow-read plus a writable or attacker-controlled .env file is enough to defeat --deny-env. This vulnerability is fixed in 2.8.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Deno is a JavaScript, TypeScript, and WebAssembly runtime. Prior to 2.8.1, environment access is gated by the env permission. You can deny it with --deny-env, or restrict it to a specific allowlist with --allow-env=FOO,BAR. The expectation is that a program running without env permission cannot change process.env. process.loadEnvFile() (the Node-compatible API for loading variables from a .env file) does not honor this. It only checks that the program has read permission for the dotenv file, then writes every key in that file into the process environment — even when env access is denied. In effect, --allow-read plus a writable or attacker-controlled .env file is enough to defeat --deny-env. This vulnerability is fixed in 2.8.1.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nIn Deno, environment access is gated by the `env` permission. You can deny it\nwith `--deny-env`, or restrict it to a specific allowlist with\n`--allow-env=FOO,BAR`. The expectation is that a program running without `env`\npermission cannot change `process.env`.\n\n`process.loadEnvFile()` (the Node-compatible API for loading variables from a\n`.env` file) does **not** honor this. It only checks that the program has\n**read** permission for the dotenv file, then writes every key in that file\ninto the process environment — even when `env` access is denied.\n\nIn effect, **`--allow-read` plus a writable or attacker-controlled `.env` file\nis enough to defeat `--deny-env`.**\n\n## Am I affected?\n\nYou are potentially affected if **all** of the following are true:\n\n1. You run Deno **v2.3.0 or newer**.\n2. Your program (or any dependency it imports) calls `process.loadEnvFile()`\n   from `node:process`.\n3. You rely on Deno's permission model — specifically `--deny-env`, an\n   `--allow-env=…` allowlist, or running without granting `env` — as a\n   security boundary.\n4. The `.env` path passed to `loadEnvFile()` can be controlled or modified by\n   a less-trusted party (untrusted input, user-writable directory, third-party\n   dependency, etc.) and is covered by your `--allow-read` grant.\n\nIf your program does not use `process.loadEnvFile()` at all, or if it already\ngrants full `env` access, this advisory does not change your risk.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Deno es un entorno de ejecución de JavaScript, TypeScript y WebAssembly. Antes de la versión 2.8.1, el acceso al entorno está controlado por el permiso env. Se puede denegar con --deny-env, o restringirlo a una lista de permitidos específica con --allow-env=FOO,BAR. La expectativa es que un programa que se ejecuta sin el permiso env no pueda cambiar process.env. process.loadEnvFile() (la API compatible con Node para cargar variables de un archivo .env) no respeta esto. Solo verifica que el programa tenga permiso de lectura para el archivo dotenv, luego escribe cada clave de ese archivo en el entorno del proceso, incluso cuando el acceso env está denegado. En efecto, --allow-read más un archivo .env escribible o controlado por el atacante es suficiente para eludir --deny-env. Esta vulnerabilidad está corregida en la versión 2.8.1.","source":"nvd"}],"published":"2026-06-16T19:04:57.000Z","modified":"2026-10-25T23:10:00.167Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N","score":5.2,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N","score":5.2,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N","score":5.2,"rating":"MEDIUM"}],"cwes":["CWE-863"],"affected":[{"ranges":[{"version":"< 2.8.1","status":"affected"}],"vendor":"denoland","product":"deno","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.8.1"}],"ecosystem":"crates.io","package":"deno","purl":"pkg:cargo/deno","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"2.3.0","fixed":"2.8.1"}],"vendor":"deno","product":"deno","cpe":"cpe:2.3:a:deno:deno:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/denoland/deno/security/advisories/GHSA-4c8g-jvcx-v4hv","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-49983","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/denoland/deno","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-06-23T17:54:45.354Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-49983","url":"https://www.cve.org/CVERecord?id=CVE-2026-49983","licence":"CVE Terms of Use","modified":"2026-06-23T17:54:51.686Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-4c8g-jvcx-v4hv","url":"https://github.com/advisories/GHSA-4c8g-jvcx-v4hv","licence":"CC-BY-4.0","modified":"2026-07-20T21:15:26.008Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-49983","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-49983","licence":"Public domain","modified":"2026-10-25T23:10:00.167Z"}],"updatedAt":"2026-11-25T22:59:25.501Z","epss":{"score":0.00098,"percentile":0.00795,"date":"2026-12-01T12:00:22.000Z"}}