CVE-2026-140425: Hermes Agent's dashboard accepted any origin, so a page on another localhost port could steal its session token and run shell commands through /api/ws (fixed 0.22.7)
Hermes Agent 0.16.0 up to (not including) 0.22.7 served its web dashboard with a permissive CORS policy and a WebSocket origin check that trusted other localhost ports. Attacker-controlled content running on another local port could read the dashboard session token from GET /, open /api/ws, call shell.exec to run OS commands, and download files via /api/files/download. Fixed in 0.22.7.
What it is
The dashboard web server (hermes_cli/web_server.py) let pages from other origins on localhost read responses and open its WebSocket.
The session token is embedded in the response to GET /. Any page served from a different localhost port (for example a dev server or a local web app showing attacker content) could fetch it, connect to /api/ws, invoke shell.exec and pull files through /api/files/download.
Affected: hermes-agent >= 0.16.0 and < 0.22.7 (CWE-1385, missing origin validation in WebSockets). Fixed by PR #146636 / commit 5e7c2b2 in v0.22.7. NVD published the CVE on 1 December 2026.
How to check
- Run pip show hermes-agent and check the version is 0.22.7 or later.
- Check whether you run the Hermes dashboard while also serving other local web content on the same machine.
How to fix
- Upgrade hermes-agent to 0.22.7 or later.
- Stop the dashboard when you are not using it, and avoid running untrusted local web servers next to it.
- If you ran an affected version alongside untrusted local pages, rotate the API keys and credentials the agent can reach.
pip show hermes-agent | grep -i '^version'