Poisoned Pipeline / Incidents / AS517

AS517 · 2026-11

Two npm releases of the WPPConnect WhatsApp libraries, a Docker image and a GitHub nightly build carry a diagnostics module that uploads environment variables, .env files and WhatsApp session tokens to a Telegram bot, built and signed by the project's own trusted-publishing workflow and then force-pushed out of the release tag

npmGit / GitHubGitHub ActionsDocker / containersDeveloper workstation

SafeDep and StepSecurity both published this on 16 November 2026.
@wppconnect-team/wppconnect 2.4.1 reached npm at 23:31 UTC on 15
November and @wppconnect/server 2.10.82 at 03:09 UTC the next morning,
each carrying a module called diagnostics that collects the host's
environment and WhatsApp session state and posts it to a Telegram bot.
Neither package has an install script: the library loads the module from
dist/controllers/browser.js on line 79, so any require() or import of
wppconnect runs it, and the server loads its own copy from dist/server.js
at startup, which is also the entrypoint of the published Docker image.
npm install --ignore-scripts does not stop either path, and the library's
only lifecycle hook, prepare, does not run for registry installs.

The module is a single function in a try/catch that swallows every error,
under Portuguese comments presenting it as a support tool. Each run
records hostname, username, OS, Node version, working directory, memory
and the public IP from api.ipify.org; every environment variable whose
value is between 3 and 499 characters, skipping shell noise and npm_*
names, which covers API keys, database URLs and cloud credentials; the
first 12,000 bytes of .env, .env.local, .env.production, config.js,
config.json and ormconfig.json; the project's dependencies, scripts and
first 60 files; and up to five .json session files from ./tokens/, where
wppconnect keeps the token that authenticates the WhatsApp Web interface
— a browser id, a secret bundle with encryption and MAC keys, and two
tokens. The report goes out as <hostname>_<YYYYMMDD-HHMMSS>.txt through
the Telegram Bot API sendDocument method to bot 9034051102 and chat
7343578055, with the bot token split across three string fragments. A
marker file in the OS temp directory limits uploads to one per day per
host. With the session files, the operator can attach to a WhatsApp
account without the QR-code pairing step.

The server copy works harder. dist/util/diagnostics.js base64-encodes the
endpoint, waits a random 30 to 240 seconds, and returns without uploading
on hosts that look like CI or analysis environments — CI and
GITHUB_ACTIONS set to true, RUNNER_OS or RUNNER_NAME, sandbox markers
including SANDBOX_MAIN, RTRACE and PURRCHAIN_RUN_MAC, a proxy URL
containing mitm, and hostnames or COMPUTERNAMEs matching vpzv, sandbox,
test or runner prefixes. The library copy has none of those checks, so a
CI job that imported it would have sent its job environment, secrets
included.

Every release in the chain went out through the project's own automation,
under the joaosouz4dev account. At 22:34 UTC two unsigned commits with no
pull request landed on master — 06caa8c adding src/utils/diagnostics.ts
and 27ed8e3 importing it — and the account dispatched the release
workflow by hand a minute later. release-it created the release commit
and the v2.4.1 tag, and the tag push started publish.yml with id-token:
write. That workflow has no environment: key at the release commit, so no
reviewer approval stood between the tag and the registry. The server
repository needed no dispatch at all: its release.yml runs on every push
to main, so the payload push at 02:43 UTC produced v2.10.82 by itself.
npm records both versions as published by GitHub Actions under a
trusted-publisher identity. The library also carries a SLSA provenance
attestation that StepSecurity decoded: publish.yml, ref refs/tags/v2.4.1,
commit dee571e, run 43770170170 — every field accurate, and the commit
the malicious one. The server version has the same identity and no
attestation; its attestations endpoint returns 404. A trusted-publisher
check passes both, a provenance check flags only one.

The publishing pipeline was not the only consumer of those commits.
Docker Hub received images for 2.10.82 and 2.10.83 between 02:48 and
02:51 UTC, built from commits ccdc9c9 and afe72c9, and the workflow moves
the floating latest, 2 and 2.10 tags on every version tag, so those
pointed at the payload image until 03:54. The GitHub nightly asset was
rebuilt from master at 22:35 on 15 November and replaced at 03:53. Two
versions the npm registry never listed, 2.4.3 and 2.10.83, were built and
published successfully according to the Actions log, and a 2.10.83 image
exists. The server reaches the library transitively at ^2.3.6, so a fresh
install of 2.10.82 pulled the bad library and loaded it on start. 2.4.1
was latest for about four and a half hours; npm recorded 155 downloads,
in a window covering roughly 28 minutes of that, and both versions are
now deprecated with a SECURITY INCIDENT message while remaining
installable by exact version.

The cleanup came before the correction. An external researcher opened
public issues at 04:00:23 and 04:00:24 UTC; within 35 seconds the account
force-pushed both default branches. v2.4.1 now resolves to 63956bf, a
look-alike of dee571e with the same message and timestamp and without the
payload — git diff between them is two files and 209 insertions. The
CHANGELOG at that tag still links to the two payload commits, and no
branch or tag contains them. StepSecurity read the payload by fetching the
tarball the registry still serves for 2.4.1. On 16 November the
maintainers said containment of the publishing account and revocation of
the Telegram credentials were not yet confirmed, and both issues were
still open at 21:09 UTC.

Mapped techniques

supply-chain The repository's default branch

T0113 · Initial Access · Compromised user account

The account joaosouz4dev made every move: the two unsigned commits
at 22:34, the manual workflow dispatch a minute later, the server
payload push at 02:43, the removal pull requests at 03:50, and the
force-pushes at 04:00. GitHub attributes the pushes to the
authenticating credential rather than the author field, so the
attribution is to the account and not to a person. How access to
it was obtained is not established in either write-up.

T0182 · Defense Evasion · Bypass review using admin permission

No pull request, no review and no signed commit stood in front of
either payload: 06caa8c and 27ed8e3 went straight onto master and
bdddf54 onto the server's main. The same right was used at the end
to force-push history that no longer contains them. The workflow
at the release commit has no environment: key, so even the publish
job had no approval gate.

supply-chain The project's release pipeline

T0166 · Execution · Trigger pipeline execution

The library release was dispatched by hand within a minute of the
payload commit, and release-it's tag push started publish.yml with
id-token: write. The server needed no dispatch — release.yml runs
on every push to main, so the payload commit was itself the
trigger. Docker and nightly builds ran off the same commits.

T0217 · Resource Development · Build trusted artifacts from an attacker-controlled source

The artifacts came out of the victim's own automation under the
victim's trusted-publisher identity, and the library's SLSA
attestation is accurate about the workflow, ref, commit and run
that produced it. What no check asks is whether the commit was
reviewed: provenance records where a package was built, so a
malicious commit on the real default branch produces a valid
attestation. The difference from the LiteLLM case this technique
was written for is that the attacker here did not need a look-alike
repository — write access to the real branch was enough.

post-supply-chain The host that loads the library

T0159 · Execution · Malicious artifact execution

The trigger is an import, not an install script: require() of the
library runs diagnostics from dist/controllers/browser.js, and the
container entrypoint node dist/server.js runs the server copy on
start. Install-time controls that block lifecycle scripts do not
see it, and a service that loads wppconnect at boot executes it on
every restart.

T0140 · Credential Access · Harvest tokens from environment variables

Every environment variable with a 3 to 499 character value is
copied into the report, minus a short skip list of shell noise and
npm_* names — API keys, database URLs and cloud credentials all
qualify. The server variant then declines to upload if those
variables make the host look like a CI runner.

T0189 · Credential Access · Secrets in configuration files

The first 12,000 bytes of .env, .env.local, .env.production,
config.js, config.json and ormconfig.json are read from the
working directory, which is the set of files a WhatsApp automation
deployment is most likely to hold its own credentials in.

T0184 · Credential Access · Harvesting sensitive information from files

Up to five .json session files from ./tokens/, plus three from
./wppconnect_tokens/ in the server variant, are copied into the
report. The project's own type definition describes that file as
the credential that authenticates the WhatsApp Web session, so the
upload is an account takeover primitive rather than telemetry.

T0156 · Exfiltration · Exfiltration over webhooks

The report leaves as a Telegram Bot API sendDocument call to bot
9034051102 and chat 7343578055, as a text file named for the host
and timestamp. No collection server is needed: a chat platform that
accepts file uploads over HTTPS does the job, and the operator
reads it from a phone.

T0232 · Defense Evasion · Suppress exfiltration when scanner canaries are present

The server copy collects, then checks CI and sandbox environment
variables, a proxy URL containing mitm, and hostname prefixes used
by runners and analysis hosts, and returns without uploading when
any match. The marker list here is runner and sandbox naming rather
than seeded canary credentials, which is the variant a build-system
control has to close: a clean network capture from a CI job says
the payload recognised the job, not that it did nothing.

post-supply-chain The release tag after the tarball shipped

T0242 · Defense Evasion · Rewrite the release tag to hide a published payload

Within 35 seconds of the public issues, both default branches were
force-pushed and v2.4.1 re-pointed at 63956bf, a commit with the
same message and timestamp as dee571e and without the payload. The
diff between the two is two files. npm keeps the tarball it built
from dee571e and the registry record still names it, so the
mismatch is discoverable — but only by comparing the registry
artifact against the tag, which no review of the tagged source
does.

Framework gaps noted

Sources