CVE-2026-15311: NousResearch hermes-agent Matrix Adapter XSS Vulnerability
NousResearch hermes-agent contains a cross-site scripting (XSS) vulnerability in its Matrix Adapter component. When the MatrixAdapter processes Markdown-formatted messages and converts them to HTML, it fails to properly sanitize user-controlled input. An authenticated attacker can inject malicious scripts that execute in the context of another user's browser session, potentially stealing session tokens or performing actions on their behalf. The vulnerability requires the attacker to have valid credentials and user interaction (such as clicking a link), which limits its immediate threat scope. A fix is under review but not yet officially released.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 3.5 LOW · CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:L/A:N
- Weaknesses (CWE)
- CWE-79, CWE-94
- Affected products
- 0 configuration(s)
- Published / Modified
- 2026-07-10 / 2026-07-10
NVD description (verbatim)
A vulnerability was identified in NousResearch hermes-agent up to 2026.5.29.2. Affected by this issue is the function MatrixAdapter._markdown_to_html of the file gateway/platforms/matrix.py of the component Matrix Adapter. Such manipulation leads to cross site scripting. The attack can be executed remotely. The exploit is publicly available and might be used. The pull request to fix this issue awaits acceptance.
7 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability exists in the MatrixAdapter._markdown_to_html function within gateway/platforms/matrix.py of NousResearch hermes-agent versions up to 2026.5.29.2. The root cause is insufficient input validation and output encoding during Markdown-to-HTML conversion. An authenticated user can craft specially formatted Markdown containing script tags or event handlers that bypass sanitization filters. The vulnerability is classified under CWE-79 (Improper Neutralization of Input During Web Page Generation) and CWE-94 (Improper Control of Generation of Code), indicating both direct XSS and potential code generation risks. The attack surface is network-accessible and requires valid authentication credentials to exploit.
Business impact
This XSS vulnerability poses a lateral privilege escalation and session hijacking risk within organizations using hermes-agent for Matrix protocol integration. Compromised user sessions could allow attackers to impersonate legitimate users, exfiltrate sensitive conversations, or modify system configurations if those users have administrative privileges. For teams relying on hermes-agent for secure communications or sensitive workflow automation, the vulnerability undermines trust in message integrity. The impact is constrained by the requirement for valid user credentials and active browser interaction, reducing the risk of large-scale automated exploitation. However, targeted attacks against high-value users remain plausible.
Affected systems
NousResearch hermes-agent versions up to and including 2026.5.29.2 are affected. The vulnerability is specific to deployments using the Matrix Adapter component (gateway/platforms/matrix.py). Organizations running hermes-agent in production for Matrix protocol bridging should audit their deployment version immediately. Users on earlier versions are confirmed vulnerable; organizations should verify whether they have deployed any versions beyond 2026.5.29.2 as a temporary mitigation measure pending an official patch release.
Exploitability
The vulnerability is remotely exploitable but requires valid authentication credentials and user interaction, placing it in the LOW severity category per CVSS v3.1 (score 3.5). The presence of publicly available exploit code increases the likelihood of opportunistic attacks by insiders or those who have compromised valid credentials. The exploit does not require special technical skills once credentials are obtained—simple Markdown injection suffices. The bar for exploitation is moderate rather than trivial, reducing the risk of wormable spreading or mass automation, but organizations should still treat this as actionable within their patch management windows.
Remediation
Upgrade NousResearch hermes-agent to a patched version beyond 2026.5.29.2 as soon as it becomes available. The vendor's pull request to fix this issue is currently under review; monitor the NousResearch GitHub repository or security advisories for release announcements. Until an official patch is released, input validation can be strengthened by disabling or restricting Matrix Adapter functionality if not essential, or by implementing a Web Application Firewall (WAF) rule to detect and block Markdown payloads containing script tags in Matrix-bridged messages. Verify patch compatibility with your deployment architecture before rolling out updates to production.
Patch guidance
Verify availability of a patched version from NousResearch beyond 2026.5.29.2. Check the official NousResearch GitHub repository (https://github.com/NousResearch/hermes-agent) and their security advisory channels for patch release details and version numbers. When a patch becomes available, test it in a non-production environment first to confirm compatibility with your Matrix integration configuration and any custom modifications. Apply patches during a planned maintenance window and monitor application logs for any anomalies post-upgrade. If no patch has been released at the time of your assessment, escalate to NousResearch for an estimated remediation timeline.
Detection guidance
Monitor Matrix Adapter logs and gateway traffic for suspicious Markdown patterns, specifically payloads containing HTML script tags, event handler attributes (onclick, onerror), or encoded variants (<script>, <script>). Implement request/response inspection rules to flag Markdown messages with inline HTML or executable content destined for HTML rendering. Review access logs for authenticated sessions that generate unusual numbers of Markdown messages or messages from unexpected internal hosts. In application logs, search for conversion errors or sanitization bypass attempts in MatrixAdapter._markdown_to_html function calls. Consider deploying a WAF rule to block requests containing common XSS payloads in Markdown-formatted Matrix bridge traffic.
Why prioritize this
Although the CVSS score of 3.5 places this in the LOW severity bracket, the combination of public exploit availability, authenticated attack vector, and XSS impact on user sessions warrants timely remediation within a standard patch cycle (30–60 days). Prioritize this above theoretical vulnerabilities but below critical infrastructure risks. Organizations with high-value users or sensitive communications transiting hermes-agent should expedite patching. The pending pull request suggests a fix is imminent, so monitoring for patch availability should be treated as a near-term action item.
Risk score, explained
CVSS v3.1 base score of 3.5 reflects low severity: the vulnerability requires authentication (PR:L), low attack complexity (AC:L), remote access (AV:N), user interaction (UI:R), no privilege escalation (S:U), limited confidentiality impact (C:N), and low integrity impact (I:L) with no availability impact (A:N). While the score is low, the presence of public exploits and the practical attack scenario (authenticated insider or compromised credential holder injecting XSS) elevate real-world risk beyond the numerical score. CVSS does not account for organizational context (e.g., sensitivity of communications handled by hermes-agent), so security teams should adjust their own risk rating based on deployment criticality.
Frequently asked questions
Do I need credentials to exploit this vulnerability?
Yes. The CVSS vector indicates PR:L (low privilege required), meaning an authenticated user account is necessary to exploit the vulnerability. This rules out unauthenticated remote attacks but increases risk from insider threats or compromised user accounts.
Is this vulnerability actively exploited in the wild?
The vulnerability description notes that exploit code is publicly available. While not confirmed in widespread active exploitation, the availability of public code increases the risk of opportunistic or targeted attacks. Monitor NousResearch security advisories and vulnerability databases for confirmed exploitation reports.
What happens if my Matrix Adapter receives a malicious Markdown message?
When the MatrixAdapter processes the message and converts Markdown to HTML without proper sanitization, injected script tags execute in the recipient's browser within the hermes-agent interface context. An attacker could steal cookies, session tokens, or perform actions on behalf of the victim user.
Can I disable Matrix Adapter to mitigate this?
If Matrix protocol integration is not business-critical for your deployment, disabling or restricting the Matrix Adapter component is a valid temporary mitigation until a patch is available. This requires architectural review to ensure no dependent workflows are disrupted.
This analysis is provided for informational purposes and is accurate as of the published vulnerability date (2026-07-10). Patch availability, version numbers, and vendor remediation timelines are subject to change. Organizations should verify all patch version numbers against official vendor advisories before deployment. SEC.co does not assume liability for organizations' use of this information or consequences of patch application or non-application. Always test patches in a non-production environment first. Exploit code availability and active exploitation status may evolve; consult threat intelligence feeds for real-time threat assessment. Source: NVD (public-domain), retrieved 2026-08-17. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-10112LOWXSS in STUDENT-MANAGEMENT-SYSTEM 1.0 Dashboard
- CVE-2026-10228LOWXSS Vulnerability in raisulislamg4 Student Management System
- CVE-2026-10234LOWMettle Sendportal XSS Vulnerability – Campaign Handler Remote Exploit
- CVE-2026-10244LOWSourceCodester Pharmacy Sales and Inventory System XSS Vulnerability
- CVE-2026-10245LOWStored XSS in SourceCodester Pharmacy Sales and Inventory System 1.0
- CVE-2026-10246LOWStored XSS in SourceCodester Pharmacy System 1.0 – Remediation Guide
- CVE-2026-10247LOWXSS in SourceCodester Pharmacy Sales System 1.0
- CVE-2026-10514LOWCordysCRM Cross-Site Scripting (XSS) Vulnerability – Patch to 1.7.0