Does npm install --ignore-scripts protect against this attack?
Only partially. Early versions (8.14.0–8.17.0) ran through a preinstall hook that --ignore-scripts blocks entirely. Later versions (8.18.0, 8.20.0) moved the same payload into dist/index.js and dist/bin/jscrambler.js as self-executing functions, which run automatically on import or CLI use regardless of that flag being set.
Answered in
Malware Hid Inside a Popular Obfuscation Tool — and Went Hunting for Your AI Coding Agent's CredentialsStolen npm credentials let attackers slip native-binary malware into jscrambler, hunting for Claude Desktop, Cursor, and Windsurf credentials.
Read the full analysisOther questions this article answers
More development best practices questions
- Why is a large-scale test framework migration usually so slow to do by hand?
- Why did retry loops with error feedback outperform carefully engineered prompts?
- When does a migration pipeline need rich prompt context instead of just retries?
- How do you migrate the last 3% of files that automation can't fully finish?
- Does this approach only work for test framework migrations?
- What is Project Polaris and how does it relate to GitHub Copilot?
- What architecture does Project Polaris use?
- How does Project Polaris perform compared to GPT-4 Turbo on coding benchmarks?
Every answer on Crashtech is written by the editor of the article it comes from — never auto-summarised. Browse all answers or the Development Best Practices beat.