A malicious npm package does not need your website to be poorly locked down. It only needs to sit next to your secrets. In the early hours of 16 November 2026, official releases of WPPConnect, an open-source toolkit for automating WhatsApp from Node.js, started shipping a hidden module that copies .env files, API keys and WhatsApp session tokens and sends them to a Telegram bot.

This is a different problem from keys that leak in public JavaScript or in a .env file the web server will hand out, which we covered today in Exposed API Keys: How AI Agents Now Hunt Them. Here the .env file can stay private and still leave the server the moment a trusted package is imported or a container starts.

What happened

WPPConnect is used to wire WhatsApp into site chat and customer-service bots. On 15 November at 23:31 UTC (01:31 on 16 November, Asia/Jerusalem), npm published @wppconnect-team/wppconnect version 2.4.1. A few hours later, at 03:09 UTC (05:09 Asia/Jerusalem), @wppconnect/server version 2.10.82 followed.

Both releases, according to an Open Source Security Foundation (OpenSSF) report filed after Bitbison found the code, and later confirmed independently by GMO Flatt Security and Leitwacht, include a “diagnostics” module. The project’s own 2.4.1 changelog listed it as an “environment diagnostics utility for support reports.” In practice, the researchers say, the module:

  • copies every environment variable;
  • reads .env, .env.local and .env.production;
  • reads config.js, config.json and ormconfig.json;
  • takes WhatsApp session token files from the tokens/ and wppconnect_tokens/ directories;
  • looks up the machine’s public IP address;
  • and uploads the whole dump as a document to a Telegram bot.

Flatt Security says the project’s GitHub Actions release pipeline was compromised, so the same code also went out in a GitHub nightly release and in Docker images, not only on npm. OpenSSF likewise says both npm releases were published through the project’s own release workflow. The source was removed from the GitHub repositories hours later, but the npm packages remain installable.

On the server package, Leitwacht describes a few tricks that make the theft harder to notice: a random delay of 30 to 240 seconds, a once-a-day limit per machine, and a decision to stay quiet on hosts that look like CI runners or sandboxes. The SDK package is more direct. Flatt Security and the maintainer notification say version 2.4.1 runs as soon as the library is imported or required.

Who is affected

You are in the affected group if any of the following is true:

  • you installed @wppconnect-team/wppconnect 2.4.1, or an app that pulled it in while it was tagged latest;
  • you installed or started @wppconnect/server 2.10.82;
  • you ran a wppconnect/wppconnect-server Docker image tagged latest, main, 2, 2.10, 2.10.82 or 2.10.83 at the time Flatt Security documented those tags as infected.

Flatt lists the known-good versions as SDK 2.4.0 and server 2.10.81. It also warns that GitHub tag v2.4.3 still contained the bad source and was not published on npm. A later GitHub release, 2.4.4-alpha.0, has a commit that “remove[s] host secret collection,” but Flatt had already flagged the GitHub nightly asset, which used the same internal version number, as malicious and mutable. Do not treat a GitHub or floating Docker tag as a safe release. Stay on the known-good npm versions until a later release is reviewed and pinned.

When we checked the npm registry on 16 November 2026, the latest tag on both packages already pointed back at 2.4.0 and 2.10.81. Both bad versions were still installable by number. npm now shows a deprecation warning that calls them a security incident and tells installers to pin the clean versions.

The npm package page for the SDK listed 7,215 weekly downloads when we checked on 16 November 2026. Leitwacht lists 1,897 weekly installs for the server package. Those figures describe ordinary use of the projects, not a count of infected machines, and they come from two different sources. No public source we reviewed says the stolen data is being sold on a dark-web market; the researchers describe a private Telegram bot as the destination.

How to check

  1. On each machine or container that talks to WhatsApp through WPPConnect, list the installed versions: npm ls @wppconnect-team/wppconnect @wppconnect/server. Also search package-lock.json or yarn.lock for 2.4.1 and 2.10.82.
  2. If you deploy with Docker, record the image tag and the image digest. Flatt published digest values for the infected tags it inspected. Tags can be pointed at a different image later, so a tag name alone is not enough. Compare the digest you have against Flatt’s table.
  3. Version 2.4.1 was npm’s latest from 15 November 23:31 UTC until the tag moved back to 2.4.0 at 04:03 UTC on 16 November (06:03 Asia/Jerusalem). A routine npm install without a pin in that window may have received 2.4.1.
  4. Leitwacht notes a marker file named .wpp-diag in the system temp directory for the server package. The researcher who notified the maintainers also describes .wpp-support-diag for the SDK. A marker is only a clue, and its absence does not mean you are safe.

That check is about the packages running on the server. Separately, you can check your website for vulnerabilities from the outside. An outside look can show exposed files and headers, but it will not tell you whether a server-side npm package is malicious.

What to do

If you installed or started a known-bad version or Docker tag, treat every secret on that machine as stolen. Once a key has left, the only fix is to replace it, as we described after the Apify API token rotation.

  1. Rotate the keys. Create new API keys, database passwords, cloud credentials and any other values that lived in the environment or in those config files. Then delete the old ones. Check provider bills and access logs for activity you do not recognise.
  2. Log out the WhatsApp sessions. Session files under tokens/ and wppconnect_tokens/ can give someone else access to the linked WhatsApp account. Sign those sessions out from WhatsApp’s linked-devices screen, discard the old token files, and pair the bot again only after the package is pinned to a known-good version.
  3. Pin the dependencies. Set @wppconnect-team/wppconnect to 2.4.0 and @wppconnect/server to 2.10.81, commit the lockfile, and do not float on latest. For Docker, pin 2.10.81 by digest after you have confirmed you are pulling a clean image, and stop using the floating tags Flatt listed as infected.
  4. Stay on those pins until a later release is reviewed. A new GitHub version number is not a clean bill of health. We wrote recently about another path that can reach an npm release through GitHub Actions. The pipeline that publishes a package is part of the trust boundary.

If the site itself is public-facing, you can also run a website vulnerability scanner against it as a second look at what visitors can reach. That still does not replace rotating secrets and pinning the clean versions above.

The lesson: a .env file is only as safe as every package next to it

A private .env file is not a vault. It is a plaintext file that every process on that machine can read. Keeping it out of Git, out of the web root and out of the front end still matters, and it would have stopped the public hunting we described in the exposed API keys article. It would not have stopped this one.

Pin versions you have reviewed, treat a surprise “diagnostics” module in a patch release with suspicion, and assume a compromised install means rotating secrets, not only deleting a package. Automatic updates are convenient. They are also how a bad release reaches production before anyone writes it up.

If you want an outside-in view of what a website you own exposes, you can run a free website security scan on that site. It will not tell you whether a server-side npm package was malicious; that check is the lockfile and the versions above.

FAQ

What is a malicious npm package?

A published library or tool that, once installed or started, does something harmful. In this case, official WPPConnect releases collected secrets from the host and sent them to a Telegram bot.

I never installed 2.4.1 or 2.10.82 by hand. Could I still be affected?

Yes. If a lockfile was not pinning the version, an install that ran while 2.4.1 or 2.10.82 was latest may have pulled it, as may a Docker tag such as latest that still pointed at an infected image.

Is it enough to downgrade the package?

No. Pin or downgrade first so the code stops running, then rotate every secret that was on the machine and log out the WhatsApp sessions. The data may already have left.

Sources: OpenSSF malicious-packages pull request 1790, GMO Flatt Security, Leitwacht advisory LWA-2026-14151, Bitbison, and the npm registry (checked 16 November 2026).

The original version of this article is on the HackerMe Security blog.