Malicious code in jsontoken-extend (npm)
The npm package jsontoken-extend contains malicious code that executes arbitrary remote code at import time. It fetches a payload from an anonymous, mutable paste service and evaluates it directly, enabling an attacker to run any code on the host system. The package is a typosquat of the legitimate jsonwebtoken library, designed to deceive developers. Installing or running this package can lead to full system compromise.
AI Analysis
Technical Summary
The jsontoken-extend npm package executes a top-level immediately-invoked function expression (IIFE) in sign.js that base64-decodes a hardcoded URL pointing to jsonkeeper.com, an anonymous mutable paste service. It fetches JSON data from this URL and passes the content directly to eval(), allowing arbitrary remote code execution on any system importing the package. The package mimics the API and name of the popular jsonwebtoken library and even declares jsonwebtoken as a dependency to appear legitimate, constituting a typosquatting attack. The use of base64-encoded URLs is intended to evade static analysis. Multiple payload URLs are staged, indicating prepared malicious payloads. This behavior effectively compromises any system with the package installed or running.
Potential Impact
Any system that installs or runs jsontoken-extend is fully compromised due to arbitrary remote code execution at import time. Attackers can execute any code, potentially stealing secrets, keys, or other sensitive data. The compromise is severe enough that all secrets and keys on the affected system should be rotated from a different, trusted machine. Simply removing the package does not guarantee removal of all malicious artifacts or backdoors.
Mitigation Recommendations
No official patch or fix is currently available. The package should be immediately removed from all systems. All secrets and keys stored on affected machines must be rotated from a secure environment. Due to the nature of the compromise, affected systems should be considered fully compromised and undergo thorough investigation and remediation. Avoid installing packages with names similar to popular libraries without verifying authenticity.
Malicious code in jsontoken-extend (npm)
Description
The npm package jsontoken-extend contains malicious code that executes arbitrary remote code at import time. It fetches a payload from an anonymous, mutable paste service and evaluates it directly, enabling an attacker to run any code on the host system. The package is a typosquat of the legitimate jsonwebtoken library, designed to deceive developers. Installing or running this package can lead to full system compromise.
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 sign.js that base64-decodes a hardcoded URL pointing to jsonkeeper.com, an anonymous mutable paste service. It fetches JSON data from this URL and passes the content directly to eval(), allowing arbitrary remote code execution on any system importing the package. The package mimics the API and name of the popular jsonwebtoken library and even declares jsonwebtoken as a dependency to appear legitimate, constituting a typosquatting attack. The use of base64-encoded URLs is intended to evade static analysis. Multiple payload URLs are staged, indicating prepared malicious payloads. This behavior effectively compromises any system with the package installed or running.
Potential Impact
Any system that installs or runs jsontoken-extend is fully compromised due to arbitrary remote code execution at import time. Attackers can execute any code, potentially stealing secrets, keys, or other sensitive data. The compromise is severe enough that all secrets and keys on the affected system should be rotated from a different, trusted machine. Simply removing the package does not guarantee removal of all malicious artifacts or backdoors.
Mitigation Recommendations
No official patch or fix is currently available. The package should be immediately removed from all systems. All secrets and keys stored on affected machines must be rotated from a secure environment. Due to the nature of the compromise, affected systems should be considered fully compromised and undergo thorough investigation and remediation. Avoid installing packages with names similar to popular libraries without verifying authenticity.
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"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a4c341527e9c797195f7efd
Added to database: 07/06/2026, 23:02:45 UTC
Last enriched: 07/07/2026, 13:33:33 UTC
Last updated: 07/31/2026, 12:23:46 UTC
Views: 16
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.