Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-7w8p-chxq-2789

Опубликовано: 04 июн. 2025
Источник: github
Github: Прошло ревью
CVSS4: 5.5
CVSS3: 5.3

Описание

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

Summary

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.

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.

Пакеты

Наименование

deno

rust
Затронутые версииВерсия исправления

< 2.1.13

2.1.13

Наименование

deno

rust
Затронутые версииВерсия исправления

>= 2.2.0, < 2.2.13

2.2.13

Наименование

deno_runtime

rust
Затронутые версииВерсия исправления

< 0.212.0

0.212.0

EPSS

Процентиль: 20%
0.00063
Низкий

5.5 Medium

CVSS4

5.3 Medium

CVSS3

Дефекты

CWE-201

Связанные уязвимости

CVSS3: 5.3
nvd
8 месяцев назад

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.

EPSS

Процентиль: 20%
0.00063
Низкий

5.5 Medium

CVSS4

5.3 Medium

CVSS3

Дефекты

CWE-201