Connect with us

Hi, what are you looking for?

SecurityWeekSecurityWeek

Malware & Threats

SAP NPM Packages Targeted in Supply Chain Attack

The Mini Shai-Hulud attack introduced a preinstall hook to fetch and execute a Bun binary and bypass security monitoring.

SAP

Four SAP NPM packages have been injected with malicious code as part of a new supply chain attack, security researchers warn.

The campaign, referred to as Mini Shai-Hulud, is targeting packages linked to the SAP Cloud Application Programming (CAP) ecosystem and SAP cloud deployment workflows.

On April 29, four package versions were flagged as malicious, namely npm mbt 1.2.48, npm @cap-js/db-service 2.10.1, npm @cap-js/postgres 2.2.2, and npm @cap-js/sqlite 2.2.2.

With over 500,000 combined weekly downloads, these packages are SAP’s Cloud MTA Build Tool for building Multi-Target Application archives, and database service packages for CAP software.

These packages, Socket reports, were injected with a preinstall script working as a runtime bootstrapper. When executed, the script fetches a Bun ZIP from a GitHub repository, extracts it, and executes the included Bun binary.

According to Onapsis, the malicious package versions were available for 2-4 hours. They have since been unpublished and clean versions have been released to supersede them.

Advertisement. Scroll to continue reading.

The malicious code delivered through the compromised packages is an information stealer that targets local credentials, GitHub and NPM tokens, and AWS, Azure, GCP, GitHub Action, Kubernetes, and other cloud secrets.

The malware exfiltrates them through public GitHub repositories that have the hardcoded description “A Mini Shai-Hulud has Appeared”. The malware also includes a propagation mechanism.

According to Aikido, the threat checks for GitHub Actions release workflows and then modifies package tarballs to add the payload, modify their versions, repackage them, and use stolen GitHub Actions tokens to publish them.

SAP’s NPM ecosystem was likely hit through a compromised NPM token that was exposed to pull request builds via CircleCI, Aikido says.

As Onapsis underlines, the Mini Shai-Hulud supply chain attack represents a major threat to developers and organizations that use SAP CAP, which is the framework for S/4HANA extensions, Fiori app backends, MTAs, and integration flows.

“Any SAP customer with JavaScript development may be pulling @sap/* and @cap-js/* packages into their build pipelines, frequently with loose version ranges and lots of transitive dependencies,” Onapsis notes.

All organizations using SAP Business Technology Platform workflows, SAP CAP, or MTA-based deployment pipelines should check if they installed the malicious package versions during the exposure window.

Based on technical overlaps and operational patterns, cybersecurity firm Wiz attributes the incident to the notorious TeamPCP hacking group that claimed several supply chain attacks over the past months.

“This assessment is due to a shared RSA public key used to encrypt the exfiltrated secrets. This means that the same private key would decrypt the payloads, limiting the accessibility of the exfiltrated data to TeamPCP,” Wiz notes.

Related: Critical Gemini CLI Flaw Enabled Host Code Execution, Supply Chain Attacks

Related: Checkmarx Confirms Data Stolen in Supply Chain Attack

Related: Bitwarden NPM Package Hit in Supply Chain Attack

Related: Mercor Hit by LiteLLM Supply Chain Attack

Written By

Ionut Arghire is an international correspondent for SecurityWeek.

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing for the latest cybersecurity threats, trends, and expert insights.

Trending

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest threats, trends, and technology, along with insightful columns from industry experts.

Join this live webinar as we explore why exploitation is outpacing remediation, where risk is growing fastest, and what security leaders can do to close the gap before attackers take advantage.

Register

CodeSecCon bridges the gap between dev and security. Discover best practices for secure coding, innovative risk-reduction tools, and safe AI integration to cultivate a true DevSecOps culture. Safely secure your apps!

Register

People on the Move

Jazz has named Sean Robinson, Rickie Goyal, Danielle Guetta, Shani Nago, and Lior Magram as VPs and Michael Calev as COO.

AJ Shipley has been appointed Chief Product Officer at CrowdStrike.

Brinqa has named Ron Dovich as Chief AI and Automation Officer, David Allen as CTO, Steve Biagioni as CFO, and James Walta as VP of Product.

More People On The Move

Expert Insights

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest cybersecurity news, threats, and expert insights. Unsubscribe at any time.