CVE-2026-49983: Deno Process.loadEnvFile() Bypasses Env Permission Checks Vulnerability

MODERATE
Advisory Identifier: GHSA-4c8g-jvcx-v4hv
CVSS 5.2
CWE-863
Published
Advisory Summary

CVE-2026-49983 is a MODERATE (CVSS 5.2) process.loadenvfile() bypasses env permission checks vulnerability (CWE-863: Incorrect Authorization) affecting Deno libraries in the crates.io ecosystem. The issue involves process.loadenvfile() bypasses env permission checks and mutates process.env with only read access. Remediation is available by upgrading affected packages to version 2.8.1.

CVE-2026-49983 at a Glance

CVE Identifier CVE-2026-49983
GHSA Identifier GHSA-4c8g-jvcx-v4hv
Severity MODERATE
CVSS v3.1 Base Score 5.2
CWE Classification CWE-863: Incorrect Authorization
Affected Product Deno
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 5.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-49983

To remediate this vulnerability, upgrade all affected Deno dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

deno fixed: 2.8.1
Upgrade deno to 2.8.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for deno

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-49983, inspect your project dependencies for Deno:

inspect dependencies for deno

Analyze the terminal output to locate any version of Deno in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.8.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In Deno, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary In Deno, 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`.** ## Am I affected? You are potentially affected if **all** of the following are true: 1. You run Deno **v2.3.0 or newer**. 2. Your program (or any dependency it imports) calls `process.loadEnvFile()` from `node:process`. 3. You rely on Deno's permission model — specifically `--deny-env`, an `--allow-env=…` allowlist, or running without granting `env` — as a security boundary. 4. The `.env` path passed to `loadEnvFile()` can be controlled or modified by a less-trusted party (untrusted input, user-writable directory, third-party dependency, etc.) and is covered by your `--allow-read` grant. If your program does not use `process.loadEnvFile()` at all, or if it already grants full `env` access, this advisory does not change your risk.

CVE-2026-49983 Affected Deno Versions

1 component(s)
Fixed Versions:
2.8.1
Product / Package Ecosystem Affected Versions Fixed Version
deno
crates.io
< 2.8.1
2.8.1

References

Frequently Asked Questions

What is CVE-2026-49983?
CVE-2026-49983 is a security vulnerability in Deno involving process.loadEnvFile() bypasses env permission checks and mutates process.env with only read access under CWE-863: Incorrect Authorization.
Which Deno versions are affected?
Affected versions include releases prior to 2.8.1 across affected packages: deno.
What version fixes CVE-2026-49983?
Upgrading to 2.8.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is deno affected?
Yes, deno is affected in releases prior to 2.8.1. Upgrade your dependency to 2.8.1 or later.
What is the CVSS score of CVE-2026-49983?
CVE-2026-49983 has a CVSS v3.1 base score of 5.2 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2026-49983?
CVE-2026-49983 is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check crates.io dependencies for CVE-2026-49983?
Run the dependency tree command: 'inspect dependencies for deno'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4c8g-jvcx-v4hv",
  "modified" : "2026-07-20T21:01:23Z",
  "published" : "2026-06-16T19:04:57Z",
  "aliases" : [ "CVE-2026-49983" ],
  "summary" : "Deno: process.loadEnvFile() bypasses env permission checks and mutates process.env with only read access",
  "details" : "## 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "deno"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.8.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.8.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/denoland/deno/security/advisories/GHSA-4c8g-jvcx-v4hv"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-49983"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/denoland/deno"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-16T19:04:57Z",
    "nvd_published_at" : "2026-06-23T18:18:04Z"
  }
}