TL;DR: A compromised npm package can turn a frontend dependency into a user-side exploit delivery path, with art-template 4.13.3, 4.13.5, and 4.13.6 appending malicious code into browser bundles that ran in downstream visitors’ browsers, according to Corgea. The incident shows why supply-chain review must extend beyond developer pipelines into runtime exposure, especially for organisations serving bundled JavaScript to end users.
At a glance
What this is: A compromised npm templating library was used to inject malicious code into browser bundles, creating a user-side exploit path in downstream sites.
Why it matters: IAM and application security teams need to treat frontend dependencies as part of the exposed trust boundary, because bundled JavaScript can execute in end-user sessions even when developer pipelines look clean.
Context
npm supply-chain risk is not limited to package installation on developer machines. When a dependency ships browser-side code into a site bundle, the trust boundary extends into the end user’s session, where injected JavaScript can operate with the site’s own origin privileges.
This article is about that boundary shift. A templating package used in frontend builds can become a delivery mechanism for malicious browser behaviour, which matters for identity, session protection, and the handling of browser-readable tokens across SaaS and web applications.
The pattern is not typical of ordinary package tampering that aims at developers first. It is a more direct runtime exposure model, where the downstream user becomes the execution target once the poisoned bundle is served.
Key questions
Q: What breaks when a poisoned npm bundle reaches end users instead of developers?
A: The failure shifts from supply-chain compromise during installation to runtime compromise in the browser. The site may still build successfully, but the delivered JavaScript can execute with origin-level access to DOM state, browser storage, and other client-side data. That makes the application itself the delivery surface, not just the package manager.
Q: Why does a malicious browser bundle create identity and session risk?
A: Because browser-executed code can interact with session cookies, storage-backed tokens, redirects, and page content inside the application’s own origin. If those controls are weak or browser-readable, the attacker may be able to stage further abuse without needing server-side credentials. The risk is therefore part of client-side identity governance, not only software supply chain management.
Q: What signs suggest a frontend dependency is hiding runtime payloads?
A: Look for unexpected remote script loads, conditional behavior based on user agent or referer, and bundle files that change in ways unrelated to the package’s declared function. Staged loaders, hidden iframes, and domain names that do not match the application’s approved delivery chain are strong warning signs that the asset is doing more than it should.
Q: How should teams respond when a browser bundle is confirmed malicious?
A: Rebuild from a clean lockfile, replace the affected dependency version, invalidate cached assets, and review whether exposed user sessions or browser-readable secrets could have been touched. Response should cover both code remediation and user-impact assessment, because the malicious logic may already have executed in live browser sessions.
Technical breakdown
How poisoned browser bundles execute in the site origin
A browser bundle is JavaScript that ships to the user’s browser as part of the application. If malicious code is appended to that bundle, it executes with the same origin context as the rest of the site, which means it inherits whatever the browser can access for that application. That can include DOM state, browser storage, non-HttpOnly cookies, and the ability to load further scripts or iframes. The key shift is that the compromise is no longer limited to build-time or install-time abuse. The payload runs after deployment, in the visitor’s browser, where conventional CI and endpoint controls may not see it.
Practical implication: Treat frontend bundle integrity as an exposure control, not just a build concern.
Why browser-side supply-chain compromise is different from developer token theft
Many npm incidents focus on install scripts, maintainers’ credentials, or CI secrets. Those attacks target the software factory. This incident targets the delivered software itself. The malicious code lives in a package file that downstream builds may copy into static assets, which means the harmful behavior survives the package installation stage and reaches production users. That distinction matters because the offensive objective shifts from stealing developer access to gaining runtime influence over the application’s front end. In practical terms, the security question becomes whether a dependency can alter what end users execute once the site is already live.
Practical implication: Review bundled third-party code as a production execution path, not just a dependency list.
Why runtime filtering can hide malicious loader chains
The reported chain uses staged script loading and user-agent gating, which makes detection harder. A remote server can return different content depending on the request context, so a simple scanner, sandbox crawl, or IOC fetch may not observe the same payload that a real browser sees. If the malicious chain also checks platform and browser characteristics, only a narrow slice of users will receive the payload, reducing visibility in generic telemetry. That is a classic evasion pattern in browser-oriented attacks, and it weakens assumptions that a single observation of a package or script tells the whole story.
Practical implication: Validate suspicious browser dependencies with real browser context, not only static package inspection.
Threat narrative
Attacker objective: Use a compromised frontend dependency to execute malicious code in user browsers and stage further exploitation against selected victims.
- Entry occurred when the poisoned art-template releases were pulled into downstream builds that served lib/template-web.js to site visitors.
- Credential or session abuse followed when the injected script ran in the page origin and could reach browser-accessible data such as storage or non-HttpOnly cookies.
- Impact came from staged browser payload delivery, including hidden script loading and iPhone-gated follow-on modules aimed at Safari/WebKit targets.
Breaches seen in the wild
- Shai Hulud npm malware campaign: Shai Hulud campaign: npm malware exposed secrets on GitHub.
- TrapDoor supply chain campaign 2026: TrapDoor's 34+ malicious npm, PyPI and Crates.io packages stole developer credentials and hid instructions for AI coding assistants. No victims known.
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
Browser bundle compromise expands the supply-chain trust boundary into the customer session. The important failure is not merely that a package was tampered with, but that the compromised code executed in downstream visitors’ browsers. That means front-end dependencies must be governed as production runtime assets, not just build inputs. The practical conclusion is simple: what ships to the browser needs the same provenance discipline as what ships to infrastructure.
Frontend JavaScript is now an identity-adjacent attack surface, not just an application layer. Once a poisoned bundle runs in the site origin, it can touch browser-readable tokens, session state, and DOM-controlled flows that identity teams care about. That creates direct overlap between application supply-chain governance and IAM concerns such as session protection, token storage, and client-side trust assumptions. Organisations should treat browser-executed dependency risk as part of identity and access governance, not as a narrow developer issue.
Runtime filtering and staged payloads create a verification gap that static reviews will miss. The article’s staged loader pattern shows why provenance checks alone are insufficient when malicious logic is hidden behind conditional delivery. This is a form of browser-side delivery obfuscation that undermines simple IOC-based assurance. The control gap is not absence of scanning, but absence of runtime verification across the actual user execution path. Teams need to assume the bundle can behave differently once served.
Poisoned bundle provenance is the right named concept for this incident pattern. The package itself may look legitimate in source control, yet the delivered browser asset carries unauthorized runtime behavior. That distinction matters because the governance failure is about artifact trust after packaging, not just repository hygiene. Practitioners should manage browser bundles as signed, versioned release artifacts with explicit provenance checks before promotion.
What this signals
Browser-side supply-chain compromise is a release governance problem, not only a package screening problem. Security teams need to know where third-party code becomes a browser-executed asset and which release path can push it into production. That makes asset inventory, provenance, and static bundle review part of the same control plane.
Client-side trust boundaries now deserve explicit identity treatment. When JavaScript running in the page origin can reach browser-readable tokens, the distinction between application security and identity governance collapses. Teams should review where session material lives, how it is scoped, and whether client-side code is trusted to handle it at all.
For practitioners
- Pin known-clean browser dependencies Lock art-template to the last known clean release and treat any newer maintainer-controlled release as untrusted until provenance is verified. Rebuild from a clean lockfile rather than promoting opaque package updates into production bundles.
- Scan deployed bundles and static assets Search package manifests, lockfiles, CDN objects, build caches, and deployed assets for affected versions and injected domains such as v3.jiathis and utaq.cfww.shop. Include browser bundle files, not only server-side modules.
- Review browser-side token exposure If the affected bundle may have served authenticated users, inspect whether tokens, session identifiers, or other browser-readable secrets were accessible in cookies or storage during the exposure window.
- Block unexpected client-side script and iframe loads Use CSP and related browser controls to restrict script execution and embedded frame loading from domains that were not part of the approved application delivery chain.
Key takeaways
- A poisoned frontend package can turn ordinary browser bundles into a downstream exploit delivery path, even when the build pipeline itself appears intact.
- The security issue is not limited to npm or CI compromise because the malicious code executes in the end user’s browser with site-origin privileges.
- Teams should verify bundle provenance, inspect deployed assets, and reduce the amount of sensitive state exposed to browser-readable storage.
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 | Injected browser code can expose browser-readable secrets and session material from the site origin. |
| NHI-03 — Vulnerable Third-Party NHI | The compromise came through a third-party package that downstream sites trusted in production bundles. | |
| NHI-07 — Long-Lived Secrets | Browser-side compromise becomes more damaging when apps leave durable tokens accessible to JavaScript. | |
| Recommendation — Scan deployed bundles for exposed secrets and revoke any browser-readable credentials immediately. Vet third-party packages by provenance and remove any dependency whose release chain cannot be trusted. Reduce the lifetime and browser exposure of credentials that front-end code can reach. | ||
| MITRE ATT&CK | TA0001;TA0006;TA0011 — Initial Access; Credential Access; Command and Control | The chain uses compromised package delivery, browser-accessible data, and staged remote loading. |
| Recommendation — Map the bundle compromise to ATT&CK and hunt for remote script staging plus browser data access. | ||
| NIST CSF 2.0 | PR.AA-05 — Access Permissions, Entitlements and Authorizations | The issue exposes over-trust in what client-side code is allowed to access inside the application origin. |
| Recommendation — Review browser-exposed entitlements and restrict what front-end code can reach in production. | ||
Key terms
- Browser Bundle Compromise: A browser bundle compromise happens when malicious code is inserted into JavaScript that runs in users’ browsers after deployment. The risk is not limited to development or build systems because the altered code inherits the application origin and can interact with session data, page content, and client-side storage.
- Browser-Readable Secrets: Browser-readable secrets are credentials, tokens, or session data that client-side JavaScript can access directly or indirectly. They are especially risky because any injected script in the page origin may be able to use them without needing server-side authentication.
- Staged Script Loading: Staged script loading is a technique where one payload fetches and executes another payload after the initial compromise. Attackers use it to hide the final behavior, alter content based on request context, and bypass simple static or sandbox-based inspection.
- Origin-Level Execution: Origin-level execution means malicious code runs with the same browser origin as the legitimate application. That gives it the same access rights as trusted site scripts, including DOM interaction, local state access, and in some cases the ability to exfiltrate or manipulate session material.
Deepen your knowledge
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 runtime trust decisions to the access pathways their programmes must control.
Published by the NHIMG editorial team on August 20, 2026.
Updated on October 12, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org