{"id":"JLSEC-2026-110","aliases":["JLSEC-2026-110"],"related":["CVE-2025-48934","GHSA-7w8p-chxq-2789","EUVD-2025-16913"],"kind":"vulnerability","state":"published","title":"Deno.env.toObject() ignores the variables listed in --deny-env and returns all environment variables","summary":"### Summary\n\nThe [Deno.env.toObject](https://docs.deno.com/api/deno/%7E/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\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```\n[Object: null prototype] {\n  ...\n  AWS_SECRET_ACCESS_KEY: \"my-secret-aws-key\",\n  ...\n}\n```\n\n### Impact\n\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.","summaryFormat":"markdown","summarySource":"jlsec","descriptions":[{"lang":"en","text":"### Summary\n\nThe [Deno.env.toObject](https://docs.deno.com/api/deno/%7E/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\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```\n[Object: null prototype] {\n  ...\n  AWS_SECRET_ACCESS_KEY: \"my-secret-aws-key\",\n  ...\n}\n```\n\n### Impact\n\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.","format":"markdown","source":"jlsec"}],"published":"2026-04-14T13:10:46.494Z","modified":"2026-07-18T00:01:28.471Z","severity":{"scorer":"Julia Security Advisories","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"Julia Security Advisories","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"Julia Security Advisories","scheme":"CVSS:4.0","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/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X"}],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.6.3+0"}],"ecosystem":"Julia","package":"Deno_jll","purl":"pkg:julia/Deno_jll?uuid=04572ae6-984a-583e-9378-9577a1c2574d","source":"jlsec"}],"references":[{"url":"https://docs.deno.com/api/deno/~/Deno.Env.toObject","tags":["web"],"sources":["jlsec"]},{"url":"https://docs.deno.com/runtime/fundamentals/security/#environment-variables","tags":["web"],"sources":["jlsec"]},{"url":"https://github.com/advisories/GHSA-7w8p-chxq-2789","tags":["web"],"sources":["jlsec"]},{"url":"https://github.com/denoland/deno/commit/2959e083912420988066a001c2b2d6732a1b562f","tags":["web"],"sources":["jlsec"]},{"url":"https://github.com/denoland/deno/commit/946ccda1aa19a00c478a5e6826b75053b050d753","tags":["web"],"sources":["jlsec"]},{"url":"https://github.com/denoland/deno/pull/29079","tags":["web"],"sources":["jlsec"]},{"url":"https://github.com/denoland/deno/security/advisories/GHSA-7w8p-chxq-2789","tags":["web"],"sources":["jlsec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-48934","tags":["web"],"sources":["jlsec"]}],"credits":["frankvd"],"sources":[{"source":"jlsec","name":"Julia Security Advisories","id":"JLSEC-2026-110","url":"https://osv.dev/vulnerability/JLSEC-2026-110","licence":"CC-BY-4.0","modified":"2026-07-18T00:01:28.471Z"}],"updatedAt":"2026-11-25T22:56:25.862Z"}