Deno.env.toObject() ignores the variables listed in --deny-env and returns all environment variables
denoland deno
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| deno crates.io |
|
|
| deno_runtime crates.io |
|
|
denoland deno
| Product | Affected | Fixed in |
|---|---|---|
| deno crates.io |
|
|
| deno_runtime crates.io |
|
|
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.
From the CVE record · GitHub_M
Deno.env.toObject ignores environment variables listed in the deno run --deny-env option. Malicious code running in a Deno application that relies on --deny-env to protect sensitive variables can read those variables and steal secrets.
Check applications using crates.io deno versions below 2.1.13 or 2.2.0 through 2.2.12, or deno_runtime versions below 0.212.0.