Skip to main content

CVE-2025-24016 — Vulnerability in github.com/wazuh/wazuh — CVE Details

CRITICAL
Actively Exploited

Wazuh server vulnerable to remote code execution

Published April 22, 2025Updated October 22, 2025Source: OSV

What Should I Do?

Patch Immediately

This vulnerability is confirmed under active exploitation (CISA KEV). Patch within 24-48 hours if possible.

Does your project use an affected github.com/wazuh/wazuh version?

Paste your go.sum to check it for CVE-2025-24016 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my go.sum

Summary

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)

Advisory Timeline

  • First published April 22, 2025 (583 days ago).
  • Last revised October 22, 2025 — 183 days after initial publication.
  • Added to CISA's Known Exploited Vulnerabilities catalog 48 days after publication.

Remediation

Upgrade to the fixed version using your package manager.

Go
Update github.com/wazuh/wazuh to 4.9.1 or later
go get github.com/wazuh/wazuh@v4.9.1

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: Go (1).

PackageFixed In
github.com/wazuh/wazuh Go · Affected: All versions4.9.1

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-502
    Deserialization of Untrusted DataMITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.9 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Changed
Confidentiality
Low
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:H/E:H

Frequently Asked Questions

What is CVE-2025-24016?
Wazuh server vulnerable to remote code execution. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.9/10).
How do I check if my project is affected by CVE-2025-24016?
CVE-2025-24016 affects github.com/wazuh/wazuh. It has a 45.5% probability of exploitation within 30 days (EPSS score). This vulnerability is listed in CISA's Known Exploited Vulnerabilities (KEV) catalog, meaning it is being actively exploited in the wild. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2025-24016 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.9

Maximum impact if exploited, often with little effort or access required.

EPSS Score (30-day exploit probability)
45.51%
EPSS percentile: 99.1

This places it in the top 5% of EPSS-scored vulnerabilities — 99.1% of tracked vulnerabilities score at or below it, so it is far more likely to be exploited than nearly all other tracked vulnerabilities.

Known Exploited Vulnerability

This vulnerability is in CISA's Known Exploited Vulnerabilities (KEV) catalog, indicating active exploitation in the wild.

Added to KEV catalog: June 10, 2025

Remediation deadline: July 1, 2025

Also Known As

GHSA-hcrc-79hj-m3qh
GO-2025-3459

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my go.sum