GitHub Advisoryadvisory · Go

GHSA-hcrc-79hj-m3qh Wazuh server vulnerable to remote code execution

CRITICAL Published 2025-04-22 Modified 2025-10-22 Official page ↗
Aliases
CVE-2025-24016
Ecosystem
Go
Packages
github.com/wazuh/wazuh
Severity
Critical
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:H/E:H
Weaknesses
CWE-502
Reviewed
2025-04-22

Affected packages

• Go github.com/wazuh/wazuh: >= 4.4.0, < 4.9.1 → fixed in 4.9.1

Description

Summary An unsafe deserialization vulnerability allows for remote code execution on Wazuh servers. The vulnerability can be triggered by anybody with API access (compromised dashboard or Wazuh servers in the cluster) or, in certain configurations, even by a compromised agent. Details DistributedAPI parameters are a serialized as JSON and deserialized using `as_wazuh_object` (in `framework/wazuh/core/cluster/common.py`). If an attacker manages to inject an unsanitized dictionary in DAPI request/response, they can forge an unhandled exception (`__unhandled_exc__`) to evaluate arbitrary python code. Using the server API, it quite easy to trigger. For example, using the `run_as` endpoint (implemented by `run_as_login` in `api/api/controllers/security_controller.py`): the `auth_context` argument is completely controlled by the attacker, and is forwarded to the master server to handle. By sending a malicious `run_as` request to a worker server, it is possible to execute code on the master server. It is also possible to exploit the bug as a compromised agent, in certain configurations. A compromised agent can respond to a `getconfig` request with a malicious JSON object (containing a serialized unhandled exception). If the `getconfig` request was caused because of a server API request to `/agents/{agent_id}/config/{component}/{configuration}` (`api.controllers.agent_controller.get_agent_config`), and the agent is managed by a server other than the one that received the server API request, the unsafe deserialization will occur on the server that received the original server API request. ``` user server A server B agent | | | | | -get-config-> | | | | | --get-config-dapi-> | | | | | --getconf-> | | | | :55000/security/user/authenticate/run_as ``` this will shut down the master server. Impact This is a remote code execution on Wazuh server, affecting the latest version (v4.9.0 at this time)

Related

Alias · CVE (1)

  • CVE-2025-24016 Wazuh is a free and open source platform used for threat prevention, detection, and response. vulnerability

Weakness · CWE (1)

  • CWE-502 Deserialization of Untrusted Data weakness

References