# SAP-Related npm Packages Compromised in Credential-Stealing Supply Chain Attack
A sophisticated supply chain attack has targeted SAP-related packages on npm, the JavaScript package repository, injecting credential-stealing malware into libraries used by thousands of developers. The campaign, dubbed mini Shai-Hulud, represents a growing threat to enterprise software supply chains, with multiple security vendors—Aikido Security, SafeDep, Socket, StepSecurity, and Google-owned Wiz—independently identifying and tracking the malicious activity.
## The Threat: Attack Overview
Researchers have discovered that the mini Shai-Hulud campaign compromised multiple npm packages related to SAP's JavaScript and cloud application ecosystem. The infected packages contained malware designed to steal credentials and sensitive information from developers' environments, posing a significant risk to any organization using these libraries in their applications.
The attack demonstrates a troubling evolution in supply chain compromise tactics:
## Background and Context: Why SAP Packages Matter
SAP is among the world's largest enterprise resource planning (ERP) software providers, used by organizations across finance, manufacturing, healthcare, retail, and government sectors. JavaScript packages associated with SAP's ecosystem are critical components in modern cloud and web application development.
Why attackers targeted SAP packages:
The attack reflects a broader trend where threat actors have shifted from targeting end-user applications to compromising the software supply chain at intermediate points—specifically open-source package repositories.
## Technical Details: How the Attack Worked
### Package Infection Mechanism
The compromised packages were modified to include malicious code that executed during installation or runtime. The specific mechanisms likely included:
| Attack Component | Function |
|---|---|
| Installation hooks | Code executed during npm install process, before developer awareness |
| Environment enumeration | Scanning for environment variables containing API keys and credentials |
| Credential exfiltration | Sending stolen tokens to attacker-controlled infrastructure |
| Obfuscation | Code obscured or split across multiple files to evade detection |
### The "mini Shai-Hulud" Campaign
Named after the fictional sandworms in *Dune*, the campaign appears designed with specific operational objectives:
## Implications for Organizations
### Immediate Impact
Organizations using affected packages face several risks:
1. Credential compromise: Any credentials stored in environment variables or configuration files accessible to the npm environment were potentially exposed
2. Lateral movement: Stolen API keys could enable attackers to access downstream systems and services
3. Supply chain contamination: Organizations may have unknowingly built applications containing malicious code
4. Regulatory exposure: Data breaches resulting from the compromise could trigger compliance obligations (GDPR, HIPAA, SOC 2, etc.)
### Downstream Effects
## Mitigation and Recommendations
### Immediate Actions
Organizations should take these steps now:
1. Audit npm dependencies: Review package.json and lock files for any affected packages
2. Check for installation dates: Identify when compromised versions were installed
3. Rotate credentials: Change any API keys, tokens, or credentials that were active during the infection window
4. Scan application code: Review source control history for suspicious code or unauthorized changes
5. Rebuild and redeploy: Rebuild applications using known-clean package versions and redeploy to production
### Detection and Investigation
### Longer-Term Prevention
Strengthen supply chain security:
| Strategy | Implementation |
|----------|---|
| Package verification | Implement Software Bill of Materials (SBOM) generation and verification |
| Dependency scanning | Deploy continuous scanning tools (Snyk, npm audit, Socket, Wiz) in CI/CD pipelines |
| Access controls | Limit environment variable access and secrets exposure in build environments |
| Code review | Strengthen code review processes for dependency updates and package changes |
| Signed packages | Prioritize packages with cryptographic signatures and verified publisher identities |
### Enterprise Governance
## Broader Lessons
The mini Shai-Hulud campaign illustrates critical vulnerabilities in open-source supply chains:
1. npm as a critical infrastructure: The JavaScript ecosystem is foundational to modern software, requiring equivalent security rigor as compiled language repositories
2. Detection gaps: Multiple independent vendors identified the attack, suggesting it persisted longer than desired before widespread detection
3. Attacker sophistication: The targeted, credential-focused approach demonstrates advanced operational planning by threat actors
4. Shared responsibility: Security depends on collaboration between platform maintainers, package publishers, enterprises, and security researchers
## Conclusion
The compromise of SAP-related npm packages represents a significant escalation in supply chain attack sophistication. By targeting specific enterprise ecosystems with credential-stealing malware, the mini Shai-Hulud campaign demonstrates that threat actors are evolving their tactics beyond broad indiscriminate attacks toward precision supply chain compromise.
Organizations must treat this as a wake-up call to audit their dependency chains, strengthen credential management, and implement continuous monitoring of their software supply chains. The collaborative response from Aikido Security, SafeDep, Socket, StepSecurity, and Wiz—along with rapid disclosure—demonstrates that community vigilance remains essential until the broader npm ecosystem implements stronger verification mechanisms.
For organizations using SAP-related JavaScript packages, immediate action is warranted: audit affected installations, rotate credentials, and rebuild applications with verified clean dependencies. This incident underscores that in the modern software landscape, supply chain security is not optional—it is essential operational security.