Komari, Cross-Site WebSocket Hijacking (CSWSH), CVE-2023-XXXX (Critical)

Listen to this Post

How the CVE Works

The vulnerability arises in Komari’s WebSocket upgrader, which lacks proper origin validation. When an authenticated administrator visits a malicious webpage, the attacker can initiate a WebSocket connection to `wss:///api/admin/client//terminal` using the victim’s session cookies. The WebSocket endpoint processes arbitrary commands, leading to remote code execution (RCE). The PoC demonstrates sending an `uptime` command, but attackers can escalate to more harmful operations.

DailyCVE Form

Platform: Komari
Version: Pre-bd5a693
Vulnerability: CSWSH → RCE
Severity: Critical
Date: 2023-XX-XX

Prediction: Patch by 2023-XX-XX

What Undercode Say

Check WebSocket headers
curl -I -H "Origin: malicious.com" wss://<komari-addr>/api/admin/client/<uuid>/terminal
Mitigation snippet (Go):
if r.Header.Get("Origin") != "https://trusted-domain.com" {
w.WriteHeader(http.StatusForbidden)
return
}

How Exploit

1. Craft malicious HTML hosting WebSocket JS.

2. Lure admin to visit the page.

3. Hijack session via cookies.

4. Send RCE commands via WebSocket.

Protection from this CVE

  • Enable strict origin validation.
  • Implement CSRF tokens.
  • Disable CORS for WebSocket endpoints.

Impact

  • Full node compromise via admin sessions.
  • Unauthorized command execution.
  • Data exfiltration/system takeover.
    (Note: Replace `CVE-2023-XXXX` with the actual CVE ID if/when assigned.)

🎯Let’s Practice Exploiting & Learn Patching For Free:

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow DailyCVE & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin Featured Image

Scroll to Top