/

CVE-2026-53869

Severity:

HIGH RISK

(7.5)

Auth Bypass (CWE-306) in Hermes Agent WebSockets

CVE-2026-53869

Deferred

Vulnerability type

Category:

Authentication Bypass

CWE:

CWE-306

Impact:

Unauthorized access to WebSocket terminal interfaces

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Hermes Agent WebSocket endpoints before version 0.16.0 mishandle Host and Origin validation during upgrade requests, creating a DNS rebinding exposure.

A remote attacker can exploit this to bypass expected authentication controls on specific WebSocket endpoints and potentially inject commands or read terminal output when a victim accesses a malicious domain.

Affected context

This vulnerability affects Hermes Agent deployments that expose WebSocket endpoints such as /api/pty, /api/ws, /api/pub, and /api/events over HTTP(S).

It becomes relevant when the agent is reachable from a browser context (directly or via a reverse proxy) and relies on FastAPI HTTP middleware for enforcing Host, Origin, or authentication checks.

Because WebSocket upgrade traffic bypasses the middleware, the expected security controls may not be consistently applied to these endpoints.

Exploit preconditions

  • Attack surface: Browser-accessible WebSocket endpoints on Hermes Agent (/api/pty, /api/ws, /api/pub, /api/events).
  • Required access: Ability to trick a victim into visiting an attacker-controlled domain that can perform DNS rebinding against the Hermes Agent host.
  • Trigger point: Initiation of a WebSocket connection from the victim's browser after DNS rebinding causes the hostname to resolve to the Hermes Agent instance.
  • Why exploitation is possible: WebSocket upgrade requests are not passed through the FastAPI HTTP middleware responsible for Host/Origin/auth validation, so the application treats the rebinding-originated WebSocket as trusted, enabling unauthorized interaction with terminal-related functionality.

Why this happens

The root cause lies in a mismatch between security assumptions and framework behavior: security-critical checks were implemented in HTTP middleware that does not apply to WebSocket upgrade requests.

This design leaves WebSocket endpoints effectively unguarded with respect to Host/Origin verification and any authentication or authorization logic bound to the middleware.

Conceptually, this aligns with CWE-306: Missing Authentication for Critical Function, where sensitive operations (e.g., terminal access, event streams) are exposed without consistent authentication because they use a different request path and processing pipeline.

Potential impact

  • Unauthorized execution of commands through pseudo-terminal (PTY) WebSocket endpoints.
  • Unauthorized reading of terminal output and interactive shell sessions.
  • Unauthorized subscription to internal event or pub/sub streams.
  • Lateral movement within the environment if the Hermes Agent has access to other systems.
  • Exposure of sensitive operational data transmitted over WebSocket sessions.

General mitigation guidance

Mitigation typically involves ensuring that WebSocket endpoints enforce the same security guarantees as their HTTP counterparts.

Common defensive patterns include:

  • Applying authentication and authorization checks directly in WebSocket handlers rather than relying solely on HTTP middleware.
  • Performing strict Host and Origin validation for WebSocket upgrades, using explicit allowlists and rejecting ambiguous or changing origins.
  • Separating sensitive terminal and event-stream endpoints onto interfaces or networks not directly reachable by untrusted browsers.
  • Enforcing least-privilege access for any process that handles terminal sessions so that compromise yields minimal capabilities.
  • Centralizing access-control decisions so that changes in framework behavior (e.g., middleware coverage) cannot silently create unauthenticated paths.

How teams detect issues like this

Detection efforts can focus on identifying inconsistencies between HTTP and WebSocket security handling.

Useful strategies include:

  • Static analysis or code search to locate WebSocket route definitions and verify that they invoke explicit authentication and origin checks.
  • Code review checklists that flag any reliance on HTTP middleware for WebSocket security or that treat WebSockets as "internal only" without enforcement.
  • Automated tests or security scanners that attempt WebSocket connections from untrusted origins to confirm that Host/Origin validation is enforced.
  • Configuration and policy reviews for reverse proxies or gateways to ensure they apply origin and authentication controls to WebSocket upgrade requests as well.

Sources

SourceLink
github.comgithub.com/NousResearch/hermes-agent/commit/d9ec90585cf7616b5972e44cf8d92bb569fc3feb
github.comgithub.com/NousResearch/hermes-agent/pull/30221
github.comgithub.com/NousResearch/hermes-agent/pull/31685
github.comgithub.com/NousResearch/hermes-agent/releases/tag/v2026.6.5
vulncheck.comvulncheck.com/advisories/hermes-agent-dns-rebinding-bypass-via-websocket-endpoints

Frequently asked

questions

Yes. A remote attacker can host a malicious site and leverage DNS rebinding to cause a victim's browser to open WebSocket connections to the Hermes Agent without proper validation.

Not necessarily. Because authentication and Host/Origin checks are not consistently applied to WebSocket upgrade requests, an attacker may interact with sensitive endpoints without possessing valid credentials.

The safest pattern is to enforce explicit authentication, authorization, and strict Host/Origin checks directly in the WebSocket handlers, independent of HTTP middleware, ensuring that terminal and event endpoints are never reachable without proper verification.

Treat WebSockets as first-class, security-sensitive interfaces: ensure all communication paths (HTTP, WebSocket, gRPC, etc.) have aligned access controls, verify framework behavior around middleware and upgrade requests, and include WebSocket-specific tests and review items in the secure development lifecycle.

Find out what's already
exploitable in your codebase.