jwt-loggernpm
Advisory published Updated
jwt-logger is a confirmed malicious npm package (MAL-2026-15991) that opens a backdoor for remote access (malicious versions 2.1.9, 2.4.9, 2.5.0). Do not install it — remove it immediately and rotate any exposed credentials.
Malicious code in jwt-logger (npm)
What this malware does
The package is published as a trivial JWT logging helper but its main module (jwt-logger.js) is a heavily obfuscated string-array dropper. On require(), it creates a hidden directory under os.homedir()+'/.cache', writes an obfuscated second-stage JavaScript payload plus a synthetic package.json declaring runtime dependencies (axios, better-sqlite3, node-machine-id, socket.io-client, with ffi-napi/koffi on Windows), and spawns node (process.execPath) on that payload with {detached:true, stdio:'ignore'} and unref(), so the second stage keeps running after the parent exits. On Windows it resolves %WINDIR%\System32\wscript.exe to launch a.vbs form of the payload, or falls back to cmd.exe /d /s /c with windowsVerbatimArguments to run without a visible console. All runtime strings are hidden behind an obfuscator.io-style rotated string array with a base64/URL decoder. package.json attributes authorship to 'Blake Embrey' [email protected] and the README carries blakeembrey.com/travis/coveralls badges, none of which corresponds to the shipped code. package.json additionally lists 'jwt-logger':'^2.3.7' as a dependency of itself (this artifact is 2.1.9), pulling an unpinned newer publisher-controlled version into every installer at install time. The socket.io-client dependency and detached background node process are consistent with a C2-controlled second stage.
Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.
Malicious versions
Indicators of compromise (SHA-256)
Detection & response playbook
Backdoor / remote accessFind it
Search your lockfiles and build artifacts for jwt-logger (3 malicious versions).
If you installed it — respond
jwt-logger establishes remote access, so treat any host that installed it as fully compromised. Isolate the machine, remove the package, rotate all credentials it could reach, and rebuild from a trusted image rather than cleaning in place — a backdoor may have planted additional persistence.
Did it already run?
If jwt-logger was installed, its post-install payload may already have run. Removing the package does not undo that — check outbound connections and credential use from the install window onward.
Frequently asked questions
Campaign
References
Credits
- Amazon Inspector · finder
Detect & block this
O3 blocks jwt-logger-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the C2 callback and severs the channel.