The upstream `neural-trader@2.7.1` (and every earlier published version
audited) ships a malicious-by-accident `install` lifecycle script that
recursively invokes `npm install` from inside the install hook. On any
non-`linux-x64` host the recursion is unbounded — one reporter saw 3,049
stuck processes consuming ~120 GB of RAM in ~80 minutes before manual
intervention.
The `plugins/ruflo-neural-trader/README.md` Prerequisites section said
plainly `npm install neural-trader` — running THAT instruction is what
fork-bombs the machine.
We can't patch upstream from this repo, but we can stop telling users
to run the dangerous command. Mitigations:
- README Prerequisites: add a prominent warning advisory + switch
the recommended install to `npm install --ignore-scripts neural-trader`.
The linux-x64 binary is hardcoded inline in the upstream tarball,
so the package still works after `--ignore-scripts` on that platform.
- agents/trading-strategist.md: same `--ignore-scripts` fix on the
"Ensure installed" line that previously fork-bombed if the package
wasn't already cached.
- 6 skill files (trader-backtest/portfolio/regime/risk/signal/train):
same one-liner fix.
- trader-cloud-backtest/SKILL.md: also patch the `npm install -g
neural-trader` line in the Managed-Agent `initScript` — cloud
containers ARE isolated, but the same in-container fork-bomb
amplification is still a problem.
CI guard: `scripts/audit-neural-trader-safety.mjs` scans
`plugins/ruflo-neural-trader/` for any `npm install neural-trader` /
`npm i neural-trader` invocation that doesn't also carry
`--ignore-scripts`. Allowlist: lines preceded by a "DO NOT run" marker
(the README's anti-example block). Wired into the existing
`hook-command-audit` job in `v3-ci.yml`.
Verified:
- audit clean on the fixed tree
- audit catches a deliberately-reverted regression (exit 1, diagnostic
names the offending file:line)
- all other audits + plugin smoke still green
Mitigates #1974 in THIS repo. Upstream fix to the `neural-trader` npm
package (drop the recursive `npm install` in the install hook + publish
the platform-binary optionalDependencies) is still required for the
underlying bug.
Co-authored-by: Reuven <cohen@ruv-mac-mini.local>