Malicious code in @openzeppelin-4/contracts (npm)
The npm package '@openzeppelin-4/contracts' impersonates the legitimate '@openzeppelin/contracts' package but contains malicious code instead of Solidity contracts. It executes a script during installation that collects sensitive credentials and secret files from the user's environment and sends them to a remote server. The malicious script attempts to evade detection by delaying execution and checking for sandbox or analysis environments before running.
AI Analysis
Technical Summary
The '@openzeppelin-4/contracts' npm package is a malicious package impersonating the legitimate '@openzeppelin/contracts' scope. Instead of providing Solidity contracts, it includes an index.js script executed during lifecycle events that enumerates environment variables for credential-like keys and reads various secret files such as AWS credentials, SSH keys, Kubernetes configs, Docker configs, npm and git credentials, cloud application credentials, blockchain keystores, and project environment files. The collected data is exfiltrated via an HTTP POST request to a remote webhook URL. The script uses a randomized delay between 60 and 240 seconds before execution and avoids running if it detects sandbox or scanning environments by checking hostnames, usernames, and environment markers, thereby evading install-time analysis.
Potential Impact
This malicious package can lead to the theft of a wide range of sensitive credentials and secret files from the victim's environment, including cloud service keys, SSH private keys, blockchain wallets, and other configuration files. This exposure can result in unauthorized access to cloud accounts, source code repositories, blockchain assets, and other critical infrastructure. The evasion techniques reduce the likelihood of detection during automated scans.
Mitigation Recommendations
Users should avoid installing packages from untrusted or suspicious sources, especially those impersonating well-known packages. Verify package names and scopes carefully before installation. Remove any installations of '@openzeppelin-4/contracts' versions 1.0.0 and 1.0.1. Since no official patch or remediation is provided, manual removal and credential rotation are recommended. Monitor for any unauthorized access using compromised credentials and consider revoking and regenerating secrets that may have been exposed.
Malicious code in @openzeppelin-4/contracts (npm)
Description
The npm package '@openzeppelin-4/contracts' impersonates the legitimate '@openzeppelin/contracts' package but contains malicious code instead of Solidity contracts. It executes a script during installation that collects sensitive credentials and secret files from the user's environment and sends them to a remote server. The malicious script attempts to evade detection by delaying execution and checking for sandbox or analysis environments before running.
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The '@openzeppelin-4/contracts' npm package is a malicious package impersonating the legitimate '@openzeppelin/contracts' scope. Instead of providing Solidity contracts, it includes an index.js script executed during lifecycle events that enumerates environment variables for credential-like keys and reads various secret files such as AWS credentials, SSH keys, Kubernetes configs, Docker configs, npm and git credentials, cloud application credentials, blockchain keystores, and project environment files. The collected data is exfiltrated via an HTTP POST request to a remote webhook URL. The script uses a randomized delay between 60 and 240 seconds before execution and avoids running if it detects sandbox or scanning environments by checking hostnames, usernames, and environment markers, thereby evading install-time analysis.
Potential Impact
This malicious package can lead to the theft of a wide range of sensitive credentials and secret files from the victim's environment, including cloud service keys, SSH private keys, blockchain wallets, and other configuration files. This exposure can result in unauthorized access to cloud accounts, source code repositories, blockchain assets, and other critical infrastructure. The evasion techniques reduce the likelihood of detection during automated scans.
Mitigation Recommendations
Users should avoid installing packages from untrusted or suspicious sources, especially those impersonating well-known packages. Verify package names and scopes carefully before installation. Remove any installations of '@openzeppelin-4/contracts' versions 1.0.0 and 1.0.1. Since no official patch or remediation is provided, manual removal and credential rotation are recommended. Monitor for any unauthorized access using compromised credentials and consider revoking and regenerating secrets that may have been exposed.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-13737
- Osv Schema Version
- 1.7.4
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a7b6fd9bf8831d5393eb02e
Added to database: 08/11/2026, 18:54:17 UTC
Last enriched: 08/11/2026, 19:04:46 UTC
Last updated: 08/11/2026, 21:56:13 UTC
Views: 3
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.