Summary
Hermes WebUI before version 0.51.788 exposes terminal-related API endpoints without enforcing authentication, allowing remote creation and control of shell sessions.
An attacker on the network can issue a series of unauthenticated HTTP requests to start a PTY shell and send arbitrary commands, resulting in full command execution as the server process user.
Affected context
This vulnerability affects deployments of Hermes WebUI that expose its HTTP interface, particularly in environments where the embedded terminal or console API is reachable from untrusted networks.
It manifests when terminal session management, PTY attachments, and command input endpoints are accessible without any authentication or authorization checks.
The risk is elevated in scenarios where the Hermes process runs with broad system privileges or on hosts that have access to sensitive internal services or data.
Exploit preconditions
- Attack surface: Public or internal HTTP endpoints of the Hermes WebUI instance
- Required access: Network-level ability to send HTTP requests to the exposed WebUI terminal API; no valid credentials are needed
- Trigger point: Invoking the terminal/session creation endpoint, attaching a PTY shell, and writing commands via the terminal input endpoint
- Why exploitation is possible: The application fails to enforce authentication and authorization on critical terminal-control endpoints, treating all callers as implicitly trusted and allowing direct interaction with a system shell
Why this happens
The core issue is a broken access control pattern where security-critical functionality is exposed without authentication.
Terminal and PTY management endpoints are implemented as generic HTTP APIs but lack checks to verify the identity or privilege level of the caller before creating sessions or forwarding command input.
This aligns with CWE-306: Missing Authentication for Critical Function, where a system neglects to require authentication for operations that directly impact system integrity, resulting in unauthenticated command execution.
Potential impact
- Remote attackers may execute arbitrary shell commands as the Hermes WebUI server process user.
- Attackers could read, modify, or delete files accessible to the server process.
- Remote actors may pivot to internal network services reachable from the host, enabling lateral movement.
- System configuration and application data could be altered, leading to service disruption or data loss.
- Infrastructure may be co-opted for further attacks, such as installing backdoors or launching outbound attacks.
General mitigation guidance
Effective mitigation focuses on enforcing strict authentication and authorization for all security-sensitive endpoints and avoiding direct exposure of shell-like capabilities.
Common defensive patterns include:
- Requiring robust authentication (e.g., session-based, token-based, or mutual TLS) before allowing access to terminal and PTY APIs.
- Introducing fine-grained authorization controls so only explicitly permitted users can initiate or control shell sessions.
- Limiting or removing embedded terminal functionality in production environments to reduce attack surface.
- Ensuring the server process runs with least privilege, restricting file system and network access to what is strictly necessary.
- Applying network segmentation and access controls around administrative interfaces to confine them to trusted operations networks.
How teams detect issues like this
Organizations can identify and monitor for missing authentication on critical endpoints by:
- Reviewing API routes and controllers for security annotations or middleware ensuring authentication and authorization on terminal-related paths.
- Using static analysis or API security scanning tools to flag endpoints that perform privileged actions (e.g., spawning shells, manipulating sessions) without access control checks.
- Implementing centralized access control policies that require explicit opt-out for authentication, making it easier to spot unprotected routes.
- Monitoring logs for suspicious patterns, such as repeated unauthenticated terminal session creation or command input requests from unexpected IP addresses.
- Incorporating security-focused code review checklists that highlight any features providing command execution or administrative control, verifying they are protected by strong authentication.

