installScripts
Rendered from docs/alerts/installScripts.md
installScripts
Flags npm lifecycle scripts that execute automatically during install/uninstall (for example: preinstall, install, postinstall).
Implemented in: src/lib/detection/plugins/install-scripts.ts
Enabled by default: yes
What it means
The package declares one or more lifecycle scripts that will run when a user installs (or uninstalls) the package.
Why it matters
Install scripts can execute arbitrary code on developer machines and CI, and are a common initial execution vector for supply-chain malware.
What to do
- Review the script commands in
package.jsonand ensure they’re expected. - Look for downloads (
curl/wget), shell chaining, or secret access. - During investigation, consider installing with
--ignore-scriptsto prevent execution.
Common fields
filePath:package.jsoncodeSnippet: the offending"postinstall": "..."(or similar) linemetadata.scriptName,metadata.scriptCommand,metadata.suspiciousPatterns