Skip to main content
Vulnerability Database/CVE-2026-74040

CVE-2026-74040: Wazuh Arbitrary File Overwrite RCE Vulnerability

CVE-2026-74040 is an arbitrary file overwrite flaw in Wazuh that enables remote code execution with root privileges. Attackers controlling a cluster worker can overwrite critical files to compromise the manager and agents.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-74040 Overview

CVE-2026-74040 is a critical arbitrary file overwrite vulnerability in Wazuh affecting versions 3.9.0 through 4.14.7. The flaw resides in the MasterHandler.process_files_from_worker function within the cluster synchronization logic. A cluster worker can bypass basename validation using a trailing slash and exploit missing extra_valid enforcement to overwrite protected master files, including ossec.conf and agent.conf. Successful exploitation yields root-level remote code execution on the Wazuh manager and propagates to every connected agent. The weakness is categorized as [CWE-862] Missing Authorization.

Critical Impact

An attacker controlling a Wazuh cluster worker can overwrite manager configuration files and achieve root remote code execution across the manager and all enrolled agents.

Affected Products

  • Wazuh versions 3.9.0 through 4.14.7
  • Wazuh Manager cluster deployments with worker nodes
  • Wazuh Agents receiving configuration from affected managers

Discovery Timeline

  • 2026-10-13 - CVE-2026-74040 published to NVD
  • 2026-10-15 - Last updated in NVD database

Technical Details for CVE-2026-74040

Vulnerability Analysis

Wazuh clusters distribute configuration and integrity files between a master node and one or more worker nodes. The MasterHandler.process_files_from_worker routine ingests file updates sent by workers and writes them to the master's filesystem. The handler relies on basename checks to decide whether an incoming file corresponds to a protected master-controlled artifact. By submitting a filename containing a trailing slash, an attacker causes the basename comparison to resolve to an empty or non-matching string. The code path then treats the file as acceptable worker-origin content and overwrites the target on disk.

The handler additionally fails to enforce the extra_valid constraint that is intended to restrict which files a worker may push upstream. Combined, these two defects let a compromised or malicious worker write arbitrary content to any path reachable by the manager process, which runs as root.

Root Cause

The root cause is a missing authorization check [CWE-862] in the cluster file synchronization path. Basename normalization uses an unsafe string operation that is defeated by a trailing-slash suffix, and the extra_valid whitelist is not consulted before file write operations. See the GitHub Security Advisory GHSA-88p6-7cm8-xwj8 for the vendor's technical description.

Attack Vector

Exploitation requires control of a Wazuh cluster worker node or the ability to impersonate one on the cluster network. The attacker crafts a synchronization message that references a protected file such as /var/ossec/etc/ossec.conf or /var/ossec/etc/shared/agent.conf using a trailing-slash basename bypass. The manager accepts and writes the attacker-supplied content. Because agent.conf is distributed to every connected agent, injected directives execute as root on both the manager and the agent fleet. Technical details are documented in the VulnCheck Advisory for Wazuh RCE.

Stop Remote Code Execution Before It Runs

Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.

Stop Exploit Attempts

Detection Methods for CVE-2026-74040

Indicators of Compromise

  • Unexpected modifications to /var/ossec/etc/ossec.conf or /var/ossec/etc/shared/agent.conf on the Wazuh manager.
  • Cluster synchronization log entries referencing filenames with trailing slashes or unusual path components.
  • New <command>, <localfile>, or <wodle> blocks appearing in agent configuration without a change ticket.
  • Agent processes spawning unexpected child processes such as shells or network utilities shortly after a configuration push.

Detection Strategies

  • Enable file integrity monitoring on /var/ossec/etc/ across the manager and all agents, alerting on any change outside sanctioned maintenance windows.
  • Audit cluster.log and ossec.log for process_files_from_worker activity and correlate with the originating worker identity.
  • Inspect running agent configuration against a known-good baseline to detect injected directives.

Monitoring Recommendations

  • Monitor network traffic on the Wazuh cluster port (default TCP 1516) for connections from unexpected sources.
  • Alert on root-owned process executions spawned by ossec-execd or wazuh-execd that are not part of approved active response scripts.
  • Track version inventory to confirm all manager and worker nodes are running patched builds.

How to Mitigate CVE-2026-74040

Immediate Actions Required

  • Upgrade all Wazuh manager and worker nodes to version 4.14.8 or later as published in the Wazuh v4.14.8 release.
  • Rotate the cluster authentication key defined in ossec.conf under the <cluster> section after patching.
  • Review ossec.conf and agent.conf on the master for unauthorized modifications and restore from a known-good backup if tampering is suspected.
  • Audit all connected agents for persistence artifacts introduced through malicious configuration directives.

Patch Information

Wazuh addressed CVE-2026-74040 in release 4.14.8. The fix enforces strict basename validation and applies extra_valid checks before writing worker-supplied files on the master. Refer to the GitHub Wazuh Release v4.14.8 notes and the GitHub Security Advisory GHSA-88p6-7cm8-xwj8 for upgrade procedures.

Workarounds

  • Restrict network access to the cluster port (default TCP 1516) using host firewalls or network ACLs so only authorized worker IP addresses can connect.
  • Isolate worker nodes on a dedicated management VLAN and harden their operating systems to reduce the risk of worker compromise.
  • If immediate upgrade is not possible, disable cluster worker nodes and operate the manager standalone until patching is complete.

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.