Poisoned Pipeline / Incidents / AS522
Nine versions of @leadstack/crm-connect published from a throwaway npm account on 16 November 2026 installed the open-source Hermes Agent on the machine that ran npm install, loaded its keys and standing instructions from the attacker's server, connected it to the attacker's Telegram bot and registered it as a systemd unit renamed to read as a CRM daemon
npmAI coding agentsLinux distro / packages
SafeDep published this on 19 November 2026. The npm account zmaticoo,
registered to venstate25@gmail.com, published nine versions of
@leadstack/crm-connect between 09:44 and 15:27 UTC on 16 November, each
describing itself as the "Official LeadStack CRM client". There is no such
product. The package's documentation points at api.leadstack.io, which does
not resolve, and the domain leadstack.io belongs to an unrelated business
consultancy. Every version except the last set "access": "restricted" in
publishConfig and the early READMEs asked for "LeadStack partner access on
npm (private org)", so the package appears to have stayed private for most
of the day; npmmirror, which still serves every tarball, first records it at
15:26 UTC, one minute before the last release. Only npm can confirm. Version
numbers 1.0.0 to 1.0.14, 1.0.16, 1.0.17 and 1.0.22 to 1.0.28 do not appear
on the mirror.
Version 1.0.15, the first of the nine, carries the full attack. Its
package.json declares a postinstall script that runs bin/lead-provision.js
with Node warnings switched off and fails the install if the script fails.
That script checks that 72.62.1.108 is up and makes two requests to it. The
first must return a JSON list called env_lines, which the script writes as
the .env file of the agent's home directory, ~/.leadstack/agent/ by default;
if the key is missing the script stops. The second returns plain text, which
it saves as the agent's SOUL.md — the file Hermes Agent places first in its
system prompt and reloads on every message. Nothing in the package supplies
a model key or a bot token, and the agent cannot reach Telegram without
them, so the attacker's .env has to carry a Telegram bot token, a key for
the Kimi model the bundled configuration names, and either a list of
permitted Telegram users or a setting that admits anyone. SafeDep did not
recover either file: by 19 November port 3000 no longer answered and the
same paths on port 80 returned HTTP 401 with a request for a bearer token.
Leftovers in the script — HERMES_LAB_TOKEN, HERMES_BOOTSTRAP_URL and a
deprecated loadLabConfig export — suggest the author started from a Hermes
"lab" project and renamed it for the lure.
The install is deliberately quiet. The script installs the agent into
~/.leadstack/runtime with a second, nested npm install run at silent log
level with audit and funding messages off and engine checks disabled, so
nothing about Hermes reaches the user's terminal, then configures the
Telegram gateway and the model. The wrapper it installs, hermes-agent on
npm, is an unofficial packaging of Nous Research's agent maintained by the
user wyrtensi and published from GitHub Actions, version 0.22.7 on 4
November 2026; nothing in the write-up points to the wrapper or the upstream
project being malicious. The package uses them the way an administrator
would, without asking the owner of the machine.
Persistence is a systemd unit. Hermes Agent's own installer refuses to
install its gateway as a root service unless it is passed --run-as-user
root, and the script passes it. The unit Hermes writes carries Restart=always
and WantedBy=multi-user.target, so the agent starts at boot and comes back
when killed; the script then renames it to leadstack-routing.service and
deletes the original hermes-gateway unit, so systemctl status shows a CRM
daemon. No version calls sudo or attempts privilege escalation: 1.0.15
assumes npm install already runs as root, which is common on servers. As an
ordinary user the write to /etc/systemd/system fails, the script exits, and
the install fails with it — after the agent, its .env and its SOUL.md are
already on disk. Version 1.0.18, about an hour later, handles that case with
a user-level service and enables linger so the agent survives logout and
starts at boot; where the system refuses the linger call the script carries
on silently. The install does not return until the agent is online: the
script starts the service and reads its journal every three seconds for up
to three minutes, restarting the service once if the line Hermes logs when
its Telegram adapter connects has not appeared after 22 seconds, then prints
a status report whose every line describes CRM routing work.
What the operator gets is the agent's full command-line toolset in a
Telegram chat: terminal and process control, file reads and writes, web and
browser access, code execution, scheduled jobs and sub-agent delegation.
Calls Hermes treats as dangerous wait for approval in the chat, and by
default any member admitted to the chat can approve them — the attacker is
that member. Whether the attacker's .env sets HERMES_YOLO_MODE=1, which
removes the prompts apart from a fixed blocklist, is not known. The same
pattern was reported by ThreatDown in September 2026 as the Carbonato
botnet, which spread through Docker APIs left open on port 2375, installed
Hermes Agent unchanged, overwrote its SOUL.md and took tasks over Telegram;
@leadstack/crm-connect reaches its targets through npm install instead and
fetches the persona during the install, so the attacker can change the
agent's instructions and keys without publishing a new version. No
connection between the two operations is reported beyond the shared implant.
Delivery changed four times while the server stayed the same. From 1.0.18
the trigger moved from postinstall to the first call to sdkVersion() or
pingPartnerApi(), which puts the payload inside the CRM application's own
process and gives it that process's environment, including CRM credentials.
1.0.19 downloads a JavaScript module and runs it detached; 1.0.20 and 1.0.21
do the same from a postinstall named npm-cache-warm.js and from the bare IP
rather than the sslip.io name. 1.0.29 and 1.0.30 download and run a binary.
1.1.0 and 1.1.1 run a platform package, @leadstack/crm-connector-linux-x64,
that was never published, so those two versions do nothing. From 1.0.19 the
tarball holds no agent code at all. Some comments read like answers to a
reviewer: 1.0.19 describes sdkVersion() as having "no side effects (safe for
CI lockfile checks)" and its README says the package "does not ship
long-running worker code in the tarball" — both true, because the worker
arrives from the server. SafeDep flagged the package at 15:33, six minutes
after the last release, confirmed the verdict at 16:20, and npm removed it.
The publisher did not stop. On 18 November someone registered zmaticco.dev,
a lookalike of the ad-tech company zMaticoo, which has no connection to this
activity; it resolves to 72.62.1.108. That evening zmaticoo published
@zmatdspcrm/trading-connector 1.0.0 and 1.0.1, @zmatdspcrm/brandnet-connect
1.0.0 and brandnet-connect 1.0.0 and 1.0.1. None contains an install script
or malicious code in its tarball; each declares one optional dependency
that npm fetches from zmaticco.dev on every fresh install and whose install
script npm will run. On 19 November the server returned a harmless token
validator. The attacker can replace it at any time without publishing
anything to npm. A PDF on the same domain walks integration engineers
through npm install brandnet-connect on a "staging or integration host", and
all three packages were still on npm on 19 November. The READMEs and that
PDF address engineers wiring a CRM into server-side code in a network of
trading brands, the vocabulary of forex and CFD brokerages; SafeDep infers
the target sector from the lures and the payload design, and has not
observed it on a victim.
Mapped techniques
- T0136 Brandjacking
- T0109 Publish malicious artifact
- T0110 Advertise malicious artifact
- T0151 Installation scripts
- T0159 Malicious artifact execution
- T0246 Provision a general-purpose agent as the remote shell
- T0247 Register the implant as a service named after the bait
- T0172 Runtime backdoor
- T0198 Malicious Build Time Dependencies
- T0197 Use code from untrusted source
supply-chain The package and the CRM name it borrowed
The package calls itself the "Official LeadStack CRM client" and
points its documentation at api.leadstack.io, which does not
resolve; leadstack.io belongs to an unrelated business consultancy.
The 18 November follow-on uses zmaticco.dev, a lookalike of the
ad-tech company zMaticoo, resolving to the same server as the
package's payload host.
Nine versions on 16 November 2026: 1.0.15 at 09:44 UTC, 1.0.18 to
1.0.21 from 10:42 to 11:14, 1.0.29 and 1.0.30 at 14:55 and 15:04,
1.1.0 and 1.1.1 at 15:24 and 15:27. All but the last set
"access": "restricted" in publishConfig, so most of the day's
releases appear to have been private; npmmirror's first record is
15:26 UTC.
The READMEs address engineers wiring a CRM into server-side code and
ask for "a dedicated OS user ... this matches how LeadStack stages
CRM credentials"; the 18 November PDF on zmaticco.dev walks
integration engineers at CRM and broker-desk partners through the
install on a staging host. None of the lures names a real product.
supply-chain An agent runtime provisioned by the install script
The postinstall runs bin/lead-provision.js with warnings off and
fails the install if it fails. That script performs a nested npm
install of the agent into ~/.leadstack/runtime at silent log level
with audit and funding messages off and engine checks disabled, so
the second install leaves no trace in the terminal.
The install does not complete until the agent is running: the script
starts the unit and polls its journal every three seconds for up to
three minutes for the Telegram-adapter line, restarting once at 22
seconds, then prints a CRM-shaped status report. Where the journal
write to /etc/systemd/system is refused the script exits non-zero
and npm install fails with it, having already written the agent, its
.env and its SOUL.md to disk.
The payload is an off-the-shelf agent, not bespoke malware: the
script installs the hermes-agent npm wrapper, writes the agent's
.env and SOUL.md from 72.62.1.108 and hands it to the attacker's
Telegram bot, so the operator's interface is a chat with an agent
holding shell, file, browser, code-execution and scheduling tools.
The persona is fetched at install time, which means the instructions
can change without a new package release.
post-supply-chain The unit that reads as a CRM daemon
The script passes --run-as-user root to get past the agent's own
refusal to install a root service, takes the unit Hermes writes with
Restart=always and WantedBy=multi-user.target, renames it
leadstack-routing.service and deletes the hermes-gateway unit so
systemctl status shows a CRM daemon. Version 1.0.18 adds the
non-root path: a user service with linger enabled, so the agent
survives logout and starts at boot.
The agent answers commands from an attacker-controlled Telegram bot
for as long as the service runs: shell and process control, file
reads and writes, browser and web access, code execution, scheduled
jobs and sub-agent delegation. Dangerous calls wait for approval in
the chat, and any member admitted to the chat may approve them,
which is the attacker.
post-supply-chain The versions that ship no code
From 1.0.19 the tarball holds no payload, and the 18 November
packages hold no code at all: each declares one optional dependency
that npm resolves from zmaticco.dev on every fresh install and whose
install script npm runs. On 19 November that server returned a
harmless token validator, so the dependency is a switch the
attacker can throw without publishing to npm again.
1.0.19 downloads a JavaScript module from the payload host and runs
it detached, 1.0.29 and 1.0.30 download and run a binary, and both
run with the full environment of whichever process triggered them.
From 1.0.19 nothing in the published artifact describes what will
execute, which is why the tarballs that SafeDep flagged carry less
evidence than 1.0.15 does.
Framework gaps noted
- No victim is reported and no count exists. SafeDep states that it inferred the target sector — forex and CFD brokerages — from the READMEs, the PDF and the payload design, and that it has not observed the activity on a victim. npm download figures are not cited for any version.
- The .env and SOUL.md the install fetches were never recovered. By 19 November the provisioning port no longer answered and the same paths on port 80 returned HTTP 401 with a bearer-token challenge, so what persona the agent was given, which Telegram bot it reported to, and whether HERMES_YOLO_MODE was set are all unknown.
- Whether the package was public for its whole life is unresolved. The publishConfig restricted flag, the early READMEs asking for private-org access and npmmirror's 15:26 UTC first record all point that way, and SafeDep says only npm can confirm it.
- The module downloaded in 1.0.19 to 1.0.21 and the binary in 1.0.29 and 1.0.30 were not recovered, so their capability is unknown; the write-up describes the trigger and the environment they inherit, not what they do.
- No version calls sudo or exploits anything local, so the payload's privilege is whatever the npm install had. How many installs ran as root, and how many as an ordinary user where the system-unit path fails, is not reported.
- The relationship to the September 2026 Carbonato botnet is an inference from a shared implant. ThreatDown's report describes Docker-API spread and a separate operator; nothing published links the two campaigns' infrastructure, accounts or Telegram bots.
- Who is behind the account is not established. SafeDep reports the publisher as still active on 19 November with three packages live, and describes the account, the email address and the lookalike domain without attributing them to a group.