Home » npm typosquat targets GitHub Actions to steal tokens and artifacts

npm typosquat targets GitHub Actions to steal tokens and artifacts

npm typosquat “@acitons/artifact” exfiltrating GitHub Actions tokens during postinstall in CI The fake “@acitons/artifact” package harvests GitHub Actions tokens via postinstall and attempts artifact publishing as GitHub

Initially, the adversary published “@acitons/artifact,” a near-match to @actions/artifact, then relied on postinstall execution to run attacker-hosted code. Consequently, build jobs that pulled the fake package exposed GitHub Actions tokens, enabling attempts to publish artifacts as if they were GitHub itself. Therefore, the incident highlights how typosquatting plus default install hooks can turn a routine dependency update into a CI credential breach.

𝗧𝗵𝗿𝗲𝗮𝘁 𝗡𝗮𝗿𝗿𝗮𝘁𝗶𝘃𝗲: from package install to artifact abuse

First, the package appeared in late October 2025 and quickly accumulated thousands of downloads across the week. Next, multiple versions (notably 4.0.12 through 4.0.17) embedded a postinstall hook that fetched a “harness” payload from a Git hosting account; afterward, a script named verify.js checked GITHUB_ environment variables typical of GitHub Actions. Then, the script encrypted and staged stolen data to an app.github.dev endpoint, aligning with a design that blends into normal developer infrastructure. Ultimately, investigators report the actor removed malicious versions after exposure, leaving a benign 4.0.10 visible on npm, while total downloads remained significant.

𝗧𝗲𝗰𝗵𝗻𝗶𝗰𝗮𝗹 𝗕𝗿𝗲𝗮𝗸𝗱𝗼𝘄𝗻: postinstall, tokens, and artifact workflows

Because npm postinstall runs during dependency installation, malicious code executes before tests or gating steps. Accordingly, the payload enumerates default GitHub Actions variables and harvests ephemeral tokens with publish permissions. Meanwhile, artifact operations related to @actions/artifact and @actions/upload-artifact provide realistic cover traffic in CI logs, so superficial audits may miss hostile activity. Consequently, defenders must treat install-time hooks as high risk within CI and gate third-party packages with allowlists and lockfiles. 

𝗜𝗻𝗱𝗶𝗰𝗮𝘁𝗼𝗿𝘀 𝗮𝗻𝗱 𝗘𝘃𝗶𝗱𝗲𝗻𝗰𝗲 𝗣𝗮𝘁𝗵𝘀, CI signals that actually surface abuse

Therefore, review workflow runs that unexpectedly fetched “@acitons/artifact” instead of @actions/artifact. Additionally, inspect build logs for postinstall network beacons, shell script downloads labeled “harness,” and staging toward app.github.dev. Moreover, correlate artifact creation events with token usage from unfamiliar IPs or runners. Finally, compare package-lock.json or pnpm-lock.yaml diff noise around minor version bumps just before artifacts changed ownership. 

𝗔𝗳𝗳𝗲𝗰𝘁𝗲𝗱 𝗦𝘂𝗿𝗳𝗮𝗰𝗲 𝗮𝗻𝗱 𝗣𝗿𝗲𝗰𝗼𝗻𝗱𝗶𝘁𝗶𝗼𝗻𝘀, why pipelines were vulnerable

Because CI environments often grant broad, long-lived tokens, a single dependency typo can escalate into organization-wide artifact publishing abuse. Additionally, many projects allow postinstall scripts, fetch latest tags loosely, and rely on human review for dependency diffs. Consequently, attackers exploit typosquats, version drift, and implicit trust in postinstall.

𝗗𝗲𝘁𝗲𝗰𝘁𝗶𝗼𝗻 𝗮𝗻𝗱 𝗖𝗼𝗻𝘁𝗮𝗶𝗻𝗺𝗲𝗻𝘁: practical moves for GitHub Actions

Immediately, force a dependency hygiene pass to pin @actions packages and ban postinstall in CI unless explicitly required. Next, alert on npm install phases that open outbound connections; then, quarantine runners and rotate secrets if the fake scope appears. Afterward, invalidate tokens used for artifact publishing, approve only Trusted Publishing, and reduce scopes and lifetimes to the minimum. Finally, enable FIDO-based MFA for maintainers and admins and require approvals on artifact uploads and workflow changes. 

𝗛𝗮𝗿𝗱𝗲𝗻𝗶𝗻𝗴 𝗮𝗻𝗱 𝗥𝗲𝗺𝗲𝗱𝗶𝗮𝘁𝗶𝗼𝗻, tighten the CI blast radius

Adopt allowlisted registries and internal mirrors; moreover, run npm ci with a vetted lockfile and node-modules cache scanning. Additionally, disable script hooks in CI where possible (e.g., npm config ignore-scripts=true for build steps that do not require them). Then, move to short-lived, least-privilege tokens, Trusted Publishing, and repository rules that gate workflow edits. Meanwhile, train reviewers to spot typo-scoped packages and ensure secret scanning covers build logs.

𝗪𝗶𝗱𝗲𝗿 𝗖𝗼𝗻𝘁𝗲𝘅𝘁: ongoing npm supply-chain pressure

Recently, campaigns such as PhantomRaven, Shai-Hulud, and credential-stealing clusters hit developers with typosquats, wormable propagation, and CI backdoors. Therefore, this npm incident fits a broader pattern of targeting CI/CD to steal tokens and republish tampered code. Consequently, defenders should prioritize identity-first protections, telemetry on workflow variables, and strict package governance.

FAQs 

Q1. How did the fake package steal GitHub tokens in CI?
A1. It executed a postinstall hook, fetched a payload, read GITHUB_ variables, and exfiltrated tokens before tests or approvals ran. 

Q2. Why did logs look normal during the attack?
A2. The flow used expected artifact actions and ordinary HTTP calls, so shallow reviews resembled routine build traffic. Tight token scopes and network egress controls expose anomalies.

Q3. What immediate actions should defenders take?
A3. Pin @actions dependencies, set ignore-scripts where viable, rotate tokens, enforce FIDO2 MFA, shorten token lifetimes, and adopt Trusted Publishing for releases.

Q4. How does this relate to broader npm threats like Shai-Hulud?
A4. The pattern token theft in CI and republishing matches recent campaigns that spread via maintainers and build workflows, reinforcing CI as a prime target.

Leave a Reply

Your email address will not be published. Required fields are marked *