/

CVE-2026-48162

Severity:

CRITICAL RISK

(9.1)

Path Traversal (CWE-73) in Wazuh Distributed API Handler

CVE-2026-48162

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-73

Impact:

Sensitive File Disclosure and Administrative Privilege Escalation

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's DistributedAPI can cause the master node to return files outside the intended temporary-file location when processing a cluster request. A cluster peer that possesses the shared Fernet key may read sensitive files, including the API private key, and could forge administrator tokens for privileged REST API access.

Affected context

This issue affects Wazuh deployments using the vulnerable DistributedAPI cluster communication path in affected 4.x and 5.x beta releases. The risk exists when a cluster peer can submit a temporary-file reference that is processed by the master without canonicalization or confinement to the expected Wazuh directory. Exposure is especially serious when the master can read credentials or cryptographic key material from its filesystem.

Exploit preconditions

  • Attack surface: Wazuh cluster communication handled by the DistributedAPI
  • Required access: A cluster peer or equivalent position with access to the shared Fernet key
  • Trigger point: Processing of a requested temporary-file path by DistributedAPI.send_tmp_file()
  • Why exploitation is possible: The supplied path is joined to the Wazuh base path without canonicalization or effective confinement, allowing references to resolve outside the intended directory

Why this happens

The vulnerability results from treating an attacker-controlled file path as a trusted relative filename. Joining that value to a trusted base directory without canonicalizing the result and verifying that it remains within the permitted directory allows path traversal and absolute-path resolution.

This behavior maps to CWE-73: External Control of File Name or Path, in which externally influenced path data determines which filesystem object an application accesses. The resulting read operation can expose sensitive configuration, credentials, or cryptographic material.

Potential impact

  • An attacker may read files accessible to the Wazuh master process
  • Sensitive credentials or private keys could be disclosed
  • An attacker could forge administrator REST API tokens if the relevant signing key is exposed
  • Administrative API privileges could be obtained without creating a Wazuh account
  • Security monitoring configuration and protected data could be altered
  • The confidentiality and integrity of the Wazuh deployment could be compromised

General mitigation guidance

Mitigation generally focuses on enforcing a strict trust boundary around cluster file-transfer operations.

Common defensive patterns include:

  • Canonicalizing requested paths before filesystem access
  • Rejecting absolute paths and traversal components
  • Verifying that the resolved path remains beneath an explicitly permitted directory
  • Replacing filename-based requests with opaque, server-issued file identifiers
  • Limiting cluster peers and protecting shared authentication keys
  • Storing private keys outside broadly readable locations and applying least-privilege filesystem permissions
  • Running the Wazuh master with only the filesystem and administrative privileges it requires
  • Rotating exposed cryptographic material and invalidating tokens when key disclosure is suspected
  • Applying vendor-provided security fixes through the organization's normal patch-management process

How teams detect issues like this

Organizations can look for this weakness through:

  • Static analysis rules that flag filesystem joins involving externally controlled path values
  • Code review checks for missing canonicalization and containment validation
  • Tests covering absolute paths, traversal sequences, symlink resolution, and alternate path representations
  • Runtime monitoring for unusual cluster file-transfer requests or access to sensitive paths
  • Audit review for unexpected administrator token creation or use
  • Policy enforcement requiring allowlisted directories and opaque file references for internal transfer APIs
  • Automated security review tools that identify path traversal and uncontrolled file path patterns

Sources

SourceLink
github.comgithub.com/wazuh/wazuh/commit/de1eeedbe336744934be4e20d87d84a76e438cee
github.comgithub.com/wazuh/wazuh/pull/36246
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-r6f5-h662-8ffc

Frequently asked

questions

Exploitation is generally limited to an attacker who can act as, or compromise, a Wazuh cluster peer and obtain the shared Fernet key. It is not normally an unauthenticated internet-facing issue.

The attacker needs a trusted cluster communication position or equivalent access to the cluster authentication material. The master must also be able to read the targeted file.

Constrain file-transfer requests to an explicitly allowlisted directory after canonicalization, reject absolute and traversal-based paths, and prefer opaque server-issued file identifiers over caller-supplied filenames.

Treat all path components from peers as untrusted, enforce filesystem least privilege, protect and rotate cluster keys, and include traversal and sensitive-file access cases in automated tests and security reviews.

Find out what's already
exploitable in your codebase.