Hermes WebUI < 0.51.368 - Profile-Scoped Authorization Bypass via Forged hermes_profile Cookie
Description
Hermes WebUI before 0.51.368 contains an authorization bypass vulnerability in the get_profile_cookie() function that accepts unauthenticated profile names from the hermes_profile cookie. An authenticated attacker can forge the hermes_profile cookie value to bypass profile-scoped authorization checks and access sessions, files, and resources across different profiles.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
1- Range: <0.51.368
Patches
Vulnerability mechanics
Root cause
"Missing cryptographic binding between the profile cookie and the session token allows an authenticated attacker to forge the hermes_profile cookie value."
Attack vector
An authenticated attacker who holds a valid session cookie can forge the `hermes_profile` cookie value to any arbitrary profile name (e.g., `alice`) because the old code did not cryptographically bind the profile cookie to the session token [ref_id=1]. By sending a request with a legitimate `hermes_session` cookie alongside a tampered `hermes_profile` cookie, the attacker bypasses profile-scoped authorization checks and gains access to sessions, files, and resources belonging to other profiles. The fix requires the profile cookie to carry an HMAC signature that is verified against the current session, preventing this forgery.
Affected code
The vulnerability resides in the `get_profile_cookie()` function in `api/helpers.py`. When authentication is enabled, the function previously accepted any profile name from the `hermes_profile` cookie without verifying that the value was cryptographically bound to the current session. The patch adds a signature verification step via `verify_profile_cookie_value()` that ties the profile cookie to the active `hermes_session` token.
What the fix does
The patch introduces two new functions — `sign_profile_cookie_value()` and `verify_profile_cookie_value()` — that HMAC-sign the profile name with a key derived from the active session token [patch_id=6466846]. When authentication is enabled, `get_profile_cookie()` now calls `verify_profile_cookie_value()` to ensure the profile cookie was issued for the same session that is presenting it. The new tests confirm that an unsigned profile cookie, a profile signed for a different session, and a profile signed with an expired session are all rejected. This closes the authorization bypass by making the profile cookie unforgeable without knowledge of the session secret.
Preconditions
- authThe attacker must have an authenticated session (valid hermes_session cookie).
- inputThe attacker must be able to set or modify the hermes_profile cookie in their HTTP request.
Generated on Jun 18, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- github.com/nesquena/hermes-webui/commit/9e96f5f6adf93b6d1e27ebddfb4d2833ca06ff3bmitrepatch
- www.vulncheck.com/advisories/hermes-webui-profile-scoped-authorization-bypass-via-forged-hermes-profile-cookiemitrethird-party-advisory
- github.com/nesquena/hermes-webui/pull/4023mitretechnical-description
- github.com/nesquena/hermes-webui/pull/4036mitreissue-tracking
- github.com/nesquena/hermes-webui/releases/tag/v0.51.368mitrerelease-notes
News mentions
0No linked articles in our index yet.