TL;DR: A malicious pgserve npm release injected a 1,143-line credential-harvesting script, propagated by reusing found npm publish tokens, and pushed stolen data to an Internet Computer Protocol canister, according to Arnica. The incident shows that SBOM visibility and continuous SCA scanning only help when teams can find and contain impacted packages fast.
At a glance
What this is: Arnica says malicious pgserve npm releases turned a development dependency into a credential-harvesting supply-chain worm that could spread through npm publish tokens.
Why it matters: For IAM, NHI, and supply-chain security teams, the issue is not only detecting compromised packages but finding every affected dependency fast enough to contain propagation.
By the numbers:
- Malicious versions 1.1.11, 1.1.12 and 1.1.13 of pgserve were published to the npm registry on April 21, 2026.
- The compromised pgserve release injected a 1,143-line credential-harvesting script that executes automatically on every npm install.
- The last legitimate pgserve release was v1.1.10, tagged on April 17, 2026.
Context
The core problem in this case is software supply-chain trust, not a single broken endpoint. A development package can become an attack path when package-manager defaults allow fresh, unsigned, or unreviewed code to run during install, and when the estate cannot rapidly answer which repositories ever resolved the affected version.
For identity and access teams, the important intersection is machine credentials inside developer environments. Publish tokens, API keys, and other secrets can be harvested and reused at machine speed, which turns an ordinary package compromise into a propagation mechanism. The incident is typical of modern supply-chain abuse, where discovery speed matters as much as initial detection.
Key questions
Q: What breaks when malicious npm packages execute during CI/CD installs?
A: The main failure is that package installation becomes code execution inside a trusted build context. That lets attacker-controlled scripts read memory, steal secrets, and potentially publish more malicious artifacts before defenders notice. The control that breaks is the assumption that dependency installation is operationally harmless. Treat install-time execution as a governed security boundary, not a routine developer convenience.
Q: Why do publish tokens make supply-chain compromises much harder to contain?
A: Publish tokens can extend a single compromise into many repositories because they authorize package updates across trusted registry workflows. Once stolen, they support re-infection and downstream spread rather than just one-off access. That is why publish privileges should be treated like high-risk machine identities with tight scope and rapid revocation.
Q: How do security teams know if a package compromise is actually contained?
A: They should confirm three things: the bad version no longer appears in lockfiles, SBOM records no longer resolve to it, and running services no longer load it. If any one of those still matches, the compromise is not contained. Re-scan after remediation and require evidence from both code and runtime.
Q: Should organisations prioritise provenance or dependency scanning first?
A: Provenance should come first when the environment is AI-assisted, because scanning can only inspect what is already present. Provenance answers the harder question of whether an artefact, dependency, or build step was introduced through authorised paths. Scanning remains necessary, but it cannot compensate for unknown origin.
Technical breakdown
How a malicious npm package becomes an install-time payload
Package compromise often starts when an attacker publishes a trojanised dependency that preserves the package name and enough expected behaviour to avoid immediate suspicion. In this case, the malicious pgserve versions executed a credential-harvesting script during npm install, which is especially dangerous because install hooks run in developer and CI contexts where secrets are commonly present. The key technical issue is not only code execution, but trust granted to package-manager automation. Once install-time scripts are allowed, the dependency boundary collapses and the package can read environment variables, local token caches, and other machine-held secrets before any runtime monitoring sees it.
Practical implication: Block or constrain install-time script execution for untrusted packages and treat package-manager defaults as an attack surface.
Why publish tokens turn one compromise into a worm
A supply-chain worm uses the victim’s own publishing rights to widen the blast radius. If malware finds an npm publish token, it can republish itself into every package that token is allowed to maintain, which converts a single infected workstation or CI runner into a distribution node. This is a machine-identity problem as much as a software problem: the token is a non-human credential with standing authority over package publication. Because the propagation uses legitimate publishing channels, traditional perimeter controls do little once the token is exposed. The attacker no longer needs to break in again because the compromised identity can do the spreading for them.
Practical implication: Limit publish-token scope, rotate exposed machine credentials immediately, and separate build-only and publish-authority identities.
How SBOM search speed changes containment outcomes
An SBOM only helps when teams can search it quickly enough to answer whether the compromised component exists anywhere in the estate. Here, the value is not abstract inventory but time to impact reduction: teams need to identify every repository, build path, and package resolution that ever touched the bad version. Continuous SCA scanning matters because pull-request checks miss old dependencies that were already resolved before disclosure. The operational question is whether the organisation can move from disclosure to scope identification in minutes, not days. Without that speed, the compromise may persist long enough to be republished or reintroduced elsewhere.
Practical implication: Continuously index dependency resolution history so compromised packages can be traced across all repositories and build systems.
Threat narrative
Attacker objective: The attacker aimed to harvest machine-held credentials and turn publish authority into a self-spreading supply-chain compromise.
- Entry occurred when malicious pgserve versions were published to npm and pulled in through ordinary dependency installation.
- Credential access followed as the install-time script harvested secrets from the victim machine, including npm publish tokens when present.
- Escalation and propagation happened when the stolen publish token was used to re-inject the malware into every package that token could publish.
- Impact was wider package contamination and exfiltration of stolen credentials to a hardened external endpoint.
Breaches seen in the wild
- CanisterSprawl npm worm 2026: The CanisterSprawl worm stole npm and PyPI publish tokens from installs of pgserve and Namastex packages and republished victims' packages.
- axios npm compromise 2026: North Korea-linked UNC1069 hijacked an axios maintainer's npm account to ship a backdoor that bots pulled into public repos within minutes.
Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.
NHI Mgmt Group analysis
Supply-chain search latency is now a governance control: this incident shows that inventory accuracy matters less than resolution speed once a malicious package is public. The estate must be searchable by package version, publish window, and dependency path, because a slow answer leaves the worm enough time to spread. Practitioners should treat SBOM query performance as a containment capability, not a reporting feature.
Machine publish tokens create self-amplifying exposure: when a non-human identity can publish packages, that identity becomes part of the attack surface. A stolen token is not just a secret leak, it is a replication right that can be used to extend compromise through trusted channels. The governance lesson is to treat publish authority as privileged infrastructure, not routine developer convenience.
Install-time execution is the decisive failure mode: the compromise worked because package installation could execute attacker-controlled code before downstream controls had a chance to assess it. Cooldown periods, script suppression, and provenance checks all reduce the chance that a fresh malicious release reaches a live pipeline. Practitioners should assume that any package-manager path capable of running scripts can become a credential collection point.
Continuous SCA is more defensible than PR-only scanning: pull-request gates cannot find historical exposure in repositories that already resolved the bad version. That gap matters in incidents where the same component may have been consumed long before disclosure. Teams should align their dependency controls to NIST SSDF and SLSA-style provenance thinking, because build trust now depends on historical traceability as much as present-day approval.
Owning the blast radius concept is the next step for identity teams: the right question is not whether a package was compromised, but whether the associated machine identities were allowed to spread that compromise further. This is a clear NHI governance issue because secret-bearing build and publish identities can turn software distribution into a propagation channel. Practitioners should close the gap between dependency trust and credential governance.
From our research library:
- 59% of compromised machines in a major 2025 supply chain attack were CI/CD runners rather than personal workstations, according to the State of Secrets Sprawl 2026.
- The blast radius of the Salesloft-Drift OAuth supply chain attack was 10 times greater than earlier incidents in which attackers breached Salesforce directly.
- Read next: AI Supply Chain Security and AI-BOM Guide
What this signals
Supply-chain blast radius is now a credential-governance problem: when a package install can harvest secrets and a publish token can republish the same payload, machine identity controls become part of software containment. The practical shift is toward tighter publish scopes, shorter token lifetimes, and faster revocation paths for build and release identities.
Searchability beats static inventory in fast-moving compromise: teams that can query every repository, branch and build resolution for a bad dependency will reduce exposure faster than teams that rely on periodic review. SBOM quality still matters, but only if it can be searched quickly enough to drive action.
Package cooldowns and script suppression are now baseline guardrails: the best defence against newly weaponised dependencies is to prevent them from executing before community detection has time to work. NIST SSDF and SLSA both support the broader direction of reducing trust in unreviewed build inputs.
For practitioners
- Search the SBOM for impacted versions Filter dependency inventories for pgserve versions 1.1.11, 1.1.12 and 1.1.13, then trace every repository and build path that ever resolved them.
- Quarantine publish tokens used by affected workflows Assume any npm publish token present on an infected host or runner may have been harvested and remove its ability to publish until reissued.
- Disable install-time scripts where possible Turn on ignore-scripts and apply package-manager controls that stop fresh packages from executing arbitrary install hooks during dependency resolution.
- Apply a package cooldown window Set a minimum age threshold, such as a seven-day cooldown, so newly published packages cannot enter build pipelines before initial abuse detection has time to work.
- Separate build and publish identities Use distinct machine identities for building, testing and publishing so a compromised development token cannot automatically become a release mechanism.
Key takeaways
- A malicious dependency can turn install-time convenience into secret theft, and that risk grows when package-manager defaults allow arbitrary scripts to run.
- The important evidence in this case is not just the malware payload, but the way publish tokens and SBOM search speed determine how far the compromise spreads.
- Teams reduce exposure by combining fast dependency search with cooldown windows, script suppression and tighter control over machine publishing identities.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 and MITRE ATT&CK address the attack and risk surface, while CIS Controls v8, NIST CSF 2.0 and SLSA set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-02 — Secret Leakage | The incident harvested machine secrets during dependency install and from publish-capable hosts. |
| NHI-07 — Long-Lived Secrets | Publish tokens with long lifetimes enabled the worm to spread through legitimate package channels. | |
| NHI-05 — Overprivileged NHI | A stolen publish token could republish malware into every package it was allowed to maintain. | |
| Recommendation — Scan build and developer environments for exposed NHI secrets and revoke anything harvested during compromise. Shorten token lifetimes and replace standing publish credentials with tightly scoped, revocable machine identities. Reduce publish authority to the minimum package scope needed and separate build identities from release identities. | ||
| MITRE ATT&CK | TA0006;TA0042;TA0010 — Credential Access; Resource Development; Exfiltration | The worm harvested secrets, used them to expand access, and exfiltrated stolen data. |
| Recommendation — Map the compromise to credential access, resource development and exfiltration to prioritise detections and containment. | ||
| CIS Controls v8 | CIS-5 — Account Management | Publish tokens and build identities need lifecycle control, scope restriction and revocation. |
| Recommendation — Apply account management discipline to machine identities and revoke stale or exposed publishing credentials. | ||
| NIST CSF 2.0 | PR.AA-05 — Access Permissions, Entitlements and Authorizations | The incident exploited overly broad entitlements on machine credentials used for publishing packages. |
| Recommendation — Review and trim entitlements on package-publishing identities so compromise cannot spread through trusted channels. | ||
| SLSA | L3 — Build provenance | The case shows why provenance and trusted build inputs matter when malicious packages enter pipelines. |
| Recommendation — Adopt stronger build provenance checks so unreviewed packages cannot reach release workflows unchecked. | ||
Key terms
- Supply Chain Worm: A supply chain worm is malware that uses one compromise to propagate into adjacent packages, repositories, or automation systems. In identity terms, it becomes far more dangerous when it can harvest and replay secrets that let it publish, move, or persist without further exploitation.
- Publish token: A credential that authorises a package maintainer or automation process to publish or overwrite software artefacts. In identity terms, it is a high-value non-human credential with direct supply chain impact, so it needs rotation, scope limitation, and strict lifecycle ownership.
- Install-Time Script: An install-time script is code that executes when a package is installed, before the package has necessarily been validated in context. Attackers abuse these scripts because they can trigger silently in developer machines and CI systems, turning dependency installation into an execution path.
- Sbom Searchability: SBOM searchability is the ability to query software inventory quickly enough to locate affected dependencies, versions and build paths after a compromise. It is a practical containment capability, not just a reporting feature, because speed determines whether exposure is narrowed or allowed to spread.
Deepen your knowledge
NHI Mgmt Group covers identity security, NHI governance, and agentic AI through independent research, practitioner guides, and the NHI Foundation Level course. It is built for security teams that need to govern machine credentials, service identities, and access lifecycle decisions with clarity.
Published by the NHIMG editorial team on August 19, 2026.
Updated on October 12, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org