You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Missed detection (should have been flagged, wasn't)
Package name and version
Synthetic pattern, no real package. Found during the security audit hardening (#84); listed as a follow-up in ADR-0056.
Expected vs actual verdict
The install-scripts rule recognises a fixed set of interpreters (sh, bash, node, python, and so on), the command word itself, and every operand with a code extension. These forms still execute a package file, but the hook is rated low instead of critical when that file holds a payload:
Lifecycle command
What runs
. ./setup or source setup
setup, sourced into the shell
cat setup | sh
setup, piped into a shell
/usr/bin/env node setup
setup (a pathed wrapper is not recognised as env)
tsx setup or ts-node setup
setup.ts
node .
the file named by main in package.json
The file is still scanned by the other rules, so the payload itself is seen. What is lost is the install-time escalation. Some of these forms were also missed on the base branch.
The pattern
A lifecycle hook runs a package file through a shell builtin, a pipe into an interpreter, a path-qualified wrapper, a TypeScript runner, or Node's directory entry point.
Suggested approach
In packages/core/src/rules/install-scripts.ts:
Treat . and source as interpreters, so their first operand is the script.
When a simple command pipes into an interpreter (cat x | sh, cat x | node), treat the files read by the earlier commands as executed.
Take the basename of a path-qualified command word before checking it against the wrapper and interpreter lists (/usr/bin/env becomes env).
Add tsx, ts-node and bun to the interpreters, resolving .ts and .mts as well.
For node . or node <dir>, resolve that directory's package.jsonmain, then index.js.
Add a synthetic test for each row. Each must be critical with a payload, and stay clean with a benign file.
Activity
fix(core): do not let root candidates hide nested or local executors