Loading date…
LinkedIn Twitter Instagram YouTube WhatsApp

Mini Shai-Hulud Worm Hits npm Package With 150K Weekly Downloads

Illustration of the Mini Shai-Hulud supply-chain attack showing a compromised npm package with 150,000 weekly downloads, malicious code execution during installation, and credential theft targeting developer and CI/CD environments.

Mini Shai-Hulud Strikes Again: How a Trusted npm Package With 150K Weekly Downloads Got Weaponized

Picture this: it's a Friday evening, your CI pipeline runs a routine npm install as part of a scheduled dependency refresh, and thirty seconds later a background script is quietly reading your environment variables, checking whether your GitHub token still works, and phoning home with the results. No alert fires. No antivirus flags it. The build finishes green. That's roughly what happened to teams pulling in @7nohe/openapi-react-query-codegen in late August 2026, and it's a scenario every SOC analyst and DevOps engineer should sit with for a minute.

This wasn't a sketchy typosquatted package from an unknown publisher. It was a legitimate, widely used code-generation tool with roughly 150,000 weekly downloads, signed with valid npm provenance, and shipped through an official GitHub Actions release pipeline. That combination — real package, real signature, real trust — is exactly what makes this incident worth breaking down in detail.

Table of Contents

What Happened: The Timeline

Timeline graphic showing the August 28, 2026 Mini Shai-Hulud npm supply-chain attack, with ten malicious versions of @7nohe/openapi-react-query-codegen published in two waves across the 0.5.x, 1.6.x, 2.2.x, and 3.0.x release branches.

On August 28, 2026, an attacker published ten malicious versions of @7nohe/openapi-react-query-codegen, a Node.js package that generates React Query (TanStack Query) hooks from OpenAPI specifications. The releases went out in two bursts roughly twenty minutes apart, and together they covered every actively maintained release line: the 0.5.x, 1.6.x, 2.2.x, and 3.0.x branches.

That last detail matters operationally. It means there was no single "safe" major version to pin to during the window — whichever line a project tracked, a poisoned release was waiting in it. Security researchers at Socket.dev were among the first to flag the activity, and follow-on analysis from firms including JFrog, Endor Labs, SafeDep, and Mend.io filled in additional technical detail over the following days.

Researchers have linked the campaign to the broader Shai-Hulud malware family — the same self-replicating npm worm lineage first documented in September 2025 and observed again in multiple waves since, including attacks tied to SAP-maintained packages and the AntV ecosystem. Some analysts have nicknamed this particular variant "Trinitite" based on a string found inside the obfuscated payload. Whether it's the same operators or copycats reusing leaked tooling is still an open question — researchers have noted overlapping techniques without confirming shared attribution.

Understanding Mini Shai-Hulud and Why Provenance Wasn't Enough

Diagram explaining npm provenance and GitHub Actions trusted publishing, showing how a signed and verified package with valid attestations still shipped malicious code in the Mini Shai-Hulud supply-chain attack.

If you've been in this industry for more than a couple of years, you've probably told a junior developer at some point: "check that the package has provenance, check that it's signed, and you're good." This incident is a useful, uncomfortable reminder that provenance answers a narrower question than most people assume.

npm provenance proves that a specific automated workflow produced a specific artifact. It does not prove that the source code fed into that workflow was safe. In this case, the compromised releases were signed through GitHub Actions trusted publishing with valid attestations attached — meaning every automated check a developer might run would have shown a green checkmark. The problem lived one layer upstream, in how the publishing workflow decided what to build in the first place.

How the Attack Actually Worked

Diagram showing how a comment-triggered GitHub Actions release workflow was abused to check out code from an attacker's fork and publish it to npm using the repository's trusted publishing identity, without verifying the commenter.

The root cause traces back to a flaw common in "comment-triggered" CI/CD automation. The project's release workflow could be triggered by a comment on a pull request. When triggered, it checked out the code from that pull request's source — including forks — and then published the result using the repository's trusted publishing identity.

The critical gap: the workflow did not verify that the person leaving the comment was a trusted maintainer or contributor. A threat actor using the GitHub account p00paboot opened a pull request from a fork containing malicious code, then left a comment that triggered the release job. The workflow dutifully checked out the fork's code, built it, signed it with the project's legitimate identity, and published it to npm — no compromised maintainer credentials required.

This is a textbook example of why "who has publish access" and "what can trigger a publish" are two different security questions, and both need answering.

What the Payload Did Once Installed

Malicious npm package payload stealing credentials and tokens and spreading across GitHub, cloud, CI/CD, npm, RubyGems, and PyPI

The malicious code activated during installation through two separate mechanisms, depending on the release: a manipulated binding.gyp build-configuration file that abused node-gyp's handling of native build steps, and — in later releases — an explicit preinstall script in package.json. Either path launched a heavily obfuscated JavaScript file that unpacked itself through multiple decoding layers before executing.

Once running, researchers observed the payload doing the following:

  • Scanning local files, running processes, environment variables, and CI/CD variables for access tokens and credentials
  • Querying cloud metadata services (AWS, Azure, GCP) commonly reachable from CI runners and cloud instances
  • Validating whether stolen tokens actually worked before using them further
  • Encrypting harvested data and staging it inside attacker-created public GitHub repositories
  • Modifying GitHub Actions workflow files, likely to establish persistence or enable further automated abuse
  • Adding background commands to AI coding-assistant configuration files on the infected machine
  • Attempting to reuse stolen registry credentials to republish itself across additional npm packages, and — notably for this wave — RubyGems and PyPI as well

In short: this wasn't a smash-and-grab. It was designed to convert one compromised install into a foothold for lateral movement across a developer's entire toolchain — source control, package registries, cloud accounts, and CI infrastructure.

Indicators of Compromise (IOCs)

Indicators of compromise for malicious npm package including affected versions, payload files, GitHub account, persistence paths, and staging artifacts

If your environment touched this package around the compromise window, the indicators below (compiled from public research by Socket.dev and follow-on analysis) are worth checking against your logs, lockfiles, and installed node_modules directories.

TypeIndicator
Malicious package@7nohe/openapi-react-query-codegen
Malicious versions0.5.4, 0.5.5, 1.6.3, 1.6.4, 2.2.1, 2.2.2, 3.0.3, 3.0.4 (plus two pre-release hash-tagged builds)
Last known-good versions0.5.3, 1.6.2, 2.2.0, 3.0.2
Threat actor GitHub accountp00paboot
Obfuscated payload file3FWCvzduYZg.js
Suspicious build filebinding.gyp (abused for command execution)
Related payload filesai_init.js, ai_setup.sh
Persistence (Linux)~/.config/systemd/user/ entries referencing a "sysvinit-detect" naming pattern
Persistence (macOS)~/Library/LaunchAgents/ entry referencing the same naming pattern
Local artifact/var/tmp/.shit (temporary staging path observed by researchers)

Note: IPs, domains, and paths above are drawn from public vendor threat intelligence. Always validate against your own SIEM/EDR data before taking remediation action, and treat any host that installed an affected version as potentially compromised rather than merely "at risk."

Detection: How to Check If You Were Exposed

Detect malicious npm package exposure using npm ls, lockfile searches, CI logs, and incident response checks

If you maintain Node.js projects, run through this checklist before assuming you're clear:

npm ls @7nohe/openapi-react-query-codegen --all

This walks your dependency tree (direct and transitive) for the package. If it returns nothing, you're likely not directly affected, but it's still worth checking lockfiles for historical references if you have long-lived branches or archived CI logs.

grep -r "7nohe/openapi-react-query-codegen" package-lock.json yarn.lock pnpm-lock.yaml

Use this to catch cases where the package was pinned to a specific vulnerable version even if it's not currently installed locally — build logs and lockfile history can reveal exposure that a live npm ls won't.

If you find a match to one of the affected versions published between August 28's two release windows, treat the host or CI runner as potentially compromised — not just "needs an update." That means:

  1. Isolate the affected machine or CI runner from the network before doing anything else
  2. Preserve logs and any relevant forensic evidence before wiping
  3. Identify and neutralize persistence mechanisms (systemd user services, LaunchAgents, modified workflow files) before touching credentials
  4. Only then rotate exposed tokens — npm, GitHub, cloud provider, and any developer-tool API keys accessible from that machine
  5. Rebuild the environment from a known-clean image where practical rather than trying to fully "clean" a compromised host

That ordering — contain, preserve, neutralize persistence, then rotate — isn't arbitrary. Some variants in this malware family have been observed reacting when a monitored token suddenly returns an authentication error, which can trigger additional malicious activity before you've finished cleanup.

Prevention and Hardening Steps

npm supply chain security hardening with dependency pinning, CI/CD isolation, install script controls, credential restrictions, and outbound monitoring

This incident offers a genuinely actionable list of hardening steps, not just "be careful out there" advice:

  • Audit comment-triggered CI/CD workflows. Any workflow that runs code based on issue or PR comments should verify commenter identity against a trusted-contributor list before doing anything with publish credentials.
  • Don't treat provenance as a safety guarantee. Use it as one signal among several — pair it with version pinning, lockfile review, and dependency update monitoring.
  • Pin dependencies and review diffs on updates. Avoid auto-merging dependency bumps for packages with install-time scripts without at least a cursory review.
  • Restrict install script execution where possible. Tools and flags that disable arbitrary lifecycle scripts (preinstall/postinstall) during CI installs reduce blast radius significantly.
  • Isolate CI runner credentials by scope. A compromised build shouldn't have standing access to your cloud infrastructure, source control admin functions, and package publishing all at once.
  • Monitor for anomalous outbound connections from build environments, especially to code-hosting APIs, package registry token endpoints, and cloud metadata services during install steps.

Expert Tips From the SOC Trenches

SOC analyst monitoring npm supply chain threats with behavioral detection, CI/CD threat modeling, and malicious package activity

A few practical notes worth internalizing beyond this specific incident:

First, "the package I use is popular and well-maintained" is not a security control. Popularity increases the blast radius of a compromise; it doesn't reduce the likelihood of one. If anything, popular packages are more attractive targets precisely because of their download counts.

Second, build automation deserves the same threat-modeling rigor as production infrastructure. Teams spend enormous effort locking down who can deploy to production, then leave CI/CD publishing workflows wired up to accept triggers from semi-public surfaces like PR comments. Attackers have noticed.

Third, this campaign's overlap with earlier Shai-Hulud waves is a reminder that once tooling for a supply-chain worm exists — especially if any part of it becomes open-sourced or leaked — it tends to resurface with new operators and cosmetic changes. Detection signatures built for "the original campaign" age quickly; behavioral detection (unusual install-time network activity, unexpected token validation calls) ages much better.

Related Cybersecurity Topics You Should Explore

Frequently Asked Questions

Q: Is @7nohe/openapi-react-query-codegen still dangerous to install today?
A: The ten malicious versions were removed from the npm registry, and the maintainers redirected the latest tag back to a clean release. Always verify you're pulling a version published after the compromise window and confirm it against the maintainer's official security advisory before considering the package safe again.

Q: How is this different from the original Shai-Hulud worm from 2025?
A: The core objective — credential theft and self-propagation across package registries — is similar, and researchers have found overlapping tooling and techniques. This wave adds PyPI as a propagation target alongside npm and RubyGems, and uses a comment-triggered CI workflow abuse technique rather than relying solely on stolen maintainer credentials.

Q: Can npm provenance checks alone protect me from this kind of attack?
A: No. Provenance confirms which workflow built an artifact, not that the underlying source code is safe. This incident specifically demonstrates a case where provenance was valid but the release itself was malicious.

Q: What should CI/CD administrators do right now?
A: Review any release or publish workflow that can be triggered by PR comments, issue comments, or other externally-influenceable events, and add trusted-contributor verification before those triggers are allowed to run with publish-level permissions.

Q: Were enterprise environments confirmed to be affected?
A: Public research has documented the package's compromise and its download volume, but has not published a confirmed list of affected organizations. Any team using the package during the exposure window should assume potential impact and investigate rather than wait for formal notification.

Conclusion

The @7nohe/openapi-react-query-codegen compromise isn't remarkable because of some exotic new exploitation technique — it's remarkable because it exploited a trust assumption most teams don't even realize they're making. A signed, provenance-verified package from a legitimate, popular project turned out to be exactly as dangerous as an unsigned one, because the attacker found the one gap in the chain that verification doesn't cover: who's allowed to trigger a build.

If your team runs Node.js projects with automated dependency updates, take twenty minutes this week to audit your CI/CD publish triggers and check your lockfiles against the IOCs above. It's a small investment against a threat family that has now resurfaced multiple times in the past year and shows no sign of slowing down.

Got thoughts on this incident or questions about auditing your own CI/CD pipeline for similar exposure? Drop a comment below, and share this with your DevOps or SOC team if you think they'd want a heads-up.

Shubham Chaudhary

Welcome to Xpert4Cyber! I’m a passionate Cyber Security Expert and Ethical Hacker dedicated to empowering individuals, students, and professionals through practical knowledge in cybersecurity, ethical hacking, and digital forensics. With years of hands-on experience in penetration testing, malware analysis, threat hunting, and incident response, I created this platform to simplify complex cyber concepts and make security education accessible. Xpert4Cyber is built on the belief that cyber awareness and technical skills are key to protecting today’s digital world. Whether you’re exploring vulnerability assessments, learning mobile or computer forensics, working on bug bounty challenges, or just starting your cyber journey, this blog provides insights, tools, projects, and guidance. From secure coding to cyber law, from Linux hardening to cloud and IoT security, we cover everything real, relevant, and research-backed. Join the mission to defend, educate, and inspire in cyberspace.

Post a Comment

Previous Post Next Post
×

🤖 Welcome to Xpert4Cyber

Xpert4Cyber shares cybersecurity tutorials, ethical hacking guides, tools, and projects for learners and professionals to explore and grow in the field of cyber defense.

🔒 Join Our Cybersecurity Community on WhatsApp

Get exclusive alerts, tools, and guides from Xpert4Cyber.

Join Now