Skip to content

Commit c9700ff

Browse files
committed
fix(dlx): prevent post-install scripts from running
Add ignoreScripts: true to Arborist options to prevent install and post-install scripts from running during dlx package installation. This is a security measure to prevent potentially malicious scripts from executing during dependency installation.
1 parent 093d956 commit c9700ff

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/dlx-package.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ async function ensurePackageInstalled(
293293
cache: pacoteCachePath || path.join(packageDir, '.cache'),
294294
// Skip devDependencies (production-only like npx).
295295
omit: ['dev'],
296+
// Skip install/post-install scripts for security.
297+
ignoreScripts: true,
296298
})
297299

298300
await arb.buildIdealTree()

0 commit comments

Comments
 (0)