September 8, 2025 – By ParisNeo (Creator of Lollms and lollms-vs-extension)
Today marked a dark day for the JavaScript ecosystem. As I write this at 11:11 PM CEST, the dust is still settling from what security experts are already calling the largest supply chain attack in npm history. As the developer behind the Lollms AI framework and the lollms-vs-extension, I found myself on the front lines of this crisis—not by choice, but by circumstance.
This is the story of how I survived a cyber attack that compromised 18 foundational npm packages with over 2.6 billion weekly downloads, and how it led to the creation of a security tool that I hope will help other developers protect themselves from similar threats.
The Attack: A Perfect Storm 🌩️
What Happened
At approximately 1:16 PM UTC on September 8, 2025, the JavaScript ecosystem came under unprecedented assault. The attackers had successfully compromised the npm account of Josh Junon (GitHub handle: @Qix-), a prolific maintainer responsible for over 80 npm packages that collectively power millions of applications worldwide.
The attack vector was devastatingly simple yet effective: a sophisticated phishing email that appeared to come from support@npmjs.help
(notice the .help
instead of .com
). The email warned Josh that his account would be locked if he didn’t update his two-factor authentication by September 10th. In a moment of stress—something that could happen to any of us—Josh fell for the deception.
The Scope Was Staggering
What made this attack particularly terrifying wasn’t just its scale, but its surgical precision. The attackers didn’t randomly target packages—they strategically chose the foundation stones of the JavaScript ecosystem:
- chalk (357.6 million weekly downloads) – Terminal string styling
- debug (200+ million weekly downloads) – Debugging utility
- ansi-styles, color-convert, strip-ansi, ansi-regex – Core utilities
- And 12 others that form the invisible backbone of countless projects
These aren’t flashy frameworks or trendy libraries. They’re the humble utility packages that every JavaScript developer relies on, often without even realizing it. By targeting these packages, the attackers ensured maximum impact with minimal visibility.
The Malware’s Sophistication
This wasn’t your typical script kiddie malware. The attackers had crafted what amounts to a universal cryptocurrency transaction hijacker with the following capabilities:
- Network Traffic Monitoring: Intercepts all HTTP/HTTPS requests
- Web3 Wallet Targeting: Specifically looks for MetaMask, Phantom, and other popular wallets
- Transaction Hijacking: Replaces recipient addresses with attacker-controlled wallets
- Multi-Chain Support: Targets Bitcoin, Ethereum, Solana, Tron, and other blockchains
- DeFi Platform Exploitation: Focuses on Uniswap, PancakeSwap, 1inch, and SushiSwap
The malware operated at multiple levels—browser JavaScript, Node.js APIs, and even transaction signing processes—creating a comprehensive net designed to capture any cryptocurrency transaction passing through an infected system.
My Journey Through the Crisis 🚨
The Discovery
I was deep in development work on my lollms-vs-extension when I decided to run a routine npm audit
on my VS Code extension project. What I saw made my blood run cold:
text12 critical severity vulnerabilities
ansi-regex * - Malware in ansi-regex
ansi-styles * - Malware in ansi-styles
color-name * - Malware in color-name
The word “Malware” appearing in npm audit results was something I’d never seen before. This wasn’t a typical vulnerability report about outdated dependencies—this was an active malware infection warning.
The Investigation Begins
My first instinct was to investigate further. I had two projects potentially at risk:
- My VS Code extension project (lollms-vs-coder)
- A frontend webUI project built with Vue/Vite
The challenge was determining the actual extent of the compromise. I needed to understand:
- Were my projects truly infected?
- Had I unknowingly distributed malicious code to users?
- What was the actual timeline of the attack?
- How could I verify the integrity of my existing builds?
Building Detection Tools on the Fly
Faced with the inadequacy of standard security tools for this unprecedented threat, I found myself in the unique position of building malware detection tools during an active attack. The scanner needed to identify:
Obfuscation Patterns:
_0x
variables followed by hex strings (the malware’s signature obfuscation technique)- Suspicious function names like
checkethereumw
,runmask
,newdlocal
Network Interception Signatures:
window.ethereum
targeting (MetaMask and other Web3 wallets)XMLHttpRequest.prototype
overrides for HTTP hijackingfetch
function replacements for API interception
Cryptocurrency Targeting:
- Ethereum addresses (0x followed by 40 hex characters)
- Bitcoin addresses (both legacy and Segwit formats)
- References to popular DeFi platforms
The Roadblocks and False Alarms ⚠️
The Great _0x Scare
The most nerve-wracking moment came when examining my prebuilt frontend application from September 7th. I discovered what appeared to be malicious code:
javascript=`/s<%lO,o_0xO'TP!e^_1PV'TP!e^OY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z
The _0xO
pattern looked identical to the malware signature. For a terrifying moment, I thought my September 7th build was compromised, suggesting the attack had started earlier than publicly reported.
But this highlighted a crucial lesson I learned: context is everything in security analysis. After careful investigation, I realized this was actually normal minified JavaScript from Vite’s build process. The entire file was legitimately compressed, and there was only a single _0x
occurrence versus the dozens found in actual malware.
This experience taught me that effective malware detection requires intelligent thresholds:
📦 Build Output (Dist/Assets) – High Tolerance:
- 1-50 _0x variables: Normal minification ✅
- 51-100 _0x variables: Heavy minification (still likely normal) ⚠️
- 100+ _0x variables: Potentially excessive obfuscation 🚨
🔧 Node Modules – Low Tolerance:
- 1-3 _0x variables: Possibly normal ✅
- 4-8 _0x variables: Getting suspicious ⚠️
- 9+ _0x variables: Almost certainly malware 🚨
This scanner is targeting this exact attack and similar ones that use this scheme. If it returns clean code, that doesn’t mean that there is 100% certainty that there is no other marlware using other techniques I did not deal with.
The npm Resolution Crisis
When I attempted to fix the vulnerabilities, I encountered another obstacle: the npm ecosystem was in complete chaos. Even after running npm audit fix
, vulnerabilities persisted because:
- Clean versions of packages weren’t immediately available
- Dependency conflicts prevented updates as packages were being emergency-patched
- The entire ecosystem was simultaneously attempting to update, causing resolution conflicts
I encountered multiple ERESOLVE
errors as packages had incompatible version requirements during the emergency response period. This taught me that during supply chain attacks, patience is often more valuable than immediate action.
The Recovery Strategy 🛡️
1. Immediate Containment
The first rule of incident response: stop the bleeding.
# Stop all Node.js processes immediately
taskkill /f /im node.exe
# Remove potentially infected dependencies
rmdir /s /q node_modules
del package-lock.json
# Clear npm cache to prevent reinfection
npm cache clean --force
2. Timeline Analysis and Risk Assessment
I established a clear timeline to understand my exposure:
- September 7: Built frontend app (likely before major attack wave)
- September 8, 1:16 PM: Attack began
- September 8, 9:00 PM: I discovered the infection
- September 8, 9:36 PM: npm ecosystem began stabilizing
This timeline analysis was crucial in determining that my prebuilt application from September 7th was likely safe, while any builds or installations after 1:16 PM on September 8th were suspect.
3. Implementing Exact Version Pinning
I adopted a security-first approach to package.json dependencies:
json{
"dependencies": {
"marked": "16.2.1", // Exact version, not "^16.2.1"
"axios": "1.7.2" // No automatic updates during attacks
}
}
This prevents automatic updates during security incidents, giving developers control over exactly when and what to update.
4. Multi-Layered Security Scanning
I realized that npm audit
alone was insufficient for detecting sophisticated supply chain attacks. The solution was building comprehensive security tools that could:
- Scan all JavaScript files for malware patterns
- Detect suspicious network interception code
- Monitor for file size anomalies in utility packages
- Verify build integrity through checksums
- Generate detailed reports for analysis
Lessons Learned: The Human Factor 👥
The Vulnerability We All Share
This attack succeeded because it exploited the most difficult vector to secure: human psychology. Josh Junon, an experienced developer with years of open-source contributions, fell victim to a well-crafted phishing email during a stressful period. This reminds us that:
- Security is fundamentally about people, not just technology
- Social engineering remains one of the most effective attack vectors
- Even security-conscious experts can make mistakes under pressure
- The JavaScript ecosystem’s trust model amplifies individual vulnerabilities
The Interconnected Risk
The JavaScript ecosystem’s greatest strength—its vast, interconnected package network—proved to also be its greatest vulnerability. When 18 packages with 2.6 billion downloads get compromised simultaneously, the blast radius becomes almost incomprehensible.
This attack demonstrated that our ecosystem operates more like a complex biological system than isolated software components. A infection in one small part can quickly spread throughout the entire organism.
The Remarkable Community Response
Despite the attack’s devastating scope, the community response was genuinely impressive:
- Detection Speed: Security researchers identified suspicious patterns within hours
- Communication: Warnings spread rapidly through developer networks
- Coordinated Response: npm, maintainers, and security teams worked in unprecedented coordination
- Recovery Time: Clean versions of most packages were available within hours
The attack lasted few hours from initial compromise to ecosystem recovery—remarkable given the scale of coordination required.
Building Resilience: Technical Solutions 🔧
The Security Scanner
During this crisis, I developed what would become the npm-security-scanner—a comprehensive tool designed specifically to detect supply chain malware that conventional scanners miss.
The scanner uses intelligent pattern detection with context-awareness:
Smart _0x Variable Analysis:
- Dist/Build folders: Allows up to 50 _0x variables (expected minification)
- Node modules: Flags 9+ _0x variables as critical (source code shouldn’t be obfuscated)
- Your source code: Flags 4+ _0x variables as critical (you wrote it, why is it obfuscated?)
Malware Signature Detection:
- Known attack function names (
checkethereumw
,runmask
,newdlocal
) - Network interception patterns (
XMLHttpRequest.prototype
hijacking) - Cryptocurrency wallet targeting (
window.ethereum
access)
Enhanced Reporting:
- Generates detailed JSON reports for analysis
- Includes LLM-ready prompts for AI-assisted threat analysis
- Provides actionable recommendations based on findings
Integration with Existing Tools
The key insight was that no single tool provides complete protection. The most effective approach combines:
json{
"scripts": {
"security-check": "npm audit && node security-scanner.js",
"predev": "npm run security-check",
"prebuild": "npm run security-check"
}
}
This creates a multi-layered defense:
- npm audit catches known vulnerabilities from official databases
- Custom scanner detects unknown malware patterns and obfuscation
- Automated integration ensures security checks happen consistently
The Broader Implications 🌐
Supply Chain Security as an International Security Issue
This attack demonstrated that supply chain security is no longer just a developer concern—it’s a matter of digital infrastructure security. With JavaScript powering everything from banking applications to critical infrastructure control systems, a successful supply chain attack could have consequences far beyond stolen cryptocurrency.
The Economics of Open Source Security
The attack highlighted a fundamental economic paradox: the most critical packages in our ecosystem are often maintained by volunteers or small teams with minimal resources for security infrastructure. The packages targeted in this attack generate billions in economic value but are maintained by individuals working in their spare time.
The Need for Proactive Defense
Traditional reactive security measures (patching after vulnerabilities are disclosed) proved inadequate against this type of attack. The malware was designed to steal funds in real-time, meaning that waiting for official security advisories would have been too late for many victims.
This attack proved the need for proactive defense tools that can detect malicious patterns before they’re officially cataloged in vulnerability databases.
Moving Forward: Actionable Recommendations 📋
For Individual Developers
Immediate Actions:
- Implement exact version pinning for critical dependencies
- Add security scanning to your development workflow
- Develop incident response procedures for your projects
- Use multiple security tools, not just npm audit
Long-term Strategy:
- Build security consciousness into your development practices
- Stay informed about supply chain threats and trends
- Contribute to open-source security tools and practices
- Practice good credential hygiene and social engineering awareness
For the JavaScript Ecosystem
Infrastructure Improvements:
- Enhanced npm account security (mandatory hardware tokens)
- Improved package verification and signing systems
- Better incident response coordination mechanisms
- Investment in security tooling for maintainers
Community Initiatives:
- Security education programs for package maintainers
- Funding mechanisms for security audits of critical packages
- Improved communication channels for security incidents
- Development of community-maintained security scanning tools
For Organizations
Policy Changes:
- Supply chain security requirements in procurement
- Security scanning integration in CI/CD pipelines
- Incident response procedures for dependency compromises
- Investment in security tooling and training
The Silver Lining ✨
While this attack was devastating in potential scope, several factors worked in our favor:
1. Rapid Detection and Response
The attack was detected and contained within 36 hours—fast enough to prevent widespread financial damage despite affecting billions of downloads.
2. Community Resilience
The JavaScript community demonstrated remarkable coordination and technical capability in responding to the crisis.
3. Increased Security Awareness
This incident has raised awareness about supply chain security across the entire development community, likely preventing future attacks through increased vigilance.
4. Tool Development
The crisis spurred development of new security tools and techniques that will benefit the entire ecosystem going forward.
Conclusion: Vigilance and Preparedness 🎯
Today’s attack was a wake-up call, but it was also a demonstration of what’s possible when a community comes together to face an existential threat. As someone who builds developer tools and AI frameworks used by thousands of developers, I feel a profound responsibility for security that extends beyond my own projects.
This incident reminded me that in our interconnected digital world, we’re truly only as secure as our most vulnerable dependency. But it also showed me that when faced with a crisis, developers can rapidly adapt, build solutions, and protect each other.
The npm supply chain attack of September 8, 2025, will likely be remembered as a turning point—not just for the damage it could have caused, but for how it galvanized our community to build better defenses. Through shared knowledge, proactive tools, and collective vigilance, we can emerge from this stronger and more resilient than before.
The tools born from this crisis, including the security scanner I developed during the attack, represent our community’s commitment to never being caught off-guard again.
Take Action: Protect Your Projects Today 🛡️
Don’t wait for the next attack to think about supply chain security. You can start protecting your projects right now:
🔗 Get the npm Security Scanner: https://github.com/ParisNeo/npm-security-scanner
This tool was forged in the fire of a real supply chain attack and battle-tested against actual malware. It provides:
- ✅ Smart pattern detection with context-aware thresholds
- ✅ Multi-layered scanning beyond what npm audit catches
- ✅ AI-ready reports for advanced analysis with tools like Lollms
- ✅ Easy integration into your existing development workflow
- ✅ Real-world testing against the malware patterns from this attack
The scanner is open source, actively maintained, and designed to evolve with emerging threats. It represents the collective knowledge gained from surviving the largest npm supply chain attack in history.
Remember: The next attack is not a matter of if, but when. Be prepared.
Stay safe, fellow developers. In a world of interconnected code, we protect each other.
Ajouter à la question de suivi
Vérifier les sources
- https://github.com/ParisNeo/npm-security-scanner
- https://spectralops.io/blog/best-npm-vulnerability-scanners/
- https://www.mend.io/blog/npm-audit/
- https://jfrog.com/devops-tools/article/running-npm-security-scans/
- https://snyk.io/blog/npm-security-malicious-code-in-oss-npm-packages/
- https://cycode.com/blog/malicious-code-hidden-in-npm-packages/
- https://docs.npmjs.com/auditing-package-dependencies-for-security-vulnerabilities/
- https://www.nodejs-security.com/blog/npm-vulnerabilities-review
- https://blog.inedo.com/npm/exploring-npm-package-vulnerabilities-and-effective-auditing/
- https://www.sonarsource.com/blog/vscode-security-finding-new-vulnerabilities-npm-integration/
- https://fr.aikido.dev/blog/popular-nx-packages-compromised-on-npm