Fake npm CRM Package Hands an AI Agent’s Controls to a Telegram Bot
SafeDep says the npm package @leadstack/crm-connect installed the open-source Hermes Agent as a root systemd service, disguised it as a CRM daemon and connected it to the attacker's Telegram bot, apparently aiming at trading-firm servers.
A fake CRM connector on npm quietly installed an AI agent on the servers it landed on, then handed the controls to a Telegram bot run by the attacker. SafeDep says @leadstack/crm-connect set up Nous Research’s open-source Hermes Agent as a system service, gave it the attacker’s model key and bot token, and dressed the service up as “LeadStack routing”. Through the bot, the attacker gets a shell, file access, web browsing and scheduled jobs. npm has removed the package, but the publisher was still pushing new lures on Nov. 18.
For defenders
Packages: @leadstack/crm-connect versions 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, all published Nov. 16, 2026 by npm user zmaticoo. On Nov. 18 the same account published @zmatdspcrm/trading-connector, @zmatdspcrm/brandnet-connect and brandnet-connect, which carry no code but pull an optional dependency from the attacker’s server on every fresh install; that payload was harmless on Nov. 19 and can be swapped any time. SafeDep says all three were still on npm that day. LeadStack is a borrowed name, unrelated to the business at leadstack.io.
How it works (1.0.15): a postinstall script (T1195.002 (Supply Chain Compromise: Compromise Software Supply Chain)) pulls a .env and a SOUL.md persona from 72.62.1[.]108:3000 (T1105 (Ingress Tool Transfer)), silently installs the legitimate hermes-agent wrapper into ~/.leadstack/runtime, sets a Kimi model, and registers the Telegram gateway as a root systemd service with Restart=always (T1543.002 (Create or Modify System Process: Systemd Service)). Once the bot connects, it copies the unit to leadstack-routing.service and deletes hermes-gateway (T1036.004 (Masquerading: Masquerade Task or Service)). Commands then arrive over Telegram (T1102.002 (Web Service: Bidirectional Communication)). No version uses sudo; it relies on npm install already running as root. Version 1.0.18 falls back to a user service with linger.
Later versions: 1.0.19 onward ship no agent and instead download a JavaScript module or a binary from the same server and run it with the install’s full environment. SafeDep didn’t recover those payloads.
Target: the READMEs and a Nov. 18 PDF lure address integration engineers at “CRM / broker-desk partners” of trading brands, which SafeDep reads as forex and CFD brokerages after CRM credentials and lead data. That’s inference; no victim has been observed.
72.62.1[.]108 (ports 3000 and default)
72-62-1-108[.]sslip[.]io
zmaticco[.]dev (lookalike of ad-tech firm zMaticoo, which isn’t involved)leadstack-routing.service ; leadstack-ingest-worker.service
~/.leadstack/ ; ~/.config/leadstack/ ; ~/.local/share/leadstack/bin/
~/.leadstack/agent/.env ; ~/.leadstack/agent/SOUL.md ; ~/.leadstack/runtimeSHA-256 hashes for six package tarballs are in the Hunt Lead report below.
What it means for you
If you don’t build or run Node.js servers, this doesn’t touch you. If you do, the lesson is uncomfortable: an install command for a package that looks like ordinary business plumbing set up an AI assistant with full control of the machine and gave it to a stranger. Running npm install as root on a server is what made the worst version possible.
Do this now
- Search lockfiles for
@leadstack/crm-connect,@zmatdspcrm/*andbrandnet-connect, and for any dependency fetched from zmaticco[.]dev. - Check servers for
leadstack-routing.serviceand a~/.leadstackfolder, including under/root. - If you find either on a root install, rebuild the server and rotate every credential it or the app could reach; don’t try to clean it.
- Stop running
npm installas root, and consider installing with--ignore-scriptson servers.
Source article: Malicious npm Package Turns Hermes Agent into a Backdoor
Publisher: SafeDep
Published: Nov. 19, 2026
URL: https://safedep.io/blog/malicious-npm-leadstack-crm-connect-hermes-agent-backdoor
Executive Summary
SafeDep analyzed @leadstack/crm-connect, a malicious npm package published in nine versions on Nov. 16, 2026 by the npm user zmaticoo; no named threat actor or vendor alias has been attributed, and the “LeadStack” name is borrowed from an unrelated business. The package posed as a server-side CRM connector for lead ingest and affiliate attribution, and its lures, including a Nov. 18 PDF on the lookalike domain zmaticco[.]dev, address integration engineers at “CRM / broker-desk partners” of trading brands, which SafeDep reads as forex and CFD brokerages (an inference; no victim was observed). In version 1.0.15 a postinstall script fetched an agent .env and a SOUL.md persona from 72.62.1[.]108:3000, silently installed the legitimate Hermes Agent wrapper into ~/.leadstack/runtime, configured a Kimi model and the attacker’s Telegram bot, registered the gateway as a root systemd service, waited until the Telegram adapter connected, then renamed the unit to leadstack-routing.service and deleted the original hermes-gateway unit. Through the bot the attacker gets Hermes Agent’s full toolset: shell commands, file read and write, web browsing, code execution, cron jobs and sub-agents. Version 1.0.18 added a user-level service with linger for non-root installs; versions 1.0.19 to 1.1.1 dropped the agent and instead downloaded and ran a JavaScript module or binary with the install’s full environment. On Nov. 18 the same publisher released three code-free packages that pull an optional dependency from the attacker’s server on every fresh install. SafeDep notes that a ThreatDown report from September described a botnet using Hermes Agent as an implant via exposed Docker APIs; SafeDep calls this the first npm case it has seen. Hunt leads, false positive expectations and indicators are detailed below; no detection rules were published.
ATT&CK chain: Initial Access → Execution → Persistence → Defense Evasion → Command and Control
Hunt Lead Grid
| Hunt Lead Level | Hunt Lead Name | ATT&CK | Risk of False Positives |
|---|---|---|---|
| 1 (Junior) | LeadStack Packages, Units and Infrastructure Sweep | T1195.002 (Supply Chain Compromise: Compromise Software Supply Chain) | Low. The package names, unit names, ~/.leadstack paths and the single IP are specific to this campaign; the only realistic overlap is a researcher’s sandbox, so anchor on production hosts and lockfiles. |
| 2 (Pro) | npm Install Script Writing a systemd Unit | T1543.002 (Create or Modify System Process: Systemd Service), T1036.004 (Masquerading: Masquerade Task or Service) | Medium. A few packages legitimately install services, mostly agents and daemons run by admins; the rule anchors on a node or npm process tree writing to /etc/systemd/system or ~/.config/systemd/user, enabling linger, or renaming and deleting a unit during an install. |
| 3 (Elite) | Server Long-Polling Telegram and Calling an LLM API | T1102.002 (Web Service: Bidirectional Communication) | Medium to High. Chat-ops bots and AI features legitimately call Telegram and model APIs; the correlation anchors on a server with no business reason doing both, from a process launched by systemd under a recently created unit, and requires baselining which hosts are allowed to talk to these services. |
LeadStack Packages, Units and Infrastructure Sweep
The nine malicious versions of @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) were published between 09:44 and 15:27 UTC on Nov. 16, 2026, and the follow-on packages @zmatdspcrm/trading-connector, @zmatdspcrm/brandnet-connect and brandnet-connect appeared on the evening of Nov. 18 with an optional dependency fetched from zmaticco[.]dev. On hosts where the agent ran, SafeDep lists systemd units leadstack-routing.service and leadstack-ingest-worker.service and the directories ~/.leadstack/ (with agent/.env, agent/SOUL.md and runtime/), ~/.config/leadstack/ and ~/.local/share/leadstack/bin/, with /root as the home directory on root installs. The sweep is threefold: search every package-lock, yarn.lock and pnpm-lock in repositories and on servers for those package names and for any resolved URL on zmaticco[.]dev or 72.62.1[.]108; search hosts for the unit names and directories; and search proxy, DNS, firewall and flow logs for 72.62.1[.]108 (including port 3000), 72-62-1-108[.]sslip[.]io and zmaticco[.]dev.
Use software composition or lockfile inventory for the package search, EDR or configuration management queries for files and units, and network logs for the infrastructure, sweeping from Nov. 16, 2026 forward. Scope first to Linux application servers, webhook workers and integration hosts, since the payload’s systemd service, linger and seven-day re-run lock target long-lived servers, but include developer machines that installed the package. Do not rely on hash blocking of the package tarballs alone: the code-free Nov. 18 packages fetch whatever the server returns at install time, so a clean tarball hash says nothing about what ran. Any hit on a root install means full compromise; SafeDep’s guidance is to rebuild rather than clean and to rotate every credential the server or the application’s environment could reach, so escalate straight to incident response.
Hunt Lead Level: 1 (Junior Analyst)
ATT&CK: Initial Access → T1195.002 (Supply Chain Compromise: Compromise Software Supply Chain)
Sources: “Malicious npm Package Turns Hermes Agent into a Backdoor”, SafeDep, Nov. 19, 2026, https://safedep.io/blog/malicious-npm-leadstack-crm-connect-hermes-agent-backdoor (source article)
npm Install Script Writing a systemd Unit
In version 1.0.15, bin/postinstall.js runs bin/lead-provision.js, which performs a nested, silenced npm install of hermes-agent into ~/.leadstack/runtime, writes a gateway unit with Restart=always and WantedBy=multi-user.target into /etc/systemd/system, starts it, polls the service journal every three seconds for up to three minutes for the Telegram-connected log line (restarting once after 22 seconds), then copies the unit to leadstack-routing.service and deletes hermes-gateway. Version 1.0.18 instead writes a user unit and calls loginctl to enable linger. The detection is process lineage plus file activity: a process tree rooted in npm or node running an install lifecycle script that creates or deletes files under /etc/systemd/system/ or ~/.config/systemd/user/, runs systemctl enable, start or daemon-reload, runs loginctl enable-linger, or reads journalctl for a unit it just created. A unit renamed and its original removed within minutes is a strong masquerading signal on its own.
Collect process execution with full command lines and parent chains (auditd, eBPF-based EDR or Sysmon for Linux) and file creation and deletion events on the systemd unit directories. Sweep 30 to 90 days back on servers and build hosts, then run continuously. Expect a short list of legitimate packages that install services; allowlist them by package name and maintainer after review, not by unit path, and treat installs run as root on production servers as the highest-risk scope. Blocking the specific unit name is the wrong control, since the attacker changed delivery nine times in one day. The stronger preventive control is running dependency installs without root and with lifecycle scripts disabled where possible. The logic generalizes to any malicious package that persists through systemd, so keep it after this campaign; any hit on a production server should be escalated as a likely backdoor.
Hunt Lead Level: 2 (Pro)
ATT&CK: Persistence → T1543.002 (Create or Modify System Process: Systemd Service); Defense Evasion → T1036.004 (Masquerading: Masquerade Task or Service)
Sources: “Malicious npm Package Turns Hermes Agent into a Backdoor”, SafeDep, Nov. 19, 2026, https://safedep.io/blog/malicious-npm-leadstack-crm-connect-hermes-agent-backdoor (source article)
Server Long-Polling Telegram and Calling an LLM API
Once installed, Hermes Agent’s gateway keeps a connection to the attacker’s Telegram bot and sends the conversation to the configured model, kimi-k2-0711-preview via the kimi-coding provider in the bundled configuration; SafeDep advises looking for servers that long-poll api.telegram.org or call the Moonshot API at api.moonshot.ai without a reason to. Commands that Hermes classes as dangerous wait for approval in the chat, which the attacker, as the chat member, can give; whether the attacker’s .env set HERMES_YOLO_MODE=1 to skip approvals is unknown. The correlation to build joins network and process telemetry: a server-class host making repeated long-lived HTTPS sessions to Telegram’s Bot API (regular reconnects every few seconds to minutes) and also calling an LLM provider API, where the owning process is a Python or Node runtime launched by systemd from a unit created in the last 30 days, under a home directory path rather than a packaged install location. Add weight when the same process later spawns shells or package managers.
Use proxy or TLS inspection logs, DNS logs with process attribution from EDR, and the systemd unit inventory. Baseline which hosts are expected to talk to Telegram and to model providers (chat-ops bots, AI features) over at least 30 days and maintain that allowlist by host role and owning service, not by destination, because blocking Telegram or model APIs outright is wrong for organizations that use them and trivial for an attacker to swap for another bot platform or provider. Sweep back to Nov. 16, 2026. Telegram and Moonshot are legitimate services and must not be listed as indicators; the signal is an unexpected host and process using them. A confirmed hit means an interactive operator with shell access: isolate the host, preserve the .env and SOUL.md if present, and escalate. The technique generalizes to any open-source agent framework repurposed as an implant, as SafeDep notes ThreatDown previously reported with Hermes Agent on exposed Docker hosts.
Hunt Lead Level: 3 (Elite)
ATT&CK: Command and Control → T1102.002 (Web Service: Bidirectional Communication)
Sources: “Malicious npm Package Turns Hermes Agent into a Backdoor”, SafeDep, Nov. 19, 2026, https://safedep.io/blog/malicious-npm-leadstack-crm-connect-hermes-agent-backdoor (source article)
Hash Appendix
@leadstack/crm-connect package tarballs
SHA-256 values come from SafeDep’s indicator table; SafeDep listed six tarballs and published no MD5 or SHA-1 values, and none were looked up in OTX AlienVault or VirusTotal for this report. The downloaded JavaScript module and binary used by later versions were not recovered and have no hashes.
MD5s
(not available) # crm-connect-1.0.15.tgz -> postinstall installs Hermes Agent as root systemd service
(not available) # crm-connect-1.0.18.tgz -> agent install on first SDK call; user service with linger
(not available) # crm-connect-1.0.19.tgz -> downloads and runs JS module
(not available) # crm-connect-1.0.20.tgz -> postinstall runs detached JS module from sslip host
(not available) # crm-connect-1.0.21.tgz -> postinstall runs detached JS module from IP
(not available) # crm-connect-1.0.29.tgz -> postinstall downloads and runs a binary
SHA1s
(not available) # crm-connect-1.0.15.tgz -> postinstall installs Hermes Agent as root systemd service
(not available) # crm-connect-1.0.18.tgz -> agent install on first SDK call; user service with linger
(not available) # crm-connect-1.0.19.tgz -> downloads and runs JS module
(not available) # crm-connect-1.0.20.tgz -> postinstall runs detached JS module from sslip host
(not available) # crm-connect-1.0.21.tgz -> postinstall runs detached JS module from IP
(not available) # crm-connect-1.0.29.tgz -> postinstall downloads and runs a binary
SHA256s
29559f042f81c7a6cc642173eab09b0b02e369f47b594b68c78028ef2df10e4c # crm-connect-1.0.15.tgz -> postinstall installs Hermes Agent as root systemd service
8cd56c6a036ae6d08cc07e64f98a3af7d836204d7620203bee5b8fd7d6931757 # crm-connect-1.0.18.tgz -> agent install on first SDK call; user service with linger
3083068c322829c9840f0931f7adfb39b8357d0d8a074d7f1967174631443154 # crm-connect-1.0.19.tgz -> downloads and runs JS module
ce1812a6e1a5bc99cc705e44b10ae476324ea7930616508a11cc3173934e1abb # crm-connect-1.0.20.tgz -> postinstall runs detached JS module from sslip host
d95fad3aea003d6b53645daa8d724ac32e4b2e25e6e4c71264fdb15f8b8b3adb # crm-connect-1.0.21.tgz -> postinstall runs detached JS module from IP
8a2f9a526955a07b183c3f3658d2088eb4c8c66d3fcaf8fb91322944b82e6e92 # crm-connect-1.0.29.tgz -> postinstall downloads and runs a binary
References Appendix
- “Malicious npm Package Turns Hermes Agent into a Backdoor”, SafeDep, Nov. 19, 2026, https://safedep.io/blog/malicious-npm-leadstack-crm-connect-hermes-agent-backdoor