webpack-patch (npm) · Malicious Code
Affects webpack-patchSource GCVE Database
Malicious package : remove webpack-patch and rotate any secrets on hosts that installed it.
Data as of 12 Sep 2026, 20:46 UTC
Malicious package
Published to npm · OSV MAL-2026-5581
What to do
Remove webpack-patch from every project, lockfile and image that pulls it in. Treat any host that installed it as compromised: rotate the credentials, tokens and keys it could read, from a clean machine.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| npmwebpack-patch | Affected
| Fixed in– |
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
Description
The npm package 'webpack-patch' (version 1.1.7) impersonates the webpack ecosystem but is unrelated and contains malicious code. When its middleware is invoked, it spawns a detached child process that fetches attacker-controlled JavaScript from an anonymous paste service and executes it with full Node.js privileges. This allows arbitrary code execution on any system using the package. The package's metadata is misleading, and the malicious code includes retry loops and pivot URLs to maintain persistence. Systems with this package installed should be considered fully compromised.
References
- npmjs.com/package/webpack-patch/v/1.1.7 (opens in a new tab)
- github.com/advisories/GHSA-3hxr-3hxr-pqq4 (opens in a new tab)
- npmjs.com/package/webpack-patch/v/1.2.0 (opens in a new tab)
- npmjs.com/package/webpack-patch/v/1.1.8 (opens in a new tab)
- npmjs.com/package/webpack-patch/v/1.1.9 (opens in a new tab)
- sonatype.com/blog/lazarus-groups-latest-brandjacking-campaign-on-npm (opens in a new tab)