npm should-i-install Malicious npm packages: Anatomy, Detection gaps and AI's role
DIPTENDU KAR, DERIAN STENGLEIN
whoarewe
Agenda
The Growing Problem
https://socket.dev/blog/2023-npm-retrospective
https://www.sonatype.com/state-of-the-software-supply-chain/introduction
Aug 24 – Sep 24
Aug 24 – Sep 24
This is just a coincidence – I promise I did not do all this just to get this talk accepted.
Why npm?
https://github.blog/security/supply-chain-security/best-practices-to-keep-your-projects-secure-on-github/
is-windows
Attack Vectors: How attackers get in
Random named malicious package
Typosquatting
Typosquatting
The bright side
Dependency confusion
Dependency confusion
Maintainer account takeover
Phishing mail - chalk/debug
Maintainer account takeover
The Payload Tricks: How malware gets delivered
Readable malicious code - nx
Readable malicious code - nx
https://www.stepsecurity.io/blog/supply-chain-security-alert-popular-nx-build-system-package-compromised-with-data-stealing-malware
Minified code - @ctrl/tinycolor (worm)
Minified code - @ctrl/tinycolor (worm)
https://www.stepsecurity.io/blog/ctrl-tinycolor-and-40-npm-packages-compromised
Obfuscated code - debug
No pre install or post install, obfuscated code in index.js
Obfuscated code - debug
Obfuscated code - debug
Bundled Binary – napi-postinstall
Bundled Binary – napi-postinstall
Automation gone wrong
Window of Opportunity/Exposure
NPM Package Published
Hour N
NPM Package Retracted
Hour N+X
Security Advisory Published
Hour N+X+Y
EXPOSURE RISK
Role of AI and deny-by-default
Readable malicious code - nx
Minified Code - worm
Obfuscated Code - debug
Binary – napi-postinstall
Potential issues with full AI analysis
Possible solutions
Derian Diptendu
QUESTIONS?
THANK YOU