SAP npm Packages Compromised to Harvest Developer and CI/CD Secrets

By Published On: April 30, 2026

A sophisticated supply chain attack, dubbed “mini Shai Hulud,” has recently compromised several SAP-related npm packages, silently targeting developer environments and Continuous Integration/Continuous Deployment (CI/CD) pipelines. This evolving threat highlights a critical vulnerability in the software development lifecycle, particularly for organizations relying on SAP technologies. Security researchers from StepSecurity, Aikido Security, SafeDep, Socket, and Wiz uncovered this insidious campaign designed to harvest sensitive credentials across vital platforms like GitHub, npm, and various major cloud providers.

The attackers leveraged malicious preinstall scripts embedded within four seemingly legitimate npm packages, executing silently during dependency installation. This strategy allows the compromise to unfold without immediate detection, giving attackers ample opportunity to exfiltrate valuable secrets. The implications for developer security and organizational integrity are substantial, necessitating immediate attention and robust defensive measures.

Understanding the “mini Shai Hulud” Attack Vector

The “mini Shai Hulud” attack hinges on a classic, yet highly effective, supply chain compromise. By injecting malicious code into widely used npm packages, attackers weaponize the very tools developers rely on for efficiency and collaboration. Specifically, the threat actors modified the package.json files of four SAP-related npm packages. These modifications included the addition of a preinstall script. This script, unbeknownst to the developer or automated CI/CD system, executes before the main package installation process begins.

The malicious payload within these scripts is designed to enumerate and exfiltrate credentials. This stealthy approach allows the attackers to bypass traditional perimeter defenses and directly access environments with elevated privileges, such as those used for source code management, package management, and cloud infrastructure.

Targeted Credentials and Impact

The primary objective of “mini Shai Hulud” is the indiscriminate harvesting of sensitive credentials. The scope of this exfiltration is broad, targeting critical access tokens and authentication data from:

  • GitHub: Personal Access Tokens (PATs), SSH keys, and other credentials that grant access to private repositories, code, and project management.
  • npm: Authentication tokens used for publishing and managing npm packages, which can be leveraged for further supply chain attacks or intellectual property theft.
  • Major Cloud Providers: AWS access keys, Azure service principal credentials, Google Cloud service accounts, and other tokens that provide access to cloud resources, data, and infrastructure.

The compromise of these credentials can lead to severe consequences, including intellectual property theft, unauthorized access to sensitive data, infrastructure compromise, and the potential for further lateral movement within an organization’s digital footprint. The silent nature of the preinstall script execution means that developers and security teams may remain unaware of the breach until significant damage has occurred.

Remediation Actions

Addressing the “mini Shai Hulud” threat requires a multi-faceted approach, focusing on proactive prevention and rapid response. Organizations utilizing SAP-related npm packages, or any npm packages for that matter, must implement the following:

  • Immediate Audit of Dependencies: Review all package.json files in your projects, especially those related to SAP development, for any suspicious or unknown preinstall, postinstall, or other lifecycle hooks.
  • Pinning Dependencies to Fixed Versions: Avoid using broad version ranges (e.g., ^1.0.0 or ~1.0.0). Instead, pin dependencies to specific, verified versions (e.g., 1.0.0) to prevent automatic updates that could introduce malicious code.
  • Static Application Security Testing (SAST): Integrate SAST tools into your CI/CD pipelines to scan for known vulnerabilities and suspicious patterns in your codebase, including malicious scripts within dependencies.
  • Software Composition Analysis (SCA): Utilize SCA tools to identify open-source components, track their versions, and detect known vulnerabilities or signs of tampering within your dependencies.
  • Least Privilege Principles: Ensure that CI/CD pipelines and developer environments operate with the minimum necessary permissions. Limit access to sensitive credentials and infrastructure.
  • Credential Rotation: Regularly rotate sensitive credentials for GitHub, npm, and cloud providers. In the event of a suspected compromise, immediate rotation is paramount.
  • Network Egress Filtering: Implement strict egress filtering to prevent unauthorized connections from developer machines and CI/CD agents to unknown external IP addresses or domains.
  • Monitor for Anomalous Activity: Implement robust logging and monitoring for suspicious activity originating from developer workstations or CI/CD systems, such as unusual network connections or file access patterns.
  • Developer Education: Educate developers on the risks of supply chain attacks, the importance of carefully vetting npm packages, and secure coding practices.

Currently, no specific CVE has been assigned to the “mini Shai Hulud” campaign itself, as it represents a broader attack technique rather than a single vulnerability in a specific product. However, the principles outlined in CVE-2023-39785 regarding npm package vulnerability and CVE-2023-45812 concerning software supply chain risks provide context for similar threats.

Recommended Security Tools

Leveraging specialized tools can significantly enhance your organization’s defense against supply chain attacks like “mini Shai Hulud.”

Tool Name Purpose Link
npm audit Identifies known vulnerabilities in project dependencies. https://docs.npmjs.com/cli/v9/commands/npm-audit
Snyk Identifies, prioritizes, and fixes vulnerabilities in open-source dependencies and code. https://snyk.io/
Dependabot Automatically updates dependencies to fix security vulnerabilities and keep software up to date. https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates
OWASP Dependency-Check Identifies project dependencies and checks for known, publicly disclosed vulnerabilities. https://owasp.org/www-project-dependency-check/
GitGuardian Scans source code repositories for secrets and sensitive data before they are committed. https://www.gitguardian.com/

Conclusion

The “mini Shai Hulud” campaign against SAP npm packages underscores the persistent and evolving threat of software supply chain attacks. The strategic targeting of developer environments and CI/CD pipelines serves as a stark reminder that security must be integrated at every stage of the software development lifecycle. Organizations must prioritize robust dependency management, implement stringent security controls, and foster a culture of security awareness among developers to mitigate these sophisticated threats effectively. Proactive vigilance and a layered defense strategy are essential to protect against the silent infiltration tactics employed by adversaries in the current cybersecurity landscape.

Share this article

Leave A Comment