Malicious code in @nestjs-passport/jwt (npm)
The npm package @nestjs-passport/jwt contains malicious code disguised as a minimal HS256 JWT helper. It uses heavy JSFuck obfuscation and dynamic code evaluation at import time, executing hidden payloads in the installer's Node.js process. The package is a typosquat of legitimate @nestjs packages and exposes obfuscated private fields inconsistent with normal build outputs. This concealment technique allows arbitrary code execution during module load without readable code paths.
AI Analysis
Technical Summary
The @nestjs-passport/jwt npm package, specifically versions 1.0.4 and 1.0.7, is a malicious typosquatting package that mimics official @nestjs JWT-related packages. Its entrypoint files (dist/index.cjs and dist/index.js) consist of a single-line JSFuck-encoded string (~2.3MB) which is passed to a new Function constructor and executed immediately upon import. This dynamic evaluation executes hidden code inside the installer's Node.js process, enabling arbitrary code execution. The package's advertised functionality as a minimal HS256 JWT helper is inconsistent with the complexity and obfuscation observed, including obfuscated private field names in TypeScript declarations that do not align with the declared build tooling. This combination of typosquatting, heavy obfuscation, and dynamic code execution indicates a deliberate attempt to conceal malicious behavior.
Potential Impact
Installing or importing this package results in execution of hidden malicious code within the Node.js process of the installer or user. This can lead to compromise of the host environment, unauthorized actions, data theft, or further malware deployment. The obfuscation and dynamic execution make detection and analysis difficult, increasing risk to developers and systems that inadvertently include this package.
Mitigation Recommendations
No official patch or remediation is available as this is a malicious package rather than a vulnerability in legitimate software. Users should avoid installing or using @nestjs-passport/jwt versions 1.0.4 and 1.0.7. Verify package authenticity by using official sources and package names. Remove any installations of this package from projects and conduct security reviews to detect any impact. Use trusted package registries and enable supply chain security measures such as package signing and integrity checks.
Malicious code in @nestjs-passport/jwt (npm)
Description
The npm package @nestjs-passport/jwt contains malicious code disguised as a minimal HS256 JWT helper. It uses heavy JSFuck obfuscation and dynamic code evaluation at import time, executing hidden payloads in the installer's Node.js process. The package is a typosquat of legitimate @nestjs packages and exposes obfuscated private fields inconsistent with normal build outputs. This concealment technique allows arbitrary code execution during module load without readable code paths.
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 @nestjs-passport/jwt npm package, specifically versions 1.0.4 and 1.0.7, is a malicious typosquatting package that mimics official @nestjs JWT-related packages. Its entrypoint files (dist/index.cjs and dist/index.js) consist of a single-line JSFuck-encoded string (~2.3MB) which is passed to a new Function constructor and executed immediately upon import. This dynamic evaluation executes hidden code inside the installer's Node.js process, enabling arbitrary code execution. The package's advertised functionality as a minimal HS256 JWT helper is inconsistent with the complexity and obfuscation observed, including obfuscated private field names in TypeScript declarations that do not align with the declared build tooling. This combination of typosquatting, heavy obfuscation, and dynamic code execution indicates a deliberate attempt to conceal malicious behavior.
Potential Impact
Installing or importing this package results in execution of hidden malicious code within the Node.js process of the installer or user. This can lead to compromise of the host environment, unauthorized actions, data theft, or further malware deployment. The obfuscation and dynamic execution make detection and analysis difficult, increasing risk to developers and systems that inadvertently include this package.
Mitigation Recommendations
No official patch or remediation is available as this is a malicious package rather than a vulnerability in legitimate software. Users should avoid installing or using @nestjs-passport/jwt versions 1.0.4 and 1.0.7. Verify package authenticity by using official sources and package names. Remove any installations of this package from projects and conduct security reviews to detect any impact. Use trusted package registries and enable supply chain security measures such as package signing and integrity checks.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-13627
- Osv Schema Version
- 1.7.4
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a7742a8bf8831d539b08cda
Added to database: 08/08/2026, 14:52:24 UTC
Last enriched: 08/08/2026, 15:19:37 UTC
Last updated: 08/08/2026, 20:00:42 UTC
Views: 4
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.