Get all your news in one place.
100’s of premium titles.
One app.
Start reading
TechRadar
TechRadar
Sead Fadilpašić

Worrying WhatsApp attack can steal messages and even accounts - here's how to stay safe from "poisoned" attack

Cyber crime and security vector concept showing a laptop, credit card and open padlock.
  • Malicious NPM package lotusbail hijacks WhatsApp accounts, stealing tokens, messages, and contacts
  • Attackers link their device via WhatsApp pairing, persisting even after package removal
  • Package had 56,000+ downloads before discovery; developers urged to verify sources carefully

Node Package Manager (NPM) registry users are being targeted with malware that takes over their WhatsApp accounts, steals messages, and contacts lists, experts have warned.

Cybersecurity researchers Koi Security recently discovered a fork of the popular WhiskeySockets Baileys project, an open source TypeScript/JavaScript library that provides a WebSocket-based API for interacting with the WhatsApp Web protocol, letting developers programmatically connect to WhatsApp as a companion device.

The malicious fork, named ‘lotusbail’ has all the same functionality as the legitimate project, but it also steals WhatsApp authentication tokens and session keys. Furthermore, it intercepts and records all messages, pulls contacts, media files, and all other documents, to a third-party server.

Taking over WhatsApp accounts

"The package wraps the legitimate WebSocket client that communicates with WhatsApp. Every message that flows through your application passes through the malware's socket wrapper first," Koi Security said in its report.

"When you authenticate, the wrapper captures your credentials. When messages arrive, it intercepts them. When you send messages, it records them."

But perhaps most alarmingly, the package links the attacker’s device with the victim’s WhatsApp account through the app’s pairing feature. That means that even if the victim removes the malicious NPM package, their WhatsApp account remains compromised until the link is manually disconnected.

The malware was sitting on npm for at least half a year, and during that time it amassed more than 56,000 downloads.

NPM is one of the world’s most popular public online registries hosting JavaScript packages published via npm. It allows developers to discover, download, and manage open source and private packages used in Node.js and JavaScript projects.

As such, it is constantly bombarded with all sorts of scams and hack attacks, from forked projects to typosquatted ones. To stay safe, devs are advised to be extra careful when downloading and running anything, even projects with thousands of downloads.

Follow TechRadar on Google News and add us as a preferred source to get our expert news, reviews, and opinion in your feeds. Make sure to click the Follow button!

And of course you can also follow TechRadar on TikTok for news, reviews, unboxings in video form, and get regular updates from us on WhatsApp too.

Sign up to read this article
Read news from 100’s of titles, curated specifically for you.
Already a member? Sign in here
Related Stories
Top stories on inkl right now
One subscription that gives you access to news from hundreds of sites
Already a member? Sign in here
Our Picks
Fourteen days free
Download the app
One app. One membership.
100+ trusted global sources.