# SAP npm Packages Compromised in Supply-Chain Attack Targeting Developer Credentials
A significant supply-chain attack has compromised multiple official SAP npm packages, allowing threat actors to harvest credentials and authentication tokens directly from developers' systems. The attack, attributed to the TeamPCP threat group, represents a sophisticated evolution in supply-chain targeting that bypasses traditional security boundaries to access sensitive development credentials at scale.
## The Threat
Security researchers discovered that several legitimate SAP npm packages—distributed through the official npm registry—had been modified to include malicious code designed to exfiltrate authentication credentials and API tokens from developers' local environments. The compromised packages were being served to any developer who installed or updated them, creating a wide exposure window before detection.
The attack specifically targets:
What distinguishes this attack is its access to the entire credential landscape of compromised developer machines—credentials that developers often assume are safely contained within their local systems.
## Background and Context
### About TeamPCP
The TeamPCP threat group has been linked to several high-profile supply-chain attacks targeting software development infrastructure. The group specializes in obtaining legitimate code repository access and npm package publishing privileges, either through credential theft, account compromise, or social engineering. Their approach favors patience over speed, often maintaining access for extended periods before deploying malicious payloads.
### The Affected SAP Packages
According to initial reports, the compromised packages include:
| Package Name | Popularity | Risk Level |
|---|---|---|
| @sap/common-logging | High (used in enterprise environments) | Critical |
| @sap/xsenv | High (SAP Cloud Platform integration) | Critical |
| @sap/logger | Moderate | High |
| Additional support packages | Varied | High |
These packages are commonly used in SAP Cloud Platform applications, SAP Fiori development, and enterprise Node.js applications built on the SAP ecosystem.
### Timeline of Discovery
## Technical Details
### Attack Mechanism
The malicious code was inserted into legitimate package installation scripts, specifically leveraging npm's postinstall hooks—scripts that execute automatically after a package is installed or updated. This is a known npm supply-chain vector that several past attacks have exploited.
The injected code performed the following operations:
1. Credential Discovery: Scanned the user's home directory for common credential storage locations
2. Exfiltration: Compressed credentials into archives and sent them to attacker-controlled infrastructure
3. Obfuscation: Used encoding techniques to avoid static analysis and automated detection
4. Cleanup: Removed traces of execution from shell history and logs
### Delivery Method
The attackers maintained access to SAP's npm publishing credentials, allowing them to:
npm's version management system made it difficult for developers to immediately identify which versions were compromised, as the malicious code was distributed through "legitimate" version updates.
### Scope of Exposure
Initial analysis suggests that developers who installed affected packages between specific dates were at risk of credential theft. The exact number of affected installations is still being determined, but npm package download metrics indicate hundreds of thousands of potential exposures across different versions.
## Implications for Organizations
### Immediate Risks
Organizations using SAP npm packages now face potential:
### Enterprise Impact
For SAP customers specifically:
### Broader Supply-Chain Implications
This incident demonstrates that:
## Recommendations
### Immediate Actions (24-48 hours)
1. Audit npm Packages: Run npm audit and check your package-lock.json for the specific compromised versions
2. Rotate Credentials: Assume all local credentials may be compromised; rotate SSH keys, npm tokens, API keys, and cloud credentials
3. Check Logs: Review authentication logs for unusual activity across all services that may have been accessed
4. Notify Cloud Providers: Alert cloud service providers of potential credential theft and request account security reviews
5. Update Packages: Update to patched versions of affected SAP packages once remediation is confirmed complete
### Short-Term Measures (1-2 weeks)
### Long-Term Strategies
## Conclusion
The compromise of official SAP npm packages represents a critical reminder that supply-chain security cannot rely solely on source verification. Attackers with sufficient sophistication and persistence can infiltrate trusted distribution channels, requiring organizations to implement defense-in-depth strategies.
The incident underscores the need for:
As development becomes increasingly distributed and dependency-driven, the attack surface for supply-chain threats continues to expand. Organizations must treat developer credentials as critical assets requiring the same level of protection as production infrastructure.