CVE-2025-24016
JSON

9.9criticalExploited

Remote code execution in Wazuh server

Severity
9.9critical CVSS:3.1 by GitHub_M
Exploit likelihood
45.5% (higher than 99% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-hcrc-79hj-m3qhGO-2025-3459

Description

Wazuh is a free and open source platform used for threat prevention, detection, and response. Starting in version 4.4.0 and prior to version 4.9.1, an unsafe deserialization vulnerability allows for remote code execution on Wazuh servers. 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. 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. Version 4.9.1 contains a fix.

Affected

Product or packageVersionsReported by
wazuh wazuh>= 4.4.0, < 4.9.1, from 4.4.0 before 4.9.1CVE List, NVD
github.com/wazuh/wazuh (Go)from 4.4.0 before 4.9.1, from 4.4.0+incompatible before 4.9.1+incompatibleGitHub Advisory Database, Go Vulnerability Database
Wazuh Wazuh ServerNot specifiedCISA KEV

All scores

GitHub_M9.9critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:H
GitHub9.9critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:H/E:H

Classification

CWE-502

SSVC (CISA-ADP): exploitation active, automatable no, technical impact total.

What each source says

CVE List

Wazuh is a free and open source platform used for threat prevention, detection, and response. Starting in version 4.4.0 and prior to version 4.9.1, an unsafe deserialization vulnerability allows for remote code execution on Wazuh servers. 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. 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. Version 4.9.1 contains a fix.

GitHub Advisory Database
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-> |
  |               |                     | <-payload-- |
  |               X <-----payload------ |             |
  |               |                     |             |

It is likely that there are more ways to reach the unsafe deserialization function (as_wazuh_object), some of them might even be accessible from different contexts (without credentials, or initiated by a compromised agent). I suggest fixing the root cause instead of attempting to sanitize inputs that reach it. Note that there are multiple other ways to execute arbitrary code in as_wazuh_object, easier by using a __callable__, or potentially abusing callable gadgets in exception, wresults or Wazuh.

PoC

To trigger using the server API (assuming default credentials):

curl -X POST -k -u "wazuh-wui:MyS3cr37P450r.*-" -H "Content-Type: application/json" --data '{"__unhandled_exc__":{"__class__": "exit", "__args__": []}}' https://<worker-server>: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)

Go Vulnerability Database

Remote code execution in Wazuh server in github.com/wazuh/wazuh

NVD (es)

Wazuh es una plataforma gratuita y de código abierto que se utiliza para la prevención, detección y respuesta ante amenazas. A partir de la versión 4.4.0 y antes de la versión 4.9.1, una vulnerabilidad de deserialización insegura permite la ejecución remota de código en servidores Wazuh. Los parámetros de DistributedAPI se serializan como JSON y se deserializan utilizando `as_wazuh_object` (en `framework/wazuh/core/cluster/common.py`). Si un atacante logra inyectar un diccionario no depurado en una solicitud/respuesta DAPI, puede falsificar una excepción no controlada (`__unhandled_exc__`) para evaluar código Python arbitrario. La vulnerabilidad puede ser activada por cualquier persona con acceso a la API (panel de control comprometido o servidores Wazuh en el clúster) o, en ciertas configuraciones, incluso por un agente comprometido. La versión 4.9.1 contiene una corrección.

CISA KEV

Wazuh contains a deserialization of untrusted data vulnerability that allows for remote code execution on Wazuh servers.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-24016 changed 2026-02-26CVE Terms of Use
GitHub Advisory DatabaseGHSA-hcrc-79hj-m3qh changed 2025-10-22CC-BY-4.0
Go Vulnerability DatabaseGO-2025-3459 changed 2026-03-03CC-BY-4.0
NVDCVE-2025-24016 changed 2026-06-17Public domain
CISA KEVCVE-2025-24016 changed 2025-06-10CC0-1.0