The Socket Threat Research Team has uncovered a new malware campaign hiding inside an npm package called fezbox. While posing as a JavaScript/TypeScript utility library, the package conceals multiple layers of obfuscation β including the use of a QR code as a payload delivery mechanism.
According to the researchers, βfezbox, with layers of obfuscation including the innovative, steganographic use of a QR code. In this package, the threat actorβ¦ executes a payload within a QR code to steal username and password credentials from web cookies, within the browser.β
Fezbox presents itself as a collection of helper functions for developers. Its README highlights performance, TypeScript support, and even a βQR Code Moduleβ for generating and parsing QR codes.
However, what isnβt disclosed is that importing the library triggers a hidden routine: βIt does also describe a βQR Code Moduleββ¦ However, it does not state that importing the library will fetch a QR code from a remote URL and execute the code contained in that QR.β
Once installed, fezbox runs heavily obfuscated scripts designed for browser-side execution. The malware waits 120 seconds before calling a function that downloads and parses a QR code from a Cloudinary image URL.
Socket highlights this stealth tactic: βIn isDevelopment, and 2/3 times not in isDevelopment, this code does nothing. This is usually a stealth tactic. The threat actor does not want to risk being caught in a virtual environment or any non-production environment.β
When executed, the QR code itself contains a JavaScript payload, creating a second layer of obfuscation.
The payloadβs purpose is straightforward: to steal credentials from cookies.
βHere, it reads a cookie from document.cookie. Then it gets the username and password, although again we see the obfuscation tactic of reversing the string (drowssap becomes password). If there is both a username and password in the stolen cookie, it sends the information via an HTTPS POST request to https://my-nest-app-production[.]up[.]railway[.]app/users.β
This exfiltration approach allows stolen credentials to be silently transmitted to the attackerβs server.
Fezbox employs at least three layers of obfuscation:
- Reversed strings (e.g., βdrowssapβ β βpasswordβ).
- QR code steganography to conceal the payload.
- Obfuscated JavaScript code using encoding and no-op red herrings.
As Socket notes, βSteganography is the practice of hiding a secret file in plain sight, something for which QR codes are greatβ¦ Using a QR code as a steganographic obfuscation technique is quite clever and shows yet again that threat actors will continue to use any and all tools at their disposal.β
At the time of reporting, fezbox remained live on npm, though Socket confirmed it petitioned npm security to remove the package and suspend the threat actorβs account.
Developers are urged to immediately remove fezbox from their projects, audit dependencies, and rotate any credentials that may have been exposed.
Related Posts:
- QR Codes Coming to Linux Kernel Panics with 6.12 Release
- The Hidden Danger of PDF Files with Embedded QR Codes, Researchers Warn
- QR Code Phishing Attacks Escalate: Sophisticated Campaign Targets Chinese Citizens
- Android Boosts Anti-Theft Measures with AI and Biometric Security
- “Unicode QR Code Phishing”: The New Threat You Need to Know
Support Our Threat Intelligence
If you find our CVE report and cybersecurity news helpful, consider supporting our work.