mirror of
https://github.com/denoland/deno.git
synced 2025-02-22 13:13:32 -05:00

A security feature of JSR is that it is self contained other than npm dependencies. At publish time, the registry rejects packages that write code like this: ```ts const data = await import("https://example.com/evil.js"); ``` However, this can be trivially bypassed by writing code that the registry cannot statically analyze for. This PR prevents Deno from loading dynamic imports that do this.
5 lines
117 B
TypeScript
5 lines
117 B
TypeScript
function nonAnalyzableUrl() {
|
|
return "http://localhost:4545/" + "welcome.ts";
|
|
}
|
|
|
|
await import(nonAnalyzableUrl());
|