/

CVE-2026-74038

Severity:

HIGH RISK

(7.1)

Path Traversal (CWE-22) in Wazuh Agent Enrollment Service

CVE-2026-74038

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Remote Denial of Service

Severity:

HIGH RISK

(7.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 agent enrollment allows unauthenticated remote attackers to influence filesystem paths through an agent name containing dot-sequence components. Under affected configurations, this can cause queue subdirectories to be removed, resulting in denial of service and requiring manual recovery of Wazuh services.

Affected context

The vulnerability occurs in Wazuh deployments that expose the agent enrollment service and process attacker-controlled agent names. Risk is present when name validation permits traversal components and subsequent filesystem operations concatenate the name into paths without reliably constraining the result to the intended queue directory.

Exploit preconditions

  • Attack surface: The remotely reachable Wazuh agent enrollment port
  • Required access: No authentication is generally required when enrollment is exposed
  • Trigger point: Agent enrollment followed by filesystem cleanup or deletion handling
  • Why exploitation is possible: Insufficient validation in OS_IsValidName() can allow traversal-oriented names to reach delete_diff(), where unsafe path construction may resolve outside the intended agent directory

Why this happens

The underlying bug is improper neutralization of path traversal elements in attacker-controlled names, mapping to CWE-22: Improper Limitation of a Pathname to a Restricted Directory. A name accepted at the application boundary is later used in filesystem path concatenation without canonicalization and containment checks, allowing the resulting path to reference a parent queue directory rather than only the intended agent-specific location.

Potential impact

  • Wazuh queue subdirectories may be deleted
  • Wazuh services may stop or become unavailable
  • Security monitoring and alert processing could be disrupted
  • Manual recovery and restoration activities may be required
  • Other filesystem data could be at risk if equivalent unsafe paths are reachable

General mitigation guidance

Mitigation generally focuses on treating agent names as untrusted identifiers and enforcing filesystem containment at every path-building boundary.

Common defensive patterns include:

  • Allowlisting agent-name characters and rejecting traversal components before any filesystem operation
  • Canonicalizing paths and verifying that the resolved result remains beneath the intended base directory
  • Building paths with APIs that enforce directory containment rather than string concatenation
  • Separating enrollment input validation from cleanup and deletion logic
  • Restricting enrollment exposure to trusted networks or controlled access paths
  • Running services with the minimum filesystem permissions needed for normal operation
  • Protecting queue directories with ownership, access-control, and recovery mechanisms

How teams detect issues like this

Detection approaches may include:

  • Static analysis rules for path construction using externally supplied names
  • Code review checks for missing allowlists, canonicalization, and base-directory containment tests
  • Monitoring enrollment requests for unusual names, traversal indicators, or repeated failed registrations
  • File-integrity monitoring on Wazuh queue directories and service-state monitoring for unexpected shutdowns
  • Policy enforcement requiring authenticated or network-restricted enrollment where operationally feasible
  • Automated security review tools that identify path traversal and unsafe filesystem API patterns

Sources

SourceLink
github.comgithub.com/wazuh/wazuh/pull/35833
github.comgithub.com/wazuh/wazuh/security/advisories/GHSA-573w-mqw4-jvmr
vulncheck.comvulncheck.com/advisories/wazuh-path-traversal-dos-via-agent-enrollment

Frequently asked

questions

Yes. When the Wazuh enrollment port is reachable, an unauthenticated remote attacker may be able to trigger the vulnerable path-handling behavior through enrollment data.

Not necessarily. The described attack path relies on access to the enrollment service rather than an authenticated management account.

Reject unsafe agent identifiers with a strict allowlist, then canonicalize and verify every derived path remains within its intended directory before performing filesystem operations.

Treat names and paths received over network interfaces as untrusted, use containment-aware filesystem APIs, restrict enrollment exposure, apply least-privilege permissions, and monitor sensitive directories for unexpected changes.

Find out what's already
exploitable in your codebase.