/

CVE-2026-48024

Severity:

CRITICAL RISK

(9.1)

Path Traversal (CWE-22) in Wazuh Cluster Synchronization

CVE-2026-48024

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Write and Potential Remote Code Execution

Severity:

CRITICAL RISK

(9.1)

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 vulnerability in Wazuh cluster synchronization allows a trusted or compromised peer to influence file paths used when processing merged synchronization archives. If the peer has access to the shared cluster encryption key and synchronization reaches the vulnerable processing path, it may overwrite sensitive files and potentially achieve code execution through service configuration changes.

Affected context

The issue occurs in Wazuh cluster deployments that process synchronization archives from cluster peers. It is associated with path construction using peer-controlled merge metadata and insufficient confinement of resulting paths to the intended cluster item directory. Risk is greatest where a peer can authenticate to the cluster synchronization mechanism, possess the shared Fernet key, and influence files that are later reloaded or executed by privileged Wazuh services.

Exploit preconditions

  • Attack surface: Wazuh cluster synchronization and merged archive processing
  • Required access: A cluster peer position or equivalent ability to produce authenticated synchronization data, including access to the shared Fernet key
  • Trigger point: Processing of merge metadata or merged-file headers by the master
  • Why exploitation is possible: Peer-controlled path components are not adequately confined to the declared cluster item directory, allowing writes outside the intended path
  • Additional condition for code execution: A sensitive, root-managed configuration or executable file must be overwritten and subsequently loaded or executed by a Wazuh service

Why this happens

The underlying bug is improper canonical path confinement. Wazuh constructs filesystem paths from values supplied through cluster synchronization data but does not reliably verify that the resolved path remains beneath the intended destination directory. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly called path traversal. The insecure pattern is trusting archive metadata or file headers as safe path components without robust normalization and containment checks before writing files.

Potential impact

  • An attacker may overwrite arbitrary files writable by the Wazuh service
  • Sensitive configuration or policy files could be modified
  • Wazuh services may load attacker-controlled settings
  • Root-level command execution could occur if privileged service configuration is replaced
  • Monitoring, detection, and response capabilities could be disrupted
  • The affected host or connected infrastructure could be exposed to further compromise

General mitigation guidance

Mitigation generally focuses on enforcing strict filesystem boundaries and reducing trust in synchronization metadata.

Common defensive patterns include:

  • Resolve candidate paths and verify that they remain within an approved destination directory before writing
  • Reject absolute paths, traversal components, unexpected separators, and ambiguous path encodings
  • Prefer allowlisted file names and schema-validated synchronization records over arbitrary path values
  • Separate archive extraction from privileged configuration locations
  • Run synchronization components with the minimum filesystem and operating-system privileges required
  • Protect cluster keys and restrict peer enrollment to authorized, monitored nodes
  • Use service controls that prevent unauthorized configuration changes from being loaded automatically

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules that identify filesystem writes built from archive metadata or network-controlled strings
  • Code review checks for canonicalization followed by containment validation before file access
  • Tests covering absolute paths, traversal sequences, encoded separators, symlinks, and platform-specific path behavior
  • Runtime monitoring for Wazuh service writes outside approved directories
  • File-integrity monitoring on sensitive configuration files such as ossec.conf
  • Policy enforcement that restricts cluster peers, protects shared keys, and audits synchronization activity

Automated security review tools may help identify suspicious path-joining and archive-extraction patterns, but should be supplemented with deployment-level controls.

Sources

SourceLink
github.comgithub.com/wazuh/wazuh/commit/88fc89fdfb1bf37b9d826e9c281a3d22655733de
github.comgithub.com/wazuh/wazuh/pull/36204
github.comgithub.com/wazuh/wazuh/releases/tag/v4.14.6
github.comgithub.com/wazuh/wazuh/releases/tag/v5.0.0-beta3
github.comgithub.com/wazuh/wazuh/security/advisories/GHSA-gh4h-fx78-q8xc

Frequently asked

questions

It can be exploitable across a Wazuh cluster when an attacker controls or compromises a participating peer and can produce synchronization data accepted by the master. It is not generally an unauthenticated internet-facing issue.

The relevant cluster trust conditions must usually be met, including peer access and possession or compromise of the shared Fernet key. The attacker also needs a synchronization path that reaches the vulnerable file-processing logic.

Enforce canonical path containment before every write, reject unsafe path forms, and replace arbitrary peer-supplied paths with strict allowlists and validated record schemas.

Treat archive metadata and synchronization headers as untrusted input, apply least privilege to cluster services, protect peer credentials and keys, and monitor integrity changes in privileged configuration files.

Find out what's already
exploitable in your codebase.