Malicious code in eth-react-provider (npm)
The npm package eth-react-provider contained malicious obfuscated code in its built artifact (lib/index.js) that executes automatically on module load. The payload was hidden using Function constructor, randomized identifiers, and unicode escaping to evade static analysis, while the source code (src/index.js) appeared clean.
- Disclosed
- Last updated
- Blast radius
- Any developer or application that installed eth-react-provider and executed it during installation or runtime.
- Ecosystems
- Attack vectors
- Affected entities
- eth-react-providernpm package with malicious obfuscated payload in built artifact (lib/index.js)
The npm package eth-react-provider was distributed with malicious code embedded in its built entry point (lib/index.js). While the package advertised itself as a React Ethereum provider with standard hooks (EthereumProvider, useProvider, useSigner, useNetwork), the actual shipped code contained web3.js Subscriptions code plus a large obfuscated payload.
The malicious payload was wrapped in a Function constructor and invoked automatically at module load time. The obfuscation employed randomized hex-named identifiers, a signed-integer decode table, and doubly-unicode-escaped strings to hide its true behavior from static inspection tools.
The discrepancy between the clean source code (src/index.js) and the trojanized built artifact (lib/index.js) indicates the built distribution was deliberately tampered with, consistent with a compromised or malicious build process rather than a legitimate release error.
Any consumer that required or imported eth-react-provider would execute this opaque code in their process, potentially during installation or at runtime, creating a supply chain risk for all downstream users and applications.
Indicators of compromise
- Packages
- eth-react-provider
Remediation
- Immediately remove eth-react-provider from all projects and dependencies
- Audit package-lock.json and yarn.lock files to identify all installations and versions
- Review process logs and system activity on machines where eth-react-provider was installed or executed
- Replace eth-react-provider with a legitimate, verified Ethereum provider library
- Implement package integrity verification and signed package checks in your build pipeline
- Monitor npm registry and security advisories for similar trojanized packages
- Consider using npm audit and supply chain security tools to detect compromised dependencies
Sources
- GitHub Advisory GHSA-8536-vq8v-5xvm · GitHub Advisory Database
Cite this entry
"Malicious code in eth-react-provider (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed August 19, 2026; last updated August 19, 2026. https://supplychainattack.org/incident/malicious-code-in-eth-react-provider-npm-1optss
Suggest a correction
Found an error or have a newer source? Corrections to factual errors take priority over new entries.
Related incidents
- containedcritical
Malicious code in crypto-javas (npm)
The npm package crypto-javas contains malicious code in its postinstall hook and main entrypoint that harvests environment variables (including CI secrets like AWS_*, GITHUB_TOKEN, NPM_TOKEN) and exfiltrates them to an attacker-controlled backend. The package is presented deceptively as @wizlabs/js-crypto with a placeholder repository.
npmCompromised packageTyposquatting - containedcritical
Malicious code in flydev (npm)
The npm package flydev contains malicious code designed to destroy Windows systems. The package masquerades as a utility but executes destructive operations including filesystem deletion, process termination, memory exhaustion, and fork bombs when invoked.
npmCompromised package - resolvedcritical
Malicious code in ranux-dev (npm)
ranux-dev, an npm package, contained malicious code that substituted a popular WhatsApp library dependency with arbitrary code from an unaffiliated GitHub account. The package was heavily obfuscated and designed to harvest WhatsApp sessions and credentials from installers.
npmCompromised packageDependency confusion - containedcritical
Malicious code in npm-wold (npm)
npm-wold@1.1.1 contains malicious code in its postinstall script that fetches remote JSON from a hardcoded endpoint and dynamically invokes attacker-controlled functions with attacker-supplied arguments, enabling code execution at install time.
npmCompromised package