Malicious code in jsontoken-extend (npm)
The npm package 'jsontoken-extend' contains malicious code that executes arbitrary remote code at import time by fetching and evaluating payloads from an anonymous, mutable paste service. It is a typosquatting package mimicking the popular 'jsonwebtoken' library to lure developers. Installing or running this package compromises the host system, potentially exposing all stored secrets and keys.
AI Analysis
Technical Summary
The 'jsontoken-extend' npm package executes a top-level immediately-invoked function expression (IIFE) in its sign.js file that base64-decodes a hardcoded URL pointing to jsonkeeper.com, an anonymous mutable paste service. It fetches JSON content from this URL and passes data.content directly to eval(), enabling arbitrary remote code execution on every consumer at import time. The package name and API mirror the legitimate 'jsonwebtoken' library, including declaring it as a dependency, to deceive developers searching for the real JWT library. The use of base64-encoded command-and-control URLs is a deliberate evasion technique. Multiple indicators confirm malicious intent, including import-time fetch and eval from an anonymous host, typosquatting naming, and obfuscated URLs.
Potential Impact
Any system with this package installed or running should be considered fully compromised. The attacker can execute arbitrary code remotely at import time, potentially gaining full control over the system. All secrets and keys stored on the compromised system should be considered exposed and must be rotated immediately from a secure environment. Removing the package alone may not remove all malicious software or backdoors installed by the attacker.
Mitigation Recommendations
No official patch or fix is available. Immediate removal of the 'jsontoken-extend' package from all systems is required. All secrets and keys stored on affected systems should be rotated from a different, uncompromised computer. Due to the nature of the compromise, assume full system compromise and consider rebuilding affected systems from trusted sources.
Malicious code in jsontoken-extend (npm)
Description
The npm package 'jsontoken-extend' contains malicious code that executes arbitrary remote code at import time by fetching and evaluating payloads from an anonymous, mutable paste service. It is a typosquatting package mimicking the popular 'jsonwebtoken' library to lure developers. Installing or running this package compromises the host system, potentially exposing all stored secrets and keys.
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 'jsontoken-extend' npm package executes a top-level immediately-invoked function expression (IIFE) in its sign.js file that base64-decodes a hardcoded URL pointing to jsonkeeper.com, an anonymous mutable paste service. It fetches JSON content from this URL and passes data.content directly to eval(), enabling arbitrary remote code execution on every consumer at import time. The package name and API mirror the legitimate 'jsonwebtoken' library, including declaring it as a dependency, to deceive developers searching for the real JWT library. The use of base64-encoded command-and-control URLs is a deliberate evasion technique. Multiple indicators confirm malicious intent, including import-time fetch and eval from an anonymous host, typosquatting naming, and obfuscated URLs.
Potential Impact
Any system with this package installed or running should be considered fully compromised. The attacker can execute arbitrary code remotely at import time, potentially gaining full control over the system. All secrets and keys stored on the compromised system should be considered exposed and must be rotated immediately from a secure environment. Removing the package alone may not remove all malicious software or backdoors installed by the attacker.
Mitigation Recommendations
No official patch or fix is available. Immediate removal of the 'jsontoken-extend' package from all systems is required. All secrets and keys stored on affected systems should be rotated from a different, uncompromised computer. Due to the nature of the compromise, assume full system compromise and consider rebuilding affected systems from trusted sources.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-4592
- Osv Schema Version
- 1.7.4
- Aliases
- ["GHSA-v985-2jx7-c35g"]
- Ecosystems
- ["npm"]
Threat ID: 6a4c341527e9c797195f7efd
Added to database: 07/06/2026, 23:02:45 UTC
Last enriched: 09/12/2026, 21:16:37 UTC
Last updated: 09/13/2026, 09:44:31 UTC
Views: 48
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.