Summary
A path traversal vulnerability in Wazuh allows a cluster-authenticated node to cause the manager process to delete files outside the intended Wazuh directory. By supplying a crafted filename during cleanup of an unknown task, an attacker may remove configuration, credential, certificate, or ruleset files accessible to the manager.
Affected context
The issue occurs in Wazuh cluster processing when the manager handles a file-receiving cleanup request with an unknown task identifier. It is relevant to deployments where a cluster-authenticated node can submit such requests and the manager process has access to sensitive files. The affected behavior is present in Wazuh releases within the stated vulnerable version ranges.
Exploit preconditions
- Attack surface: Wazuh cluster communication and file-receiving cleanup handling
- Required access: Authentication as, or control of, a cluster node
- Trigger point: Processing a
syn_i_w_m_erequest associated with an unknown task identifier - Attacker-controlled input: A filename supplied to the cleanup operation
- Why exploitation is possible: The filename is joined to a base path without canonicalization or effective confinement, allowing absolute paths or traversal sequences to escape the intended directory
Why this happens
The vulnerability results from treating an attacker-controlled filename as a trusted filesystem path. The cleanup logic passes that value to path-joining functionality without canonicalizing the result and verifying that it remains within the permitted directory. This insecure path construction pattern maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly called path traversal.
Potential impact
- Sensitive Wazuh configuration files could be deleted
- API tokens or authentication material could be invalidated
- TLS certificates and cluster connectivity files could be removed
- Ruleset files could be deleted, reducing detection capability
- The Wazuh manager could become unavailable or fail to start
- Cluster and API communications could be disrupted
General mitigation guidance
Mitigation generally focuses on enforcing a strict filesystem trust boundary for all received filenames and cleanup targets.
Common defensive patterns include:
- Canonicalizing candidate paths before filesystem operations
- Rejecting absolute paths and traversal components
- Verifying that the resolved target remains beneath an approved directory
- Using allowlisted filenames or generated identifiers instead of client-supplied paths
- Separating temporary task files from configuration, credential, and certificate directories
- Running the manager with the minimum filesystem permissions required
- Applying protected-file controls and backups for critical configuration assets
- Treating cluster-node authentication as insufficient authorization for arbitrary file operations
How teams detect issues like this
Organizations can look for:
- Static analysis findings involving path joins with request-derived or message-derived values
- Code review signals where file deletion occurs without canonicalization and containment checks
- Tests covering absolute paths, traversal sequences, symbolic links, and unknown task identifiers
- Cluster audit events involving unusual cleanup requests or unexpected file targets
- File-integrity monitoring alerts for changes to configuration, credential, certificate, and ruleset files
- Policy enforcement requiring approved path-handling utilities for filesystem operations
Neutral automated code-review and SAST tools may help identify unsafe path construction patterns during development.

