Arbitrary file overwrite in Wazuh Manager enables root remote code execution

Note: This data is for reference and cybersecurity research purposes only.CyStack advises users not to use this information for unlawful purposes.

What is CVE-2026-74040?

CVE-2026-74040 is a vulnerability classified as Missing Authorization, affecting wazuh-manager (affected versions: 3.9.0 – < 4.14.8). This vulnerability is rated Critical, with a CVSS score of 9.4. Public exploit code or evidence is available for this vulnerability, but that does not confirm exploitation in the wild.

Overview

Original source data

Wazuh versions from 3.9.0 before 4.14.8 contain an arbitrary file overwrite vulnerability in MasterHandler.process_files_from_worker allowing a cluster worker to overwrite protected master files. Attackers controlling a worker can use a trailing-slash basename bypass and missing extra_valid enforcement to overwrite ossec.conf and agent.conf, achieving root remote code execution across the manager and every agent.

Affected products and scope

  • Wazuh wazuh-manager: affected from 3.9.0 up to, but not including, 4.14.8.
  • Patched release: 4.14.8.
  • Deployment scope: practical exposure requires a cluster with a manager and at least one worker that an attacker can control. The available evidence does not establish the status of parallel release branches or releases beyond the explicitly identified patched release.

Technical details

The flaw is in MasterHandler.process_files_from_worker, the component that processes files sent from a cluster worker to the manager. The handler checks some filenames using the raw path value, while the actual destination is canonicalized by safe_join() and os.path.normpath(). A trailing slash can make the raw-path basename check return an empty value even though the normalized destination is a protected file, allowing the excluded_files and client.keys checks to be bypassed. An independent defect is the failure to enforce extra_valid, allowing a worker to send master-sourced files such as agent.conf, rules, decoders, and lists. Exploitation requires control of a cluster worker and possession of the shared cluster key; the advisory states that API credentials and root access on the manager are not required. The vendor evidence demonstrates network reachability through the cluster file-transfer path, while the complete implementation details of the patch are not provided in the record.

Exploitability

The vulnerability is reachable through the manager-worker cluster communication path. An attacker must control a worker and its shared cluster key, which is a high-privilege prerequisite rather than an unauthenticated external attack. No user interaction is required, and the record rates the attack complexity as low after the prerequisite is met. The record marks public exploit material as available, and the vendor advisory describes a proof of concept with an over-the-wire cluster demonstration. The available evidence does not establish whether the flaw has been exploited in the wild.

Technical impact

The flaw lets a controlled worker write files within the manager's data scope even when the worker is not authorized to send those files. If ossec.conf is replaced, a root-running module process can load attacker-controlled configuration and execute code on the manager. If shared agent.conf content is replaced, the manager can merge and distribute that configuration to agents, extending the impact to root-level code execution on multiple systems. Rules, decoders, lists, and client.keys can also be used to evade detection, alter active response, or tamper with agent authentication. The impact is bounded by the requirement that the attacker first control a worker in an affected cluster.

Business impact

  • Manager compromise: Overwriting manager configuration can lead to root-level code execution on the manager.
  • Fleet-wide exposure: Replacing shared agent.conf content can cause the manager to merge and distribute attacker-controlled configuration to enrolled agents, potentially enabling root-level code execution across the fleet.
  • Reduced detection capability: Replacing rules, decoders, or lists can support alert evasion; changing ar.conf can affect active-response behavior.
  • Access and availability risk: Modifying client.keys can tamper with agent authentication, enable unauthorized enrollment, or disrupt agent communications. Actual impact depends on the cluster topology and on which files the controlled worker can submit.

Remediation

  1. Upgrade wazuh-manager to the exact patched release 4.14.8. Do not assume that parallel branches or other releases are covered without vendor confirmation.
  2. Until the upgrade is complete, isolate manager-worker cluster traffic to trusted worker hosts and remove workers that are compromised or no longer required. This is temporary containment, not a fix.
  3. Review and restore ossec.conf, agent.conf, ar.conf, rules, decoders, lists, and client.keys from trusted backups if unauthorized changes are found. Investigate the worker that submitted the changes.
  4. If maintaining a source fork, apply the advisory's remediation direction: canonicalize paths before basename and blocklist checks, reject cases where the normalized basename differs from the raw basename, enforce extra_valid directionality, and validate the basename of the reconstructed destination path.

Detection

  1. Inventory every wazuh-manager installation, identify the master-worker topology, and verify the exact installed version.
  2. Review cluster membership, shared cluster keys, and workers that are no longer trusted or are located in lower-trust network segments.
  3. Check the integrity of ossec.conf, shared agent.conf files, ar.conf, rules, decoders, lists, and client.keys on managers. Compare them with approved configuration or trusted backups to identify unexpected changes.
  4. Review telemetry for worker-initiated file synchronization, file replacement or rename activity, configuration reloads, and unexpected command-module or active-response changes. Treat this as precautionary monitoring, not as a confirmed IOC.
  5. The record does not provide a product-specific log signature or IOC. Therefore, the absence of suspicious events does not prove that a deployment is safe. If unauthorized changes are found, investigate the associated worker and restore affected files from a trusted source.
Sources (8)
Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.