Operation Mini Shai-Hulud: How Threat Actors Buried Credential Stealers Inside SAP's npm Ecosystem
A sophisticated supply chain campaign dubbed "mini Shai-Hulud" has compromised SAP-related npm packages, injecting credential-stealing malware targeting enterprise JavaScript developers.
This analysis is based on research published by The Hacker News. CypherByte adds analysis, context, and security team recommendations.
Original research credit: The Hacker News, with supporting intelligence from Aikido Security, SafeDep, Socket, StepSecurity, and Wiz (Google).
Executive Summary
A coordinated supply chain attack campaign operating under the self-styled designation mini Shai-Hulud has successfully infiltrated npm packages associated with SAP's JavaScript and cloud application development ecosystem. The campaign, flagged simultaneously by five independent security research organizations — Aikido Security, SafeDep, Socket, StepSecurity, and Google-owned Wiz — represents one of the more operationally sophisticated package-level compromises targeting enterprise software infrastructure in recent memory. At its core, the attack weaponizes developer trust: the implicit assumption that packages published under or adjacent to a known enterprise vendor's namespace are safe to consume.
Security teams operating in environments that leverage SAP's Business Technology Platform, SAP Cloud Application Programming Model, or any JavaScript tooling drawing from the SAP-adjacent npm namespace should treat this as an active threat requiring immediate triage. The downstream blast radius extends well beyond SAP shops — any CI/CD pipeline, containerized build environment, or developer workstation that has pulled an affected package version is a candidate for credential exposure. Given SAP's penetration across Fortune 500 enterprises, government agencies, and critical infrastructure operators, the potential for lateral movement from a compromised developer credential into production ERP and financial systems is severe.
Technical Analysis
The attack follows the well-documented dependency confusion and package hijacking playbook, but with execution refinements that elevated its detection difficulty. Threat actors published or modified npm packages that mirror the naming conventions of legitimate SAP JavaScript libraries. Once a developer or automated build system resolves and installs one of the compromised packages, malicious code embedded within the package's install lifecycle scripts — typically the preinstall or postinstall hooks — executes automatically without any additional user interaction.
The embedded payload functions as a credential harvester. Upon execution, it enumerates the host environment for high-value secrets: .npmrc files containing registry authentication tokens, environment variables storing cloud provider credentials (AWS, Azure, GCP service account keys), SSH private keys, shell history files that may contain inline secrets, and browser-stored credentials accessible from the filesystem. This data is staged and exfiltrated to an attacker-controlled endpoint over HTTPS, deliberately blending with legitimate outbound traffic to avoid network-layer detection. The use of encrypted exfiltration channels is a maturation from earlier supply chain campaigns that relied on plaintext HTTP callbacks.
1. Attacker publishes malicious package to npm registry under SAP-adjacent namespace
2. Developer or CI/CD pipeline resolves dependency and executes
npm install3.
postinstall hook triggers credential harvesting script automatically4. Secrets enumerated from filesystem, environment, and credential stores
5. Data exfiltrated via HTTPS to attacker-controlled infrastructure
6. Attacker leverages stolen credentials for lateral movement into cloud and ERP environments
What distinguishes mini Shai-Hulud from commodity supply chain attacks is its deliberate targeting of the SAP ecosystem. SAP developers routinely handle credentials with elevated privilege — access to S/4HANA systems, SAP BTP service keys, HANA database connection strings, and integration middleware credentials. A single compromised developer token in this context can unlock pathways into financial ledgers, HR databases, supply chain systems, and enterprise integration buses that would otherwise require significant effort to breach through conventional attack vectors.
Impact Assessment
The affected packages are associated with SAP's JavaScript tooling and cloud application development surface — including libraries used in the SAP Cloud Application Programming (CAP) Model framework and related BTP toolchains. Developers building on these frameworks represent a concentrated, high-privilege target population. The impact assessment must be considered across three distinct layers:
Immediate Impact — Developer Workstation Compromise: Any developer who has installed an affected package version on a local machine should assume credential exposure. This includes npm registry tokens, cloud CLI credentials cached by tools like the AWS CLI, Azure CLI, or Google Cloud SDK, and any secrets stored in local .env files or shell profiles. The window of exposure begins at install time and persists until credentials are rotated.
Pipeline Impact — CI/CD Infrastructure Poisoning: Automated build systems that consume the affected packages are particularly dangerous victims because they typically operate with elevated service account permissions and may have access to production deployment secrets, container registry credentials, and infrastructure-as-code state files. A compromised CI runner credential can enable an attacker to inject malicious artifacts directly into production release pipelines.
Downstream Impact — Enterprise ERP and Cloud Environments: The ultimate target in this attack chain is not the developer — it is the SAP landscape behind them. Credentials harvested from a developer's environment may provide direct access to SAP BTP subaccounts, HANA Cloud instances, SAP Integration Suite, or connected on-premise S/4HANA systems. In regulated industries, unauthorized access to these systems constitutes a notifiable data breach under GDPR, HIPAA, SOX, and equivalent frameworks.
CypherByte's Perspective
The mini Shai-Hulud campaign illustrates a threat model that the security industry has been warning about for years but enterprises have been slow to operationalize defenses against: the developer as the perimeter. In modern cloud-native architectures, the most privileged credentials in an organization often live not in a hardened secrets vault, but in a developer's home directory, their shell environment, or their IDE's configuration files. Supply chain attacks that execute at install time bypass virtually every traditional endpoint and network security control, because the malicious code runs as the developer — with all of their access — the moment they type npm install.
From a mobile and application security standpoint, this campaign reinforces a critical gap in how organizations govern third-party code consumption. Mobile development pipelines are equally exposed — React Native projects, hybrid application frameworks, and mobile backend toolchains all draw heavily from npm. A credential harvester that captures a developer's cloud API keys or CI service tokens during a mobile build could exfiltrate signing certificates, app store credentials, or backend service secrets with equal effectiveness. The attack surface is not limited to SAP environments; it is endemic to any organization using the npm ecosystem without rigorous supply chain controls.
Indicators and Detection
Defenders should prioritize the following detection strategies in response to this campaign:
Package-Level Indicators: Review installed npm packages for any SAP-prefixed or SAP-adjacent library names that were recently added or updated. Cross-reference installed versions against the official SAP npm organization (@sap) and verified release history. Any package with preinstall or postinstall scripts that make network calls or access filesystem locations outside the project directory should be flagged for manual review.
Network Indicators: Monitor for outbound HTTPS connections originating from build environments, developer workstations, or CI runners to unfamiliar endpoints during or immediately after npm install execution. Tools like network-intercept, sandboxed package analysis platforms, or next-gen firewall egress filtering on build infrastructure can surface anomalous callback behavior.
— Unexpected
postinstall scripts performing curl, wget, or Node.js https.request calls— File access patterns touching
~/.npmrc, ~/.aws/credentials, ~/.ssh/, or .env files during package install— Outbound connections from CI/CD runners to non-registry, non-CDN endpoints post-install
— Anomalous npm package versions not matching official SAP release tags
— Process spawning from Node.js install hooks (child_process, exec, spawn calls)
Recommendations
1. Audit Immediately. Run a full inventory of SAP-related npm packages across all development environments, CI/CD pipelines, and containerized build systems. Compare installed versions against the official @sap npm organization registry. Prioritize any package installed or updated in the past 90 days.
2. Rotate Credentials Universally. Any environment that has executed npm install with an affected package should be treated as potentially compromised. Rotate npm tokens, cloud provider credentials, SSH keys, and any other secrets accessible from affected machines. Do not wait for forensic confirmation before rotating — the cost of unnecessary rotation is negligible compared to the cost of a confirmed breach.
3. Enforce Package Integrity Controls. Implement npm audit and tool-assisted Software Composition Analysis (SCA) in all pipelines. Consider adopting a private npm registry mirror (e.g., Verdaccio, Artifactory, or AWS CodeArtifact) with an allow-list of approved packages to prevent unapproved packages from resolving in build environments.
4. Restrict Install Hook Execution. Where operationally feasible, configure npm with --ignore-scripts for production and CI dependency installation. Evaluate alternative package managers with stronger sandboxing guarantees. Apply principle of least privilege to CI service accounts so that compromised runner credentials have minimal blast radius.
5. Implement Runtime Secrets Detection. Deploy secrets detection tooling (e.g., Trufflehog, Gitleaks, or commercial equivalents) in CI pipelines to identify exposed credentials before they can be exfiltrated. Pair this with network egress controls on build infrastructure to block unexpected outbound calls during install phases.
6. Adopt a Zero-Trust Posture for Developer Toolchains. Treat the developer environment as an untrusted boundary. Store secrets in dedicated vaults (HashiCorp Vault, AWS Secrets Manager, Azure Key Vault) with short-lived, scoped tokens rather than long-lived credentials in environment files. Enforce MFA and hardware security keys for any registry or cloud console access.
CypherByte will continue to monitor the mini Shai-Hulud campaign for new package indicators, infrastructure pivots, and attribution developments. Organizations requiring incident response support or supply chain security assessment should contact CypherByte directly.
How this article was produced
This analysis was produced by CypherByte's automated research pipeline, starting from the published summary of the original report credited below. Articles are published automatically. It can include context and recommendations that are not in the original report, so read the original for the researchers' own findings.
Sources
Spotted an error? Tell us on X (@cypherbyteio) with this page's address so we can fix it.
CypherByte Premium is coming soon, with deep-dive writeups and a weekly threat briefing. Join the waitlist for founding member pricing.