/

CVE-2026-30893

Severity:

CRITICAL RISK

(9.0)

Path Traversal / Arbitrary File Write in Wazuh

CVE-2026-30893

Analyzed

Vulnerability type

Category:

Path Traversal / Arbitrary File Write

CWE:

CWE-22, CWE-73

Impact:

Remote Code Execution via Arbitrary File Write

Severity:

CRITICAL RISK

(9.0)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A path traversal flaw in Wazuh's cluster synchronization extraction routine allows an authenticated cluster peer to write files outside the intended extraction directory on other nodes.

By abusing this, an attacker controlling a cluster peer can overwrite Python modules used by Wazuh components, which may lead to remote code execution in the Wazuh service context and, in some deployments, full system compromise.

Affected context

This vulnerability affects Wazuh deployments configured with clustering enabled between multiple nodes.

The issue exists in the logic that receives and extracts synchronized data from a cluster peer, where file paths contained in cluster payloads are not sufficiently constrained to the designated extraction directory.

It is relevant when:

  • Wazuh nodes trust other cluster peers for synchronization, and
  • The cluster daemon has permission to write to directories that influence code execution (such as Python module paths or service configuration paths).

Exploit preconditions

  • Attack surface: Wazuh cluster communication channel between nodes.
  • Required access: Ability to act as an authenticated cluster peer (e.g., compromised node, misconfigured cluster, or stolen cluster credentials/keys).
  • Trigger point: Initiation of a cluster synchronization operation that causes the vulnerable extraction routine to process attacker-controlled file paths.
  • Why exploitation is possible: The extraction routine fails to robustly normalize and validate incoming paths, allowing traversal sequences (e.g., ../) or equivalent constructs to escape the intended directory and overwrite arbitrary files writable by the Wazuh cluster daemon.

Why this happens

The core issue is insufficient validation of file paths received over the cluster synchronization mechanism.

Instead of strictly enforcing that all extracted files remain within a designated, canonical directory, the code trusts remote input and uses it to construct filesystem paths.

This behavior maps to:

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') — because user-controlled paths are not correctly normalized and checked against an allowed root.
  • CWE-73: External Control of File Name or Path — because a remote cluster peer effectively dictates the target filenames and locations for extracted data.

When the service runs with permissions that include Wazuh's code directories or other sensitive paths, this arbitrary file write primitive can be turned into code execution by overwriting Python modules or configuration used by the Wazuh components.

Potential impact

  • Overwriting Python modules imported by Wazuh components, which could lead to arbitrary code execution in the Wazuh service context.
  • Tampering with Wazuh detection or response logic to hide malicious activity or disable security controls.
  • Escalation to system-level compromise when the cluster daemon runs with elevated or root privileges.
  • Deployment of persistent backdoors by modifying startup scripts or service files accessible to the Wazuh process.
  • Lateral movement within a cluster by compromising one node and then abusing the vulnerability to control others.

General mitigation guidance

Effective mitigation focuses on constraining file system access during cluster synchronization and reducing the blast radius of any file writes:

  • Enforce strict path normalization and validation in synchronization handlers, ensuring that all extracted files remain within a single, predefined directory and rejecting any paths that attempt to traverse upward or escape this root.
  • Use safe file handling APIs that work with canonical paths and compare them against an allowed base directory before creating or writing files.
  • Run Wazuh cluster components with the minimum privileges required, avoiding root or system-level accounts where possible and restricting write access to sensitive directories such as Python library paths and system configuration locations.
  • Separate writable synchronization directories from code and configuration paths, so that even if file writes are abused, they cannot directly alter loaded modules or service definitions.
  • Apply defense-in-depth measures such as filesystem permissions, SELinux/AppArmor profiles, or containerization to limit the impact of compromised cluster peers.

How teams detect issues like this

Detection can leverage both code-level analysis and runtime monitoring:

  • Static analysis and code review: Look for file extraction or synchronization routines that construct paths from remote or peer-supplied input without canonicalization and root-directory checks. Red flags include direct concatenation of user-controlled strings into filesystem paths and lack of validation for .. segments or absolute paths.
  • Security policy enforcement: Incorporate checks in CI/CD pipelines that flag usage of unsafe file path handling patterns, and mandate reviews for code touching cluster synchronization or archive extraction.
  • Runtime monitoring: Observe Wazuh cluster nodes for unexpected file writes originating from the cluster daemon process, especially to code directories (e.g., Python modules used by Wazuh), service configuration paths, or other sensitive locations.
  • File integrity monitoring: Use FIM capabilities to detect unauthorized changes to Wazuh code, configuration directories, and critical system paths that should be static in normal operations.

Sources

SourceLink
github.comgithub.com/wazuh/wazuh/releases/tag/v4.14.4
github.comgithub.com/wazuh/wazuh/security/advisories/GHSA-m8rw-v4f6-8787

Frequently asked

questions

It is exploitable over the Wazuh cluster communication channel, not directly by arbitrary external clients.

An attacker generally needs to control or impersonate a cluster peer, which might be achieved by compromising one node, abusing misconfiguration, or obtaining cluster authentication material.

The attacker must be able to act as an authenticated cluster peer.

This typically means they already have access to a node in the cluster or to the credentials/keys used for cluster synchronization, enabling them to send crafted synchronization data that the vulnerable extraction routine will process.

The most robust fix is to enforce strict path confinement within the extraction routine: normalize incoming paths, reject any that attempt to traverse outside the intended directory, and ensure all file writes are explicitly scoped to a predefined, non-sensitive directory.

Combining this with least-privilege execution (so the cluster daemon cannot write to code or system directories) significantly reduces the risk.

Treat all remotely supplied paths as untrusted, centralize path validation utilities that enforce canonicalization and root-directory constraints, and mandate security reviews for any code handling file synchronization or extraction.

Additionally, adopt least-privilege deployment practices, segregate writable data from executable code, and integrate static analysis or security linters that specifically flag unvalidated file path usage.

Find out what's already
exploitable in your codebase.