TL;DR: A two-stage npm supply chain attack let polymarket-stake-math disguise a clean math library before swapping in a 2,255-line infostealer that harvested browser sessions, crypto wallets, Telegram data, and cloud and developer secrets, then shifted delivery to hot-swappable Vercel infrastructure, according to Panther. The pattern shows why install-time review alone is no longer enough when developer endpoints hold both human credentials and non-human identity material.
At a glance
What this is: Panther documents a two-stage npm supply chain malware campaign that hid a clean library before delivering an infostealer aimed at developer credentials, wallets, and sessions.
Why it matters: It matters because developer workstations now hold both human access and NHI material, so package review, endpoint monitoring, and credential hygiene have to assume post-install tampering.
Context
This attack sits at the intersection of software supply chain risk, developer workstation compromise, and identity theft. A package can look safe at publication time and still become malicious after install, which defeats any control model that assumes the published artifact is the whole risk surface. For identity teams, the important point is that developer laptops often hold browser sessions, API tokens, and machine credentials alongside personal access.
The article also shows why NHI governance is now part of software supply chain defense. When a developer machine contains cloud keys, npm tokens, GitHub tokens, and project secrets, compromise is not limited to the endpoint itself. It becomes a path into build pipelines, cloud accounts, and downstream services, which makes lifecycle control of secrets and tokens a shared IAM and engineering concern.
Key questions
Q: What breaks when malicious npm packages are reviewed only at publish time?
A: Publish-time review misses the key deception in staged supply chain attacks: the package can be clean when inspected and malicious only after installation or after a later version update. That means the real risk is runtime behaviour, especially postinstall hooks, file replacement, and outbound connections from lifecycle processes. Defenders need execution-time visibility, not just repository trust.
A: Developer machines often hold publishing tokens, SSH keys, and credentials with broad access to source control and CI/CD systems. If malware executes on open or import, it can harvest secrets from memory or local files and use them to spread further. That turns a single infected workstation into a high-impact foothold for wider compromise.
Q: What are the signs that post-install malware is active in a package?
A: Look for node processes spawned by install events, outbound connections during installation, files rewritten inside node_modules, and sudden multipart uploads from a newly installed package. Those signals point to a package that is behaving like a dropper rather than a library.
Q: What should organisations do first when a developer secret has already been exposed?
A: The first response is to revoke or rotate every exposed credential, including passwords, API tokens, SSH keys, and cloud access keys. Then review repositories, pipelines, and recent activity for suspicious use. After containment, teams should notify affected owners and add stronger prevention controls so the same leak pattern does not recur.
Technical breakdown
How the npm dropper changes after installation
The attack uses a two-stage dropper so the package can appear benign during review and malicious after install. A postinstall hook executes code as soon as the package lands on disk, then the dropper fetches or swaps in the payload from attacker-controlled infrastructure. In later versions, the payload source moved off npm and to a Vercel-hosted endpoint, which reduces reliance on the registry and makes the delivery path easier to change. This design separates what a reviewer sees from what the installer actually runs.
Practical implication: monitor lifecycle scripts, outbound network activity, and post-install file changes, not just published source.
Why developer endpoints expose human and NHI secrets together
Developer machines often accumulate browser cookies, saved passwords, wallet files, shell history, and project secrets in one place. That makes them attractive because one compromise can capture both human identities, such as browser sessions, and non-human identities, such as cloud keys, npm auth tokens, GitHub tokens, and API credentials. The malware in this campaign explicitly searches across browser profiles, wallet stores, .env files, and common credential locations, which shows a broad data-harvest model rather than a single-purpose theft.
Practical implication: treat developer endpoints as high-value identity concentration points and reduce what sensitive secrets ever reach them.
Why hot-swappable exfiltration defeats indicator-based detection
The campaign is engineered so that one domain or one payload hash will not stay valid for long. Environment variables can redirect the package name, target version, payload spec, and C2 URL, while the operator can pivot delivery infrastructure without republishing the initial lure. That means indicator-only controls age quickly, especially when the attacker can swap payloads after install or shift exfiltration to a different host. Behavioral detection is stronger because the malicious pattern is in the install-time fetch, file overwrite, and multipart upload behavior.
Practical implication: build detections around behavior, not fixed hashes, domains, or a single package version.
Threat narrative
Attacker objective: The attacker wants to steal developer-held credentials and wallet access so they can hijack accounts, move funds, and pivot into connected cloud or build environments.
- Entry begins with a seemingly legitimate npm package published under a throwaway account and disguised as a useful Kelly criterion helper for Polymarket developers.
- Credential access occurs when the postinstall dropper runs and the payload harvests browser sessions, wallet material, shell history, and cloud and developer tokens from the host.
- Exfiltration follows as the stealer chunks collected files and posts them to attacker-controlled infrastructure that can be changed quickly through configuration variables.
- Impact is account takeover and downstream compromise of developer-managed wallets, sessions, and cloud or CI identities.
Breaches seen in the wild
- Firebase misconfiguration exposure 2024: Missing Firebase security rules on 916 websites exposed 125 million user records and 19.87 million plaintext passwords; a quarter were fixed.
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
Benign-first staging is now a supply chain control failure, not just a malware tactic. The important governance gap is that package trust is still often anchored to a single review point, even when the attacker can change the package after install. For identity programmes, that means the credential exposed at runtime may never have been present in the code you reviewed. Practitioners should treat post-install behavior as part of package identity.
Developer endpoints are identity aggregation points, not ordinary user laptops. This campaign works because browser sessions, cloud keys, and NHI secrets co-exist on the same device. That collapses the boundary between human identity theft and machine identity abuse, which is why IAM, PAM, and engineering controls now need a shared view of endpoint-held secrets. The practitioner conclusion is to reduce credential residency on developer machines wherever possible.
Hot-swappable payload infrastructure creates detection debt. When the operator can pivot from registry delivery to Vercel-hosted C2 and override payload settings through environment variables, static indicators decay faster than teams can operationalise them. The named concept here is post-install trust collapse: the point where a trusted package cannot be assumed to remain the same object after installation. Teams should shift to behavioral detection and package integrity verification.
Supply chain malware is now a NHI governance issue, not only a code review issue. The campaign targets npm auth tokens, GitHub tokens, cloud keys, and browser sessions in one sweep, so compromise extends well beyond source code. That makes secret inventory, token lifecycle, and developer workstation containment part of the same control plane. Practitioners should align software supply chain controls with identity governance, not treat them as separate disciplines.
Credential theft from developer tooling accelerates downstream compromise of build and cloud estates. Once an attacker steals a developer's tokens, the next step is often lateral access into repositories, CI systems, or cloud accounts. That is where the NHI angle becomes operational rather than theoretical: the stolen objects are active non-human identities with real privileges. Security teams should assume repository and pipeline access are part of the blast radius.
From our research library:
- Only 44% of developers are reported to follow security best practices for secrets management, exposing a significant developer behaviour gap, according to the State of Secrets in AppSec.
- Read next: API Key Management Guide
What this signals
Post-install trust collapse: the key governance problem is that a package can look legitimate at publication time and become malicious only after installation. Teams should assume package identity is mutable until runtime controls prove otherwise, and they should verify what the package does after install, not only what the repository showed at review time.
Developer tooling and IAM are now tightly coupled because the same workstation can hold browser sessions, cloud credentials, package tokens, and wallet material. According to the State of Secrets in AppSec, only 44% of developers are reported to follow security best practices for secrets management, which means the control gap is as much behavioural as technical.
For practitioners
- Inspect install lifecycle behavior Alert on npm, yarn, or pnpm install hooks that spawn node processes making outbound network connections or rewriting package files after installation.
- Reduce secrets on developer hosts Move cloud keys, npm auth tokens, GitHub tokens, and API credentials out of local developer environments wherever the workflow allows.
- Harden browser and wallet session handling Assume browser-saved passwords, cookies, wallet files, and Telegram sessions on developer laptops are high-value targets and plan for rapid revocation after exposure.
- Detect post-install exfiltration patterns Hunt for multipart uploads, temp-directory extraction, and file overwrites in node_modules immediately after package installation.
- Rotate downstream credentials aggressively Treat any developer machine that installed the package as a source of compromise for cloud secrets, package tokens, and project-level credentials.
Key takeaways
- This attack shows that a package can be safe-looking during review and still become a credential theft platform after installation.
- The exposed blast radius includes browser sessions, wallet access, cloud secrets, and build-system tokens, not just local files.
- The most effective controls are runtime behavioural detection, secret minimisation on developer machines, and rapid credential rotation after compromise.
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 NIST CSF 2.0 sets the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-02 — Secret Leakage | The malware steals browser, cloud, and package secrets from developer endpoints. |
| NHI-07 — Long-Lived Secrets | The attack succeeds because usable tokens and sessions persist on developer machines. | |
| NHI-10 — Human Use of NHI | The campaign targets human-operated developer machines that also hold machine credentials. | |
| Recommendation — Scan developer environments for exposed secrets and revoke any credentials that may already be leaked. Shorten secret lifetime and remove persistent credentials from developer workstations where possible. Separate human access from machine credentials so developer endpoints do not become identity concentration points. | ||
| MITRE ATT&CK | TA0006;TA0010 — Credential Access; Exfiltration | The package steals credentials and sends them out over web services. |
| Recommendation — Map install-time theft and outbound uploads to TA0006 and TA0010 in your detection logic. | ||
| NIST CSF 2.0 | PR.AA-05 — Access Permissions, Entitlements and Authorizations | The issue is misuse of stored credentials and excessive access on developer endpoints. |
| Recommendation — Review and restrict entitlements tied to developer-held credentials before they can be abused. | ||
Key terms
- Postinstall Dropper: A postinstall dropper is malicious code that runs after a package is installed and then fetches a second-stage payload from an external server. Attackers use it to hide initial intent, execute additional actions, and sometimes remove traces after delivery. It is a common supply chain technique for turning a package install into active compromise.
- Supply Chain Malware: Malware delivered through trusted software distribution paths such as packages, dependencies, or build tooling. It succeeds by inheriting trust from legitimate workflows, which makes publication-time checks insufficient if the malicious behaviour appears only after install or in a later version.
- Developer Endpoint Secret Concentration: Developer endpoint secret concentration describes the accumulation of credentials, tokens, sessions, and deployment material on workstations used for coding and release tasks. It increases blast radius because one compromised host can expose multiple identity systems, cloud environments, and source-control accounts at once.
- Hot-Swappable Exfiltration: Hot-swappable exfiltration is a malware design pattern that allows an operator to change payload delivery or collection destinations without republishing the malicious package. It makes static indicators fragile and pushes defenders toward behavioral detection and runtime integrity checks.
Deepen your knowledge
The NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, workload identity, and secrets management. It helps security and identity practitioners connect token lifecycle control to real-world blast-radius reduction.
Published by the NHIMG editorial team on August 1, 2026.
Updated on October 13, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org