Skip to main content
300+ Malicious npm Packages in 22 MinutesIncident
4 min readFor Security Engineers

300+ Malicious npm Packages in 22 Minutes

What Happened

On May 19, 2026, an attacker compromised an AntV maintainer account and published over 300 malicious package versions across 323 packages in a 22-minute automated burst. The threat actor, identified as TeamPCP, embedded credential-harvesting malware into packages within the AntV data visualization ecosystem. The malicious code targeted developer secrets and cloud credentials, establishing persistence mechanisms on infected systems.

This wasn't a sophisticated zero-day exploit. It was a basic account compromise followed by automated package publishing at scale.

Timeline

May 19, 2026, ~00:00 UTC: Attacker gains access to compromised maintainer account.

00:00-00:22 UTC: Automated script publishes 323 malicious package versions across the AntV ecosystem.

~00:30 UTC: First automated security scanners flag suspicious publishing patterns.

Hours 1-4: Security teams begin receiving alerts from dependency scanning tools.

Day 1: npm begins taking down malicious packages; organizations start incident response.

Days 2-7: Affected teams rotate credentials and audit systems for persistence mechanisms.

The 22-minute publishing window is critical. If you were pulling packages during that window, your detection and response window was effectively zero.

Which Controls Failed or Were Missing

Multi-factor authentication was either absent or bypassed. The attacker gained full publishing rights to a maintainer account. If MFA had been enforced and functioning, this attack would have required phishing the second factor or compromising the MFA device itself — a significantly higher bar.

Publishing rate limits and anomaly detection failed to prevent the burst. Publishing 323 packages in 22 minutes should have triggered automated holds. The npm registry either lacked these controls or they were tuned too permissively.

Package signing and verification were not enforced. If packages had been cryptographically signed by maintainers, automated systems could have rejected unsigned or improperly signed versions immediately.

Dependency pinning and lock file discipline were inconsistent across consuming organizations. Teams running npm install without pinned versions pulled malicious code automatically. Teams with strict lock files and manual update processes had a buffer.

Credential rotation policies were inadequate. The embedded malware harvested developer secrets and cloud credentials. Organizations without automated credential rotation or secret scanning in CI/CD pipelines had no mechanism to detect or limit the blast radius.

What the Standards Require

PCI DSS v4.0.1 Requirement 6.3.2 mandates that software engineering personnel receive training in secure development practices, including supply chain security risks. Your developers need to understand dependency risks, not just code-level vulnerabilities.

PCI DSS v4.0.1 Requirement 6.4.3 requires that scripts loaded and executed in the consumer's browser are managed using integrity controls like Subresource Integrity (SRI). While this requirement targets browser-side scripts specifically, the principle applies to build-time dependencies: verify integrity before execution.

ISO/IEC 27001:2022 Control 8.31 addresses the security of information in supplier relationships. You must identify and document security risks in your software supply chain, including package repositories. This includes maintaining an inventory of dependencies and assessing their security posture.

NIST 800-53 Rev 5 Control SA-10 (Developer Configuration Management) requires organizations to perform configuration management during system development, including tracking security flaws and resolution within the system and component elements. Your dependency management process is configuration management.

SOC 2 Type II Common Criteria CC6.8 requires organizations to implement controls over system operations, including change management for software components. If you're SOC 2 certified, your auditor should be asking how you manage dependency updates and verify package integrity.

None of these standards explicitly say "use MFA on your npm account," but they all require you to secure your development pipeline and manage third-party risks. The AntV incident is a textbook example of what happens when you treat package registries as trusted infrastructure instead of as a supply chain risk.

Lessons and Action Items for Your Team

Enforce MFA on all package registry accounts immediately. GitHub, npm, PyPI, and other registries support it. If a developer pushes back, ask them how they'd explain a supply chain compromise to your customers.

Implement dependency pinning with explicit update workflows. Use lock files (package-lock.json, yarn.lock, Pipfile.lock) and commit them to version control. Updates should require pull requests with automated security scanning.

Deploy automated dependency scanning in CI/CD. Tools like Snyk, Dependabot, or Renovate should run on every build. Configure them to fail builds on high-severity vulnerabilities or suspicious package changes.

Build a Software Bill of Materials (SBOM) for every application. You need an inventory of every dependency, including transitive dependencies. Tools like Syft or CycloneDX can generate SBOMs automatically. Store them with each release.

Rotate credentials on a schedule and after incidents. If you're storing cloud credentials or API keys in your development environment, they should rotate automatically every 90 days maximum. After a supply chain incident, rotate everything that could have been exposed.

Monitor for persistence mechanisms. The AntV malware established persistence. Audit your systems for unauthorized cron jobs, startup scripts, SSH keys, and authorized_keys modifications. This should be part of your incident response playbook.

Establish a rapid response protocol for supply chain incidents. When a dependency is compromised, you need to know within hours, not days. Your protocol should include: automated alerts, a decision tree for rollback vs. patching, a communication plan for affected teams, and a credential rotation checklist.

Test your response. Run a tabletop exercise where a critical dependency is compromised. Who gets notified? How fast can you identify affected systems? How long does credential rotation take? If you don't know, you're not ready.

The AntV attack succeeded because it exploited gaps in basic hygiene: weak authentication, missing integrity checks, and slow detection. The 22-minute window is a reminder that automated attacks move faster than human response times. Your controls need to be automated too.

Subresource Integrity (SRI)

Topics:Incident

You Might Also Like