CVE-2026-49983

Deno: process.loadEnvFile() bypasses env permission checks and mutates process.env with only read access

Published Jun 23, 2026 CVSS 3.1 · 5.2 Medium EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

This vulnerability allows a Deno program to modify process.env even when the env permission is denied. Prior to 2.8.1, environment access is gated by the env permission, which can be denied with --deny-env or restricted with --allow-env. The loadEnvFile() API checks only for read permission on the .env file; it then writes every key from that file into process.env, regardless of the env permission. Consequently, with --allow-read and a writable or attacker-controlled .env file, an application can bypass --deny-env. The flaw falls under CWE‑863 and was fixed in Deno 2.8.1.

Affected Systems

The affected vendor is Denoland, with the Deno runtime. All Deno releases prior to 2.8.1 are impacted. Users running 2.7 or earlier versions, or any release that has not shipped the 2.8.1 patch, are vulnerable to this bypass.

Risk and Exploitability

The CVSS score of 5.2 reflects a moderate severity. The EPSS score is currently unavailable, and the vulnerability is not listed in the CISA KEV catalog. An attacker who allows the program to read a .env file can place arbitrary keys in that file; with --allow-read and --deny-env enabled, the program will still load these keys, effectively subverting the environment permission controls. The attack requires only read access to the .env file, making it straightforward to exploit within a trusted runtime environment.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Deno to version 2.8.1 or later to apply the vendor fix
  • Restrict the use and location of .env files to trusted sources and avoid giving write permissions to untrusted users
  • When environment access is denied, avoid using process.loadEnvFile and instead load variables through safer mechanisms that respect permission flags

Generated by OpenCVE AI on June 24, 2026 at 10:50 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-4c8g-jvcx-v4hv Deno: process.loadEnvFile() bypasses env permission checks and mutates process.env with only read access
History
Type Values Removed Values Added
First Time appeared Deno
Deno deno
Vendors & Products Deno
Deno deno
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 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.
Title Deno: process.loadEnvFile() bypasses env permission checks and mutates process.env with only read access
Weaknesses CWE-863
References
Metrics cvssV3_1

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

Weaknesses

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jun 23, 2026, 5:54 PM
Reserved
Jun 2, 2026, 6:30 PM
Status
Analyzed
Published
Jun 23, 2026, 6:18 PM
Modified
Oct 25, 2026, 11:10 PM