CVE-2025-39666
Executive Summary
CVE-2025-39666 is a local privilege escalation vulnerability in Checkmk, an IT monitoring solution. The flaw allows a site user (a non-root user within a Checkmk site context) to escalate their privileges to root. This is achieved by manipulating files within the site context that are later processed when the omd administrative command is executed by the root user. The vulnerability affects Checkmk versions 2.2.0 (which is End-of-Life), 2.3.0 before 2.3.0p46, 2.4.0 before 2.4.0p25, and 2.5.0 beta before 2.5.0b3. The CVSS score is currently 0.0, indicating that a full vector has not been assigned, but the impact is severe as it grants full root access from a low-privileged site user account.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not related to a package manager (NPM, PyPI, Go, Ruby) but is a core product vulnerability in Checkmk. The attack vector is local, requiring initial access as a site user. The risk is elevated in environments where multiple tenants or users have site access, as a compromised site user can fully compromise the host.
CVSS Breakdown & Threat Level
The CVSS score is listed as 0.0, which is unusual and likely indicates that the vector has not been officially published. Based on the vulnerability description, a reasonable assessment would be:
- Attack Vector (AV): Local (L) – The attacker must have local access as a site user.
- Attack Complexity (AC): Low (L) – The manipulation of files is straightforward.
- Privileges Required (PR): Low (L) – Requires a site user account.
- User Interaction (UI): None (N) – No user interaction required.
- Scope (S): Changed (C) – The vulnerable component (site context) allows escalation to a different privilege level (root).
- Confidentiality (C): High (H) – Root access allows reading all files.
- Integrity (I): High (H) – Root access allows modifying all files.
- Availability (A): High (H) – Root access can disrupt the entire system.
Estimated CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Estimated Base Score: 8.8 (High)
Threat Level: High. The vulnerability is easy to exploit once a site user account is obtained. The impact is total system compromise.
Deep Dive & Mechanics
Checkmk uses a multi-site architecture where each monitoring site runs under a dedicated system user (e.g., cmkadmin). The omd command is a privileged administrative tool used to manage these sites (create, start, stop, update). When omd is run by root, it performs operations that involve reading and writing files within the site's home directory.
The vulnerability lies in the fact that a site user can create or modify files within their site context (e.g., configuration files, scripts, or symbolic links) that are later processed by omd when executed by root. Because omd runs with root privileges, any file it processes from the site context can be leveraged for privilege escalation.
Attack Flow:
- Attacker gains access as a site user (e.g., via a compromised web interface or SSH).
- Attacker creates a malicious file or symbolic link within the site's directory (e.g.,
/omd/sites/<sitename>/tmp/exploit.sh). - Attacker triggers the
omdcommand (e.g., by runningomd startor waiting for a scheduled task) which is executed by root. - The
omdcommand processes the malicious file, executing the attacker's code with root privileges. - Attacker gains a root shell or backdoor.
The specific file manipulation technique is not publicly detailed, but common patterns include:
- Symbolic Link Attacks: Creating a symlink from a file that
omdwrites to, pointing to a critical system file (e.g.,/etc/passwd). - Script Injection: Placing a malicious script in a directory that
omdsources or executes. - Configuration Manipulation: Modifying site configuration files that
omdreads and acts upon, leading to arbitrary command execution.
Vulnerable vs. Patched Code
No specific code diff is publicly available. The patch likely involves:
- Input Validation: Ensuring that files processed by
omdare not controlled by the site user. - Privilege Dropping: Running parts of
omdwith reduced privileges before accessing site files. - File Ownership Checks: Verifying that files belong to the site user and are not symlinks to system files.
Vulnerable Behavior:
omd(as root) reads/writes files in/omd/sites/<sitename>/without verifying that the site user has not tampered with them.
Patched Behavior:
omd(as root) either drops privileges before accessing site files or validates file integrity (e.g., using checksums, ownership checks, or restricted directories).
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Access to a Checkmk server with a vulnerable version.
- A valid site user account (e.g.,
cmkadmin).
Exploitation Steps:
Gain Site User Access:
- Use a compromised web interface credential or SSH key.
- Example:
ssh cmkadmin@target
Create Malicious Script:
- Create a script that will be executed by
omd. - Example:
/omd/sites/mysite/tmp/exploit.sh
#!/bin/bash # This script will be run by root via omd cp /bin/bash /tmp/rootshell chmod +s /tmp/rootshell- Create a script that will be executed by
Trigger
omdExecution:- Run
omd start mysiteor wait for a cron job. - The
omdcommand, running as root, will process the site directory and execute the script.
- Run
Escalate Privileges:
- After execution, run
/tmp/rootshell -pto get a root shell.
- After execution, run
Alternative Method (Symlink Attack):
- Create a symlink from a file that
omdwrites to, pointing to/etc/sudoers. - Example:
ln -s /etc/sudoers /omd/sites/mysite/var/log/omd.log - When
omdwrites to the log file, it overwrites/etc/sudoers, allowing privilege escalation.
Blue Team (Detection & Prevention)
Detection:
- Monitor for unusual file creations or modifications in site directories by non-root users.
- Alert on
omdcommands executed by root that access user-controlled files. - Use auditd to track file operations in
/omd/sites/.
Prevention:
- Apply the patch immediately.
- Restrict site user access to only necessary commands.
- Use SELinux or AppArmor to confine
omdand site users. - Implement file integrity monitoring (e.g., AIDE, Tripwire) on site directories.
Indicators of Compromise (IOCs)
- File Paths:
/omd/sites/*/tmp/exploit.sh(or similar)/omd/sites/*/var/log/omd.log(if symlinked)/tmp/rootshell(setuid root shell)
- Processes:
omdexecuted by root with unusual arguments.- Shell processes spawned from
omdcontext.
- Network:
- Outbound connections from root shell (e.g., reverse shell).
- Logs:
/var/log/secureor/var/log/auth.logshowingomdexecution.- Audit logs showing file modifications in site directories.
Detection Engineering
YARA Rule
rule CVE_2025_39666_Checkmk_PrivEsc {
meta:
description = "Detects malicious scripts or symlinks used in CVE-2025-39666 Checkmk privilege escalation"
author = "Valters IT"
date = "2025-04-17"
reference = "CVE-2025-39666"
strings:
$script = "/omd/sites/" ascii wide
$symlink = "symlink" ascii wide
$setuid = "chmod +s" ascii wide
$bash = "/bin/bash" ascii wide
condition:
any of ($script, $symlink, $setuid, $bash) and
filesize < 10KB
}
Sigma Rule
title: Checkmk Privilege Escalation via omd Command
id: 8a9b3c2d-1e5f-4a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects suspicious file operations in Checkmk site directories that may indicate exploitation of CVE-2025-39666
author: Valters IT
date: 2025-04-17
logsource:
category: file_event
product: linux
detection:
selection:
TargetFilename|startswith: '/omd/sites/'
User|endswith: 'cmkadmin' # Adjust to site user pattern
condition: selection
falsepositives:
- Legitimate site administration activities
level: high
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-39666 Checkmk Privilege Escalation - Reverse Shell"; flow:to_server,established; content:"/bin/bash"; nocase; content:"-i"; distance:0; within:100; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade Checkmk to the patched versions:
- 2.3.0p46 or later
- 2.4.0p25 or later
- 2.5.0b3 or later
- Note: 2.2.0 is EOL and must be upgraded to a supported version.
- Restrict Site User Access: Limit which users can create or modify files in site directories.
- Audit Site Users: Review all site user accounts and remove unnecessary ones.
Long-Term Mitigations:
- Implement the principle of least privilege for site users.
- Use mandatory access controls (SELinux, AppArmor) to confine
omdand site processes. - Enable file integrity monitoring on critical directories.
- Regularly review Checkmk security advisories.
Workaround (if patching is not immediately possible):
- Remove write permissions for site users on directories processed by
omd(may break functionality). - Use a cron job to periodically check for unauthorized files in site directories.
Valters IT
{/* [Security Hash: 9D5BEC48EA07183D8E0AF813] */}