Miggo Logo

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

N/A

CVSS Score

Basic Information

EPSS Score
0.12686%
Published
6/4/2025
Updated
6/4/2025
KEV Status
No
Technology
TechnologyRust

Technical Details

CVSS Vector
-
Package NameEcosystemVulnerable VersionsFirst Patched Version
denorust< 2.1.132.1.13
denorust>= 2.2.0, < 2.2.132.2.13
deno_runtimerust< 0.212.00.212.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability allows Deno.env.toObject() to bypass the --deny-env security control, exposing all environment variables even if some are explicitly denied. This occurs when --allow-env is used, even if it's an empty list (which implies allowing access to all variables not explicitly denied).

The root cause lies in the Rust backend, specifically within the check_all method of the UnaryPermission<EnvQueryDescriptor> implementation in runtime/permissions/lib.rs. Before the patch, this function called an internal method check_desc with parameters that did not correctly enforce the deny list when retrieving all environment variables. The provided PoC clearly demonstrates that Deno.env.toObject() returns variables that should have been denied.

The patch (e.g., commit 2959e083912420988066a001c2b2d6732a1b562f) modifies the check_all function by changing the way check_desc is called (from self.check_desc(None, false, None) to self.check_desc(None, true, None)). This change ensures that the deny list is respected during the permission check for Deno.env.toObject().

Therefore, two key functions are identified:

  1. Deno.env.toObject(): The user-facing JavaScript API that exhibits the vulnerable behavior. This is what an attacker would call and what would appear in a JavaScript profiler/stack trace.
  2. deno_runtime::permissions::UnaryPermission<EnvQueryDescriptor>::check_all: The underlying Rust function in the Deno runtime that contained the flawed permission logic. This is where the code fix was applied.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Summ*ry T** [**no.*nv.toO*j**t](*ttps://*o*s.**no.*om/*pi/**no/~/**no.*nv.toO*j**t) m*t*o* i*nor*s *ny v*ri**l*s list** in t** `--**ny-*nv` option o* t** `**no run` *omm*n*. W**n lookin* *t t** [*o*um*nt*tion](*ttps://*o*s.**no.*om/runtim*/*un**m

Reasoning

T** vuln*r**ility *llows `**no.*nv.toO*j**t()` to *yp*ss t** `--**ny-*nv` s**urity *ontrol, *xposin* *ll *nvironm*nt v*ri**l*s *v*n i* som* *r* *xpli*itly **ni**. T*is o**urs w**n `--*llow-*nv` is us**, *v*n i* it's *n *mpty list (w*i** impli*s *llow