All articles
ArticlesNovember 17, 20266 min read

WPPConnect npm compromise: what to check and rotate

The WPPConnect npm compromise shipped a secret stealer through trusted publishing. How the attack worked, how to check your systems and what to rotate.

wppconnectwppconnect npm compromisenpmsupply chain attacktrusted publishingwhatsappslsa provenanceapplication security
WPPConnect npm compromise: what to check and rotate

The WPPConnect npm compromise is the kind of supply chain attack I keep warning teams about, because every check most of us rely on passed. On November 16, 2026, researchers reported that @wppconnect-team/wppconnect 2.4.1 and @wppconnect/server 2.10.82, the Node.js libraries for automating WhatsApp Web, shipped a "diagnostics" module that uploads secrets and WhatsApp session tokens to a Telegram bot.

The bad versions went out through the project's own GitHub Actions trusted-publishing workflow. The library release even carries a valid SLSA provenance attestation. Then, after the public reports, the Git history was rewritten so the release tag no longer shows the payload.

I work on erxes, an open-source CRM, and messaging connectors are exactly the kind of code that ends up holding customer data, API keys and chat sessions in one process. Here is what happened, how to check your systems, and what I'd change in a release pipeline.

What happened in the WPPConnect npm compromise

According to the StepSecurity analysis and Corgea's write-up, the sequence looked like this (all times UTC):

  1. At 22:34 on November 15, two unsigned commits landed on master of the library repo with no pull request. They added src/utils/diagnostics.ts and imported it from the browser controller. The commits were authored under the joaosouz4dev maintainer account.
  2. The release workflow tagged v2.4.1 and published it. npm records the version at 23:31.
  3. At 02:43 the server repo got the same treatment. Its release workflow runs on every push to main, so the push itself triggered 2.10.82, which hit npm at 03:09. Docker images built from the payload commits were pushed too.
  4. Around 04:00, Bitbison opened public issues. About 30 seconds later, both default branches were force-pushed. The v2.4.1 tag now points to a look-alike commit without the stealer.

Both bad versions are now deprecated on npm. I checked the registry this morning: latest is back on 2.4.0 for the library and 2.10.81 for the server, and the deprecation message reads "SECURITY INCIDENT". Nobody has published a root cause yet. Corgea says it is unknown whether the account, a token or the workflow was compromised.

What the payload steals

The module runs on import, not on install. The library fires as soon as it is loaded. The server variant waits a random 30 to 240 seconds after startup and skips machines that look like CI or a sandbox. That means npm install --ignore-scripts does nothing here.

Per the maintainers' GitHub issue and the StepSecurity code review, it collects:

  • every environment variable (database URLs, cloud keys, LLM API keys, webhook tokens)
  • the contents of .env, .env.local, .env.production, config.js, config.json and ormconfig.json from the working directory
  • WhatsApp session files from tokens/ (and wppconnect_tokens/ on the server)
  • hostname, username, OS and the public IP from api.ipify.org

It sends all of that as a document through the Telegram Bot API, at most once per 24 hours per machine. The session files are the nasty part. Corgea notes they let an attacker use the victim's WhatsApp account without scanning a QR code.

Scale is hard to pin down. Corgea counted 7,498 weekly downloads for the SDK and 1,527 for the server before the incident, and 2.4.1 sat on latest for roughly 4.5 hours.

How to check if you are affected

Start with what is actually installed in each project and image:

npm ls @wppconnect-team/wppconnect @wppconnect/server --all
find node_modules/@wppconnect-team node_modules/@wppconnect -name diagnostics.js 2>/dev/null

You are looking for library 2.4.1 or 2.4.3 and server 2.10.82 or 2.10.83. Only 2.4.1 and 2.10.82 reached npm, but the pipeline built the other two from the same payload commits, so check GitHub and nightly installs too. Any diagnostics.js inside these packages is a red flag.

Also check for the marker files .wpp-support-diag (library) and .wpp-diag (server) in the temp directory, and look at egress logs for api.telegram.org from hosts that should never talk to Telegram.

For Docker, don't trust tags. 2.10.82 and 2.10.83 are infected, and so were latest, 2 and 2.10 pulled between about 02:48 and 03:54 UTC on November 16, plus main before 07:31 UTC. Compare digests against the ones StepSecurity and Corgea list.

If you get a hit:

  1. Pin @wppconnect-team/[email protected] or @wppconnect/[email protected], reinstall from a clean lockfile and redeploy from a digest you verified.
  2. Rotate every secret that process could read.
  3. On each WhatsApp number, open Linked devices and log out everything, then delete the session files so a new QR pairing is required.
  4. If the library ran in CI, rotate the secrets that job could see.

Trusted publishing is not code review

This is the lesson I care about most. Trusted publishing and provenance answer one question: was this package built by this workflow from this commit? Here the answer was yes. Every field in the SLSA attestation was accurate. The commit was just malicious.

StepSecurity points out that the library's publish.yml had no environment: key, so no human approval stood between a tag and the registry. A push by one account was enough.

What I'd do in any repo that publishes packages:

  • Put the publish job in a GitHub environment with required reviewers who did not push the tag, and bind the npm trusted publisher to that environment.
  • Require pull requests and signed commits on the default branch, and block force-pushes. The rewrite here worked because nothing stopped it.
  • Rotate any personal access token your release workflow uses.
  • As a consumer, don't auto-take a new latest within hours of release. A short cooldown before upgrading would have skipped this whole window.

It's the same theme as the Cursor security incident and my notes on patching self-hosted n8n: the gaps that hurt are in the plumbing between systems, not in the code everyone reviews.

FAQ

Did npm install --ignore-scripts protect me?

No. The packages have no install script. The code runs when the module is imported or the server starts.

Were CI runners or Docker users safe?

Not by default. The server variant skips machines that look like CI, but the library has no such check, and the infected Docker images run the payload on container start.

Is it safe to use WPPConnect now?

The current latest versions (2.4.0 and 2.10.81) are the known-good releases the researchers name. I would pin those exact versions and wait for the maintainers to publish a root cause and a reviewed release before upgrading.


Sources

Cover image: WPPConnect logo, WPPConnect brand assets

Related articles