Malicious code in stake-math (npm)
The npm package 'stake-math' versions 3.5.2, 3.5.3, and 3.5.4 contains malicious code that executes arbitrary attacker-controlled commands during installation. The package's postinstall script fetches and runs code from an untrusted external source unrelated to the legitimate publisher, leading to full system compromise. The package also impersonates another brand to deceive users. Systems with this package installed should be considered fully compromised, and secrets must be rotated immediately.
AI Analysis
Technical Summary
The 'stake-math' npm package in versions 3.5.2, 3.5.3, and 3.5.4 includes a postinstall hook that downloads a JSON configuration from a hardcoded, non-publisher-controlled domain (https://www.log-prettier.store), retrieves a tarball URL, downloads and extracts it, runs a nested npm install, and executes a JavaScript file ('peer-math.js') within the installer's Node.js process. This process allows arbitrary code execution controlled by an attacker. The package exhibits identity divergence, with mismatched package name and README branding, and a homepage pointing to the malicious domain, indicating brand impersonation to lure victims. Installing this package version results in full compromise of the host machine.
Potential Impact
Installing affected versions of 'stake-math' results in arbitrary code execution with the installer's privileges, effectively giving attackers full control over the compromised system. This can lead to theft of secrets, keys, and other sensitive data. The compromise is severe enough that all secrets on the affected machine should be considered exposed and rotated immediately. Removal of the package alone does not guarantee eradication of all malicious artifacts or backdoors.
Mitigation Recommendations
No official patch or fix is currently available. Users should immediately remove versions 3.5.2, 3.5.3, and 3.5.4 of the 'stake-math' package from their systems. Because the package executes attacker-controlled code during installation, any system with these versions installed should be treated as fully compromised. All secrets and keys stored on the affected system must be rotated from a separate, trusted environment. Monitor for and investigate any suspicious activity related to this package. Avoid installing packages from untrusted sources and verify package authenticity before installation.
Malicious code in stake-math (npm)
Description
The npm package 'stake-math' versions 3.5.2, 3.5.3, and 3.5.4 contains malicious code that executes arbitrary attacker-controlled commands during installation. The package's postinstall script fetches and runs code from an untrusted external source unrelated to the legitimate publisher, leading to full system compromise. The package also impersonates another brand to deceive users. Systems with this package installed should be considered fully compromised, and secrets must be rotated immediately.
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 'stake-math' npm package in versions 3.5.2, 3.5.3, and 3.5.4 includes a postinstall hook that downloads a JSON configuration from a hardcoded, non-publisher-controlled domain (https://www.log-prettier.store), retrieves a tarball URL, downloads and extracts it, runs a nested npm install, and executes a JavaScript file ('peer-math.js') within the installer's Node.js process. This process allows arbitrary code execution controlled by an attacker. The package exhibits identity divergence, with mismatched package name and README branding, and a homepage pointing to the malicious domain, indicating brand impersonation to lure victims. Installing this package version results in full compromise of the host machine.
Potential Impact
Installing affected versions of 'stake-math' results in arbitrary code execution with the installer's privileges, effectively giving attackers full control over the compromised system. This can lead to theft of secrets, keys, and other sensitive data. The compromise is severe enough that all secrets on the affected machine should be considered exposed and rotated immediately. Removal of the package alone does not guarantee eradication of all malicious artifacts or backdoors.
Mitigation Recommendations
No official patch or fix is currently available. Users should immediately remove versions 3.5.2, 3.5.3, and 3.5.4 of the 'stake-math' package from their systems. Because the package executes attacker-controlled code during installation, any system with these versions installed should be treated as fully compromised. All secrets and keys stored on the affected system must be rotated from a separate, trusted environment. Monitor for and investigate any suspicious activity related to this package. Avoid installing packages from untrusted sources and verify package authenticity before installation.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-6585
- Osv Schema Version
- 1.7.4
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a42ed6927e9c79719938288
Added to database: 06/29/2026, 22:10:49 UTC
Last enriched: 07/30/2026, 09:20:30 UTC
Last updated: 07/30/2026, 09:20:30 UTC
Views: 39
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.
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.