An install script is code that runs automatically when a package is installed. In ecosystems like npm, it is often used for setup tasks such as compiling native modules, generating files, or preparing a build environment. Because it executes at install time, it can act before a user even starts the application.
Install scripts matter in cyber security because they create a trusted execution path inside software supply chains. A malicious or compromised dependency can use an install script to run unwanted commands on a developer workstation, build server, or CI system. Defenders reduce this risk by reviewing dependencies, limiting which packages may run install-time code, and using package manager settings that require explicit approval. Treating install scripts as a trust decision helps prevent hidden code execution during routine package installation.


