May 24, 2026·6 min read·118 visits
Unauthenticated prompt injection in hermes-agent Slack and Mattermost adapters allows attackers to trigger mass ping notifications via unescaped tags.
A vulnerability in the Slack and Mattermost platform adapters for NousResearch hermes-agent permits an unauthenticated remote attacker to execute arbitrary mass mentions. By leveraging prompt injection, an attacker can bypass output sanitization logic and trigger workspace-wide notification exhaustion.
The hermes-agent software facilitates communication between local Large Language Models and enterprise chat platforms. The agent operates platform-specific adapters to format and transmit LLM-generated output to Slack and Mattermost workspaces. Vulnerability CVE-2026-9354 exists within these adapters due to insufficient sanitization of platform-specific mention syntax.
The Slack adapter (gateway/platforms/slack.py) and the Mattermost adapter (gateway/platforms/mattermost.py) fail to neutralize mass-ping keywords. This failure allows the agent to issue workspace-wide notifications. The vulnerability is classified under CWE-116 (Improper Output Neutralization) for Slack and CWE-20 (Improper Input Validation) for Mattermost.
Unauthenticated remote attackers can exploit this via indirect prompt injection. By supplying malicious text that the LLM processes and outputs, the attacker coerces the agent into transmitting raw mass mentions. This mechanism triggers widespread notification exhaustion and disrupts workspace operations.
The vulnerability consists of two distinct implementation flaws across the platform adapters. The Slack adapter flaw originates from an overly permissive regular expression used during message formatting. The adapter attempts to protect valid Slack entities from subsequent formatting logic using a dedicated substitution function.
The regular expression re.sub(r'(<(?:[@#!]|(?:https?|mailto|tel):)[^>\n]+>)', ...) successfully matches valid user mentions and URLs. However, it also matches mass-ping tags such as <!everyone> and <!channel>. Because the matching logic protects these strings from sanitization, they are transmitted unaltered to the Slack API. The API processes the message with mrkdwn=True, executing the mass ping.
The Mattermost adapter vulnerability involves an omitted security configuration in the API payload construction. The adapter constructs a JSON payload for the /posts endpoint but fails to include the necessary properties to restrict bot mentions. The adapter code directly assigns the LLM output to the message field without establishing platform-specific guardrails.
Mattermost requires automated integrations to explicitly set the disable_mentions flag within the props object to suppress automated notifications. The hermes-agent implementation omits this property entirely. Consequently, the Mattermost server processes the LLM-generated @all string as a legitimate human-initiated workspace ping.
The Slack adapter formatting logic requires structural changes to prevent mass-mention preservation. The current implementation uses a capture group that inadvertently matches the exclamation mark used in Slack broadcast mentions.
# Vulnerable Slack Regex in gateway/platforms/slack.py
re.sub(r'(<(?:[@#!]|(?:https?|mailto|tel):)[^>\n]+>)', ...)The regex must be restricted to prevent matching broadcast directives. Alternatively, developers must implement a secondary sanitization pass that specifically neutralizes broadcast keywords after the initial parsing stage.
The Mattermost implementation requires a straightforward configuration patch. The vulnerable code constructs the outgoing message without the required restriction properties.
# Vulnerable Mattermost Payload in gateway/platforms/mattermost.py
payload = {
"channel_id": channel_id,
"message": content
}The fix requires appending the props dictionary with disable_mentions set to True. This instructs the Mattermost server to render the @all string as plain text rather than an active notification.
# Mitigated Mattermost Payload
payload = {
"channel_id": channel_id,
"message": content,
"props": {"disable_mentions": True}
}The fundamental data flow and bypass mechanics are illustrated below.
Exploitation relies on prompt injection methodologies. The attacker must control a portion of the input that the underlying LLM processes. This input is typically delivered via public channels, direct messages, or external data sources that the agent periodically ingests.
The attacker supplies a payload instructing the LLM to output specific strings. For Slack targets, the payload dictates the inclusion of the string literal <!everyone>. For Mattermost targets, the payload dictates the inclusion of the string literal @all.
A public Proof-of-Concept demonstrates the viability of this attack vector. The researcher verification script confirmed that the hermes-agent processes and transmits these strings without modification or filtering. The execution results in direct interaction with the chat platform's notification router.
The PoC execution log confirms the target platforms successfully parse and render the broadcast tags. The Mattermost server parsed @all due to the missing disable_mentions property. The Slack server executed <!everyone> due to the regular expression bypass protecting the raw tag.
The direct consequence of this vulnerability is a targeted notification exhaustion attack against enterprise environments. A single successful exploit triggers asynchronous alerts for every user within the workspace or channel. Repeated exploitation renders organizational communication platforms unusable.
The attack requires no authentication to the target chat platform. The attacker leverages the pre-existing API permissions granted to the hermes-agent integration. This access effectively bypasses internal network boundaries and platform access controls established by the organization.
The vulnerability carries a CVSS 4.0 score of 6.9, categorizing it as a medium severity flaw. The exploit requires low complexity and no user interaction, but the direct impact is limited to availability and systemic notification integrity.
As of the disclosure date, there is no evidence of active exploitation in the wild. The vulnerability is not currently listed in the CISA Known Exploited Vulnerabilities catalog.
NousResearch has not released an official patch for version 2026.4.16. Organizations operating hermes-agent must implement manual source code workarounds to mitigate the vulnerability. Modifying the adapter source code is the primary immediate remediation strategy.
Administrators must update gateway/platforms/mattermost.py to include the disable_mentions property in the /posts JSON payload. This single configuration change completely eliminates the mass mention vector for Mattermost deployments.
Slack deployments require either regex modification or secondary sanitization within gateway/platforms/slack.py. Implementing a dedicated string replacement function to neutralize <!everyone> and <!channel> prior to API transmission provides reliable mitigation.
Organizations should also deploy LLM guardrails independently of the platform adapters. Output-filtering middleware that intercepts and inspects generated text adds defense-in-depth and prevents similar injection bypasses in future integration implementations.
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N/E:P| Product | Affected Versions | Fixed Version |
|---|---|---|
hermes-agent NousResearch | <= 2026.4.16 | - |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-116 / CWE-20 |
| Attack Vector | Network (Prompt Injection) |
| CVSS 4.0 | 6.9 (Medium) |
| CVSS 3.1 | 5.4 (Medium) |
| Impact | Availability (Notification Exhaustion) |
| Exploit Status | Public PoC Available |
| CISA KEV | Not Listed |
Improper output escaping and missing security properties allow injection of raw broadcast notification tags.
An authentication bypass and privilege escalation vulnerability exists in Filament (filamentphp/filament) due to missing password verification during multi-factor authentication (MFA) setup and management. An attacker with access to an active session can modify or disable MFA, leading to account hijacking.
A critical Denial of Service (DoS) vulnerability exists in @socket.io/cluster-engine before version 0.1.1. Unauthenticated remote attackers can crash the server process by supplying inherited prototype property names as session identifiers.
A vulnerability in the Client-Side Field-Level Encryption (CSFLE) component of the MongoDB Python Driver (PyMongo) allows an attacker with database write access to trigger local Unix domain socket connections. By manipulating the Key Management Service (KMS) endpoint configuration inside the key vault collection to end with a '.sock' extension, an attacker forces the application to perform a Server-Side Request Forgery (SSRF) against internal Unix domain sockets.
A critical double-free vulnerability exists in the Transparent Inter-Process Communication (TIPC) module of the Linux kernel, specifically within the fragment reassembly implementation in `tipc_buf_append()`. This vulnerability can be triggered locally or remotely to cause kernel heap corruption, leading to local privilege escalation or denial of service.
CVE-2026-72137 is a critical double-free vulnerability in the Linux kernel's XFRM (IPsec) subsystem. The vulnerability occurs when the kernel attempts to send NAT keepalive packets over UDP. Under specific transmission failure conditions, both the downstream networking stack and the upstream keepalive dispatcher attempt to free the same socket buffer (sk_buff) structure, leading to kernel memory corruption, denial of service, or potential local privilege escalation.
A critical host injection vulnerability exists in PyMongo's connection string parser prior to version 4.18.2. The parser globally decodes percent-encoded characters in the host portion before splitting on delimiters, allowing attackers to inject arbitrary servers into the database client's connection pool.