How I got affected by Shai-Hulud in PHP World
A PHP developer shares a firsthand experience of being affected by the Shai-Hulud npm supply chain attack through a Node.js tool (Optic) used in a PHP project's CI pipeline. The attack exploited post-install scripts in infected npm packages to steal credentials. Fortunately, the CI environment lacked sensitive variables, limiting the damage. The post covers how the attack works, why PHP projects are not immune to npm-based threats, and offers a comprehensive set of defense strategies: using --ignore-scripts and minimumReleaseAge options, pinning dependency versions, Docker isolation with SHA256-verified images, minimal CI environment variables, safe-chain proxy, dependency monitoring with Renovate/Dependabot, security audits, and runtime detection tools like Falco, Semgrep, and canary tokens.