Get a Demo

Let's Patch It!

Book a short call with one our specialists, we'll walk you through how Endor Patches work, and ask you a few questions about your environment (like your primary programming languages and repository management). We'll also send you an email right after you fill out the form, feel free to reply with any questions you have in advance!

CVE

GHSA-hcrc-79hj-m3qh

Wazuh server vulnerable to remote code execution
Back to all
CVE

GHSA-hcrc-79hj-m3qh

Wazuh server vulnerable to remote code execution

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 aswazuhobject (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 runaslogin 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.agentcontroller.getagent_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 (aswazuhobject), 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 aswazuhobject, easier by using a  callable, or potentially abusing callable gadgets in exceptionwresults 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)

Package Versions Affected

Package Version
patch Availability
No items found.

Automatically patch vulnerabilities without upgrading

Fix Without Upgrading
Detect compatible fix
Apply safe remediation
Fix with a single pull request

CVSS Version

Severity
Base Score
CVSS Version
Score Vector
C
H
U
9.9
-
3.1
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:H
C
H
U
0
-
3.1
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:H/E:H
C
H
U
9.9
-
3.1
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:H

Related Resources

No items found.

References

https://github.com/wazuh/wazuh/security/advisories/GHSA-hcrc-79hj-m3qh, https://nvd.nist.gov/vuln/detail/CVE-2025-24016, https://github.com/wazuh/wazuh, https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2025-24016

Severity

9.9

CVSS Score
0
10

Basic Information

Ecosystem
Base CVSS
9.9
EPSS Probability
0.93403%
EPSS Percentile
0.99805%
Introduced Version
4.4.0
Fix Available
4.9.1

Fix Critical Vulnerabilities Instantly

Secure your app without upgrading.
Fix Without Upgrading