summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-08-28 21:11:37 -0400
committerGitHub <noreply@github.com>2024-08-28 21:11:37 -0400
commitc6793f52b9a636b7df130d22b6e87e846245885d (patch)
tree83810f8e4a8a338f3f8a76892bfe3be3e53de107 /tests/unit
parent2afbc1aa39c37b688ea1e0c47161c2fcdefc05ab (diff)
fix(permissions): disallow any `LD_` or `DYLD_` prefixed env var without full --allow-run permissions (#25271)
Follow up to https://github.com/denoland/deno/pull/25221 I looked into what the list was and it was quite extensive, so I think as suggested in https://github.com/denoland/deno/issues/11964#issuecomment-2314585135 we should disallow this for any `LD_` prefixed env var.
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/os_test.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/unit/os_test.ts b/tests/unit/os_test.ts
index 42b598511..9503f75d1 100644
--- a/tests/unit/os_test.ts
+++ b/tests/unit/os_test.ts
@@ -239,6 +239,11 @@ Deno.test(
async function hostnameWithoutOtherNetworkUsages() {
const { stdout } = await new Deno.Command(Deno.execPath(), {
args: ["eval", "-p", "Deno.hostname()"],
+ env: {
+ LD_PRELOAD: "",
+ LD_LIBRARY_PATH: "",
+ DYLD_FALLBACK_LIBRARY_PATH: "",
+ },
}).output();
const hostname = new TextDecoder().decode(stdout).trim();
assert(hostname.length > 0);