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
- What did OpenAI’s Habitat team change?
- Does the reported 12× read improvement mean another team should copy the design?
- Does the Python Typing Survey measure all Python developers?
- Do Python type hints enforce types at runtime?
- What is interactive refactoring in gopls?
- Is interactive refactoring already part of the official LSP standard?
- What does Meta mean by human-on-the-loop software engineering?
- Does Meta's Forum project prove that AI can replace a software team?
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.