Spot the bug in plugin loading

from Modules
Node 24 intermediate 4 min 1 issue to find

Find why this request-driven plugin loader has an unsafe module boundary.

JavaScript
export async function loadPlugin(request) {
  const name = new URL(request.url).searchParams.get("plugin");
  const plugin = await import(`./plugins/${name}.js`);
  return plugin.default;
}
Open in playground
Report an error