CVE-2025-48934: Deno Deno.env.toObject() Ignores The Variables Listed Vulnerability

MODERATE
Advisory Identifier: GHSA-7w8p-chxq-2789
CVSS 5.3
CWE-201
Published
Advisory Summary

CVE-2025-48934 is a MODERATE (CVSS 5.3) deno.env.toobject() ignores the variables listed vulnerability (CWE-201: Insertion of Sensitive Information Into Sent Data) affecting Deno libraries in the crates.io ecosystem. The issue involves deno.env.toobject() ignores the variables listed in --deny-env and returns all environment variables. Remediation is available by upgrading affected packages to version 2.1.13, 2.2.13, 0.212.0.

CVE-2025-48934 at a Glance

CVE Identifier CVE-2025-48934
GHSA Identifier GHSA-7w8p-chxq-2789
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-201: Insertion of Sensitive Information Into Sent Data
Affected Product Deno
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 5.3

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

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

How to Fix CVE-2025-48934

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.1.13
Upgrade deno to 2.1.13
deno fixed: 2.2.13
Upgrade deno to 2.2.13
deno_runtime fixed: 0.212.0
Upgrade deno_runtime to 0.212.0
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-2025-48934, 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.1.13), 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-201: Insertion of Sensitive Information Into Sent Data, where the code transmits data to another actor, but a portion of the data includes sensitive information that should not be accessible to that actor. 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 The [Deno.env.toObject](https://docs.deno.com/api/deno/~/Deno.Env.toObject) method ignores any variables listed in the `--deny-env` option of the `deno run` command. When looking at the [documentation](https://docs.deno.com/runtime/fundamentals/security/#environment-variables) of the `--deny-env` option this might lead to a false impression that variables listed in the option are impossible to read. ### PoC ``` export AWS_SECRET_ACCESS_KEY=my-secret-aws-key # Works as expected. The program stops with a "NotCapable" error message echo 'console.log(Deno.env.get("AWS_SECRET_ACCESS_KEY"));' | deno run \ --allow-env \ --deny-env=AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY - # All enviroment variables are printed and the --deny-env list is completely disregarded echo 'console.log(Deno.env.toObject());' | deno run \ --allow-env \ --deny-env=AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY - ``` The first example using `get` exits with the following error: ``` error: Uncaught (in promise) NotCapable: Requires env access to "AWS_SECRET_ACCESS_KEY", run again with the --allow-env flag console.log(Deno.env.get("AWS_SECRET_ACCESS_KEY")); ^ at Object.getEnv [as get] (ext:deno_os/30_os.js:124:10) at file:///$deno$stdin.mts:1:22 ``` The second example using `toObject` prints all environment variables: ``` [Object: null prototype] { ... AWS_SECRET_ACCESS_KEY: "my-secret-aws-key", ... } ``` ### Impact Software relying on the combination of both flags to allow access to most environment variables except a few sensitive ones will be vulnerable to malicious code trying to steal secrets using the Deno.env.toObject() method.

CVE-2025-48934 Affected Deno Versions

3 component(s)
Fixed Versions:
2.1.132.2.130.212.0
Product / Package Ecosystem Affected Versions Fixed Version
deno
crates.io
< 2.1.13
2.1.13
deno
crates.io
≥ 2.2.0
< 2.2.13
2.2.13
deno_runtime
crates.io
< 0.212.0
0.212.0

References

Frequently Asked Questions

What is CVE-2025-48934?
CVE-2025-48934 is a security vulnerability in Deno involving Deno.env.toObject() ignores the variables listed in --deny-env and returns all environment variables under CWE-201: Insertion of Sensitive Information Into Sent Data.
Which Deno versions are affected?
Affected versions include releases prior to 2.1.13, 2.2.13, 0.212.0 across affected packages: deno, deno_runtime.
What version fixes CVE-2025-48934?
Upgrading to 2.1.13, 2.2.13, 0.212.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is deno affected?
Yes, deno is affected in releases prior to 2.1.13, 2.2.13. Upgrade your dependency to 2.1.13, 2.2.13 or later.
Is deno_runtime affected?
Yes, deno_runtime is affected in releases prior to 0.212.0. Upgrade your dependency to 0.212.0 or later.
What is the CVSS score of CVE-2025-48934?
CVE-2025-48934 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2025-48934?
CVE-2025-48934 is classified under CWE-201: Insertion of Sensitive Information Into Sent Data (The code transmits data to another actor, but a portion of the data includes sensitive information that should not be accessible to that actor.).
How can I check crates.io dependencies for CVE-2025-48934?
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-7w8p-chxq-2789",
  "modified" : "2025-07-02T18:31:08Z",
  "published" : "2025-06-04T21:18:18Z",
  "aliases" : [ "CVE-2025-48934" ],
  "summary" : "Deno.env.toObject() ignores the variables listed in --deny-env and returns all environment variables",
  "details" : "### Summary\nThe [Deno.env.toObject](https://docs.deno.com/api/deno/~/Deno.Env.toObject) method ignores any variables listed in the `--deny-env` option of the `deno run` command. When looking at the [documentation](https://docs.deno.com/runtime/fundamentals/security/#environment-variables) of the `--deny-env` option this might lead to a false impression that variables listed in the option are impossible to read.\n\n### PoC\n\n```\nexport AWS_SECRET_ACCESS_KEY=my-secret-aws-key\n\n# Works as expected. The program stops with a \"NotCapable\" error message\necho 'console.log(Deno.env.get(\"AWS_SECRET_ACCESS_KEY\"));' | deno run \\\n  --allow-env \\\n  --deny-env=AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY -\n\n# All enviroment variables are printed and the --deny-env list is completely disregarded\necho 'console.log(Deno.env.toObject());' | deno run \\\n  --allow-env \\\n  --deny-env=AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY -\n```\n\nThe first example using `get` exits with the following error:\n```\nerror: Uncaught (in promise) NotCapable: Requires env access to \"AWS_SECRET_ACCESS_KEY\", run again with the --allow-env flag\nconsole.log(Deno.env.get(\"AWS_SECRET_ACCESS_KEY\"));\n                     ^\n    at Object.getEnv [as get] (ext:deno_os/30_os.js:124:10)\n    at file:///$deno$stdin.mts:1:22\n```\n\nThe second example  using `toObject` prints all environment variables:\n```\n[Object: null prototype] {\n  ...\n  AWS_SECRET_ACCESS_KEY: \"my-secret-aws-key\",\n  ...\n}\n```\n\n### Impact\nSoftware relying on the combination of both flags to allow access to most environment variables except a few sensitive ones will be vulnerable to malicious code trying to steal secrets using the Deno.env.toObject() method.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "deno"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.1.13"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "deno"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.2.0"
      }, {
        "fixed" : "2.2.13"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "deno_runtime"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.212.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/denoland/deno/security/advisories/GHSA-7w8p-chxq-2789"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-48934"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/denoland/deno/pull/29079"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/denoland/deno/commit/2959e083912420988066a001c2b2d6732a1b562f"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/denoland/deno/commit/946ccda1aa19a00c478a5e6826b75053b050d753"
  }, {
    "type" : "WEB",
    "url" : "https://docs.deno.com/api/deno/~/Deno.Env.toObject"
  }, {
    "type" : "WEB",
    "url" : "https://docs.deno.com/runtime/fundamentals/security/#environment-variables"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/denoland/deno"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-201" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-06-04T21:18:18Z",
    "nvd_published_at" : "2025-06-04T20:15:24Z"
  }
}