Malicious npm package abused Hugging Face for both payload delivery and stolen-data storage


A malicious npm package called js-logger-pack turned Hugging Face into both a malware distribution point and a backend for stolen data, according to new research from JFrog. The package used a hidden postinstall script to pull platform-specific payloads from a public Hugging Face repository, then uploaded stolen files to private Hugging Face datasets controlled by the attacker.

The campaign stands out because it shows how attackers can hide a supply chain attack inside normal developer activity. Instead of sending exfiltrated data to a classic attacker server, the malware abused a trusted AI platform for storage and retrieval. That makes malicious traffic look more like routine cloud usage and gives defenders fewer obvious indicators to block.

JFrog said the package presented itself as a harmless logger, but the real attack started after installation through an automatically executed postinstall hook. That script launched a detached background process so the install appeared to complete normally while the downloader continued running out of sight.

How the npm attack worked

According to JFrog, the malicious installer checked the victim’s operating system and downloaded one of four Node.js SEA binaries from the attacker’s Hugging Face repository, identified as Lordplay/system-releases. JFrog said it extracted the JavaScript payload from all four binaries and found the same implant logic embedded across Windows, macOS, and Linux samples.

The malware then established persistence using native mechanisms on each platform. JFrog’s write-up says it used scheduled tasks and Run keys on Windows, LaunchAgent entries on macOS, and systemd user units on Linux. After that, it contacted a command-and-control server over WebSocket and gave the attacker broad control over the infected machine.

JFrog said the implant could read and write arbitrary files, scan for credentials, log keystrokes, monitor the clipboard, and deploy additional payloads. In other words, any machine that executed the malicious package should be treated as fully compromised until it has been cleaned and all secrets have been rotated.

Why the Hugging Face abuse matters

The most unusual twist in this case was the exfiltration design. JFrog said the malware did not store stolen data directly on the command server. Instead, the operator sent the implant a Hugging Face token, a destination path, and an upload ID, then had the malware compress the target files and push them into private Hugging Face datasets under attacker-controlled accounts.

Hugging Face Exfiltration Flow (Source – JFrog)

That gave the attacker two advantages. First, it reduced the need to maintain a more obvious stolen-data server. Second, it made exfiltration traffic blend into connections to a well-known platform that many developers and AI teams already use. JFrog described this as a shift from using Hugging Face only as a malware CDN to using it as a live exfiltration backend too.

The same report also says the malware could clear active browser sessions and wipe locally stored credentials, forcing victims to log in again while the keylogger remained active. That means credentials typed after the cleanup could be stolen and uploaded within minutes.

What defenders should look for

IndicatorWhy it matters
js-logger-pack in dependenciesMain malicious npm package identified by JFrog
Hidden postinstall executionInitial trigger for the malware chain
Downloads from attacker-controlled Hugging Face repoUsed to fetch platform-specific payloads
Unexpected persistence via scheduled task, Run key, LaunchAgent, or systemd unitSuggests the implant survived reboots
Hugging Face dataset uploads from developer systemsPossible exfiltration to attacker storage
WebSocket traffic to hard-coded infrastructureUsed for attacker tasking and control

The table reflects the behavior JFrog documented in its April 23, 2026 analysis of the campaign.

What admins should do now

  • Treat any machine that installed js-logger-pack, especially version 1.1.27, as compromised until proven otherwise.
  • Rotate all secrets, including cloud keys, SSH keys, npm tokens, database credentials, API keys, and passwords stored in browsers.
  • Remove persistence artifacts on every affected system, including scheduled tasks, registry Run keys, LaunchAgents, and systemd user units, depending on platform.
  • Purge the malicious package, clear the npm cache, and review recent dependency changes carefully.
  • Consider temporarily enforcing npm config set ignore-scripts true in environments where postinstall hooks are not required.
  • Hunt for unusual outbound traffic to Hugging Face repos or datasets that do not match approved workflows.

FAQ

What is js-logger-pack?

JFrog identified it as a malicious npm package that used a fake logger front and a hidden postinstall script to infect developer systems.

How did Hugging Face get involved?

The attacker used a public Hugging Face repository to host payloads and private Hugging Face datasets to store stolen data. JFrog said this let the campaign use the platform for both delivery and exfiltration.

Which systems were targeted?

JFrog analyzed Windows, macOS, and Linux payloads and said the same JavaScript implant logic appeared across all four Node.js SEA binaries it extracted.

Why is this campaign harder to spot?

Because the malware blends in with normal package installation and then talks to a trusted cloud platform many developers already use. That can make both payload delivery and exfiltration look less suspicious.

Readers help support VPNCentral. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help VPNCentral sustain the editorial team Read more

User forum

0 messages