/

CVE-2026-54083

Severity:

HIGH RISK

(8.1)

Path Traversal (CWE-22) in Wazuh ip-customblock Script

CVE-2026-54083

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Root-privileged arbitrary file creation and deletion

Severity:

HIGH RISK

(8.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

Wazuh's ip-customblock active response script contains a path traversal vulnerability that can allow arbitrary file creation or deletion when attacker-controlled alert data is used to construct filesystem paths.

An attacker who can trigger a matching alert with a crafted source-address value may cause the root-running response script to access paths outside its intended directory.

Affected context

The vulnerability occurs in Wazuh deployments that use the ip-customblock active response script to block and unblock source addresses. The script appends the alert JSON srcip value directly to the /ipblock/ directory without confirming that it is a valid IP address, allowing path components to escape the intended directory. Risk is greater when untrusted or externally influenced log events can trigger alert-matching active responses.

Exploit preconditions

  • Attack surface: Wazuh alert processing and the ip-customblock active response script
  • Required access: Ability to cause or influence log data that produces a matching alert with attacker-controlled srcip content
  • Trigger point: The block or unblock action that constructs a filesystem path from the alert field
  • Why exploitation is possible: The raw value is concatenated into a path without IP-format validation or traversal checks, and the active response daemon runs with root privileges

Why this happens

The script treats a field extracted from alert JSON as a trusted filesystem path component. It does not apply the IP validation used by related response scripts, such as validation through an IP-version check, before constructing the path. This insecure concatenation permits path traversal sequences to escape the fixed directory, mapping to CWE-22: Improper Limitation of a Pathname to a Restricted Directory.

Potential impact

  • An attacker could create empty files at arbitrary filesystem locations
  • An attacker could delete arbitrary files accessible to the root-running process
  • Sensitive credentials or Wazuh configuration could be damaged or removed
  • Wazuh monitoring and active response functions could be disrupted
  • Host compromise or broader operational impact could result from tampering with security controls

General mitigation guidance

Mitigation generally focuses on treating alert-derived values as untrusted data and preventing them from becoming unrestricted filesystem paths.

Common defensive patterns include:

  • Validate source-address values using a strict IP parser before any filesystem operation
  • Reject malformed values, directory separators, traversal components, and unexpected encodings
  • Prefer an opaque, controlled identifier or a fixed mapping rather than user-derived path components
  • Constrain file operations to an approved directory and verify the resolved path remains within it
  • Separate block and unblock permissions and run active response components with the least privilege necessary
  • Use allowlisted file operations and avoid root execution where operationally feasible
  • Protect alert ingestion and log sources against injection of fields that influence active responses

How teams detect issues like this

Detection approaches can include:

  • Static analysis rules for string concatenation or interpolation of external fields into filesystem paths
  • Code review checks for missing canonicalization, containment checks, and input validation before file operations
  • Tests using malformed address values and traversal-like path components to verify rejection
  • Runtime monitoring for unexpected file creation or deletion by Wazuh active response processes
  • Policy enforcement requiring strict parsers and allowlisted directories for security automation
  • Automated code review tools that flag path construction from alert, log, or request data

Sources

SourceLink
github.comgithub.com/wazuh/wazuh/commit/e6ef99025b2ca4ba8003efb591c51545006bc2d4
github.comgithub.com/wazuh/wazuh/security/advisories/GHSA-m4mf-qmhf-8vj6

Frequently asked

questions

Exploitation is not necessarily direct over the network. It depends on whether an attacker can influence log or alert content that reaches the ip-customblock active response workflow.

The attacker generally needs a way to cause a matching alert with a crafted srcip value. The precise access depends on the configured log sources, integrations, and alert rules.

Validate the value as a well-formed IP address before use, reject traversal-related input, and ensure every resolved path remains inside an approved directory.

Treat alert fields as untrusted, use strict typed parsers, avoid deriving filesystem paths directly from external values, apply least privilege, and monitor privileged automation for unexpected filesystem changes.

Find out what's already
exploitable in your codebase.