hermes-control-interface icon indicating copy to clipboard operation
hermes-control-interface copied to clipboard

[Security] Critical: WebSocket RBAC bypass allows viewer to execute arbitrary OS commands

Open BlessedOn3 opened this issue 6 months ago • 6 comments

Hi @bayendor,

I'm an independent security researcher. I found two privilege escalation vulnerabilities in hermes-control-interface that allow a viewer-role user to perform admin-only actions.

I sent you a DM on X (@bayendor) on 2026-05-25 but haven't received a response, so I'm opening this issue to make sure the report reaches you.

Summary (no full PoC — coordinated disclosure)

# Finding CVSS 3.1
01 WebSocket Terminal RBAC Bypass 9.9 Critical
02 File Write Missing Permission Check 7.5 High

FINDING-01 — WebSocket RBAC Bypass (CVSS 9.9)

src/server.js line ~5083 processes terminal-input messages from any authenticated user without checking the terminal permission. The REST equivalent (POST /api/terminal/exec) correctly enforces requirePerm('terminal.exec'), but the WebSocket path was missed.

Impact: a viewer account gets a full OS shell. The terminal session is also a shared singleton — a viewer can inject commands into an active admin session.

FINDING-02 — File Write Missing Permission Check (CVSS 7.5)

POST /api/file at line ~2792 applies requireCsrf but is missing requirePerm('files.write'). A viewer (who has files.read) can overwrite files within the explorer root using a valid CSRF token (always available via GET /api/auth/me).

What I'm asking

Please enable GitHub Security Advisories (Settings → Security → Advisories) so I can send the full report with PoCs privately, or reply with a contact email.

I'm following a 90-day coordinated disclosure window from 2026-05-25.

Reporter: Mateus Gama — [email protected]

BlessedOn3 avatar May 27 '26 13:05 BlessedOn3

Fixed in 1419564 and deployed to production.

FIX #66 — Security RBAC Bypass:

  1. WebSocket terminal-input (CVSS 9.9): Added permission gate — checks admin role or terminal permission before processing via WS.

  2. POST /api/file (CVSS 7.5): Added requireAuth + requirePerm('files.write'). 401 for no-auth, 403 for viewer.

Tests: 12/13 pass. Thanks @BlessedOn3 for the responsible disclosure.

xaspx avatar Jun 01 '26 04:06 xaspx

Hi @xaspx,

Thanks again for the quick fix and for the credit — really appreciated.

Now that both vulnerabilities are patched and deployed, I'd like to request that you create two GitHub Security Advisories (GHSAs) for them — one per finding. Since GitHub is a CNA, this is the fastest path to get official CVE IDs assigned automatically.

You can create them here:
Settings → Security → Security advisories → New draft security advisory

Here's a summary for each:


Advisory 1 — WebSocket Terminal RBAC Bypass

  • Severity: Critical — 9.9 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H)
  • CWE: CWE-862 (Missing Authorization)
  • Affected: <= 3.5.1 | Fixed: commit 1419564
  • Description: The WebSocket terminal-input handler checks only socket.authed without enforcing the terminal permission, allowing a viewer-role user to execute arbitrary OS commands via the shared PTY.

Advisory 2 — File Write Missing Permission Check

  • Severity: High — 7.5 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L)
  • CWE: CWE-862 (Missing Authorization)
  • Affected: <= 3.5.1 | Fixed: commit 1419564
  • Description: POST /api/file applies CSRF validation but omits requirePerm('files.write'), allowing a viewer to overwrite files within the configured explorer roots.

I have the full advisory content ready (descriptions, PoC, references) — happy to share as a collaborator on the drafts if that helps.

Thanks,
Mateus Gama

BlessedOn3 avatar Jun 01 '26 17:06 BlessedOn3

Hi @BlessedOn3 — thanks for the detailed advisory summaries!

I've created both GHSAs as drafts:

  1. WebSocket Terminal RBAC Bypass: https://github.com/xaspx/hermes-control-interface/security/advisories/GHSA-p2vm-qhqj-5r4h (Critical 9.9, CWE-862)

  2. File Write Missing Permission Check: https://github.com/xaspx/hermes-control-interface/security/advisories/GHSA-c99h-vx9f-5h2x (High 7.5, CWE-862)

Happy to add you as a collaborator on both drafts if you'd like to contribute the full PoC and descriptions. Let me know your preferred GitHub handle or email for the invitation.

Also — would you like to be credited in the advisories under your real name (Mateus Gama) or your GitHub handle (BlessedOn3)?

xaspx avatar Jun 02 '26 03:06 xaspx

Hi @bayendor — glad the summaries were useful! Please credit me as @BlessedOn3 on GitHub. Happy to contribute the full PoC and descriptions for both advisories.

Thanks for creating the GHSAs so quickly.

BlessedOn3 avatar Jun 02 '26 16:06 BlessedOn3

Thanks @BlessedOn3 — really appreciate the coordinated disclosure.

✅ Credited as @BlessedOn3 on both GHSAs — adding you as a collaborator now so you can contribute the full PoCs and descriptions directly.

Both advisories are drafted:

  • GHSA-p2vm-qhqj-5r4h — WebSocket Terminal RBAC Bypass (Critical 9.9)
  • GHSA-c99h-vx9f-5h2x — File Write Missing Permission Check (High 7.5)

Once the PoCs and descriptions are in, we'll publish them and request CVEs.

xaspx avatar Jun 03 '26 09:06 xaspx

Hi @baprender! Here's my PoC repository with full exploitation scripts for both findings:

🔗 https://github.com/BlessedOn3/poc-hermes-ws-rbac-bypass

It includes:

  • poc/ws_rbac_bypass.py — FINDING-01 (WebSocket Terminal RBAC Bypass)
  • poc/file_write_bypass.sh — FINDING-02 (File Write Missing Permission)
  • payloads/ — malicious profile + reverse shell payload

Could you send the collaborator invite to BlessedOn3 on GitHub so I can contribute the PoC descriptions directly to both advisories (GHSA-phjm-gxwg-9v4k and GHSA-x48c-p8bv-8h5t)?

Thanks!

BlessedOn3 avatar Jun 03 '26 18:06 BlessedOn3