CVE-2025-24016: Wazuh Server Deserialization of Untrusted Data Vulnerability

Published Feb 10, 2025
·
Updated

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 (unhandledexc) to evaluate arbitrary python code.

Using the server API, it quite easy to trigger. For example, using the runas endpoint (implemented by runaslogin in api/api/controllers/securitycontroller.py): the authcontext argument is completely controlled by the attacker, and is forwarded to the master server to handle. By sending a malicious runas 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/{agentid}/config/{component}/{configuration} (api.controllers.agentcontroller.getagentconfig), 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 exception, wresults or Wazuh.

PoC To trigger using the server API (assuming default credentials): bash curl -X POST -k -u "wazuh-wui:MyS3cr37P450r.-" -H "Content-Type: application/json" --data '{"unhandledexc":{"class": "exit", "args": []}}' https://<worker-server>:55000/security/user/authenticate/runas 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)

Other sources

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

CISA

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 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 (unhandledexc) 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.

NVD

Affected Software

4 affected componentsFixes available
go/github.com/wazuh/wazuh>=4.4.0<4.9.1
4.9.1
Wazuh Wazuh Server>=4.4.0<4.9.1
Wazuh Wazuh>=4.4.0<4.9.1
Wazuh Wazuh Server

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/wazuh/wazuh to a version that resolves this vulnerability.

    Fixed in 4.9.1
  2. Upgrade

    Upgrade Wazuh to a version that resolves this vulnerability.

    Fixed in 4.9.1
  3. Compensating control

    Limit/disable API access to Wazuh server endpoints that can trigger the unsafe deserialization (e.g., the `security/user/authenticate/run_as` path and agent config endpoints like `/agents/{agent_id}/config/{component}/{configuration}`), so only trusted sources (e.g., internal Wazuh servers) can reach them.

Event History

Feb 10, 2025
CVE Published
via MITRE·07:08 PM
Data Sourced
via MITRE·07:08 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:15 PM
DescriptionSeverityWeaknessAffected Software
Apr 22, 2025
Advisory Published
via GitHub·04:53 PM
Jun 10, 2025
Known Exploited
via CISA·12:00 AM
Data Sourced
via CISA·12:00 AM
RemedyDescriptionAffected Software
News Published
via The Register·04:01 PM
News Published
via The Register·04:03 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-24016?

CVE-2025-24016 has a severity rating that indicates a critical risk due to the potential for remote code execution.

2

How do I fix CVE-2025-24016?

To fix CVE-2025-24016, upgrade your Wazuh installation to version 4.9.1 or later.

3

What versions of Wazuh are affected by CVE-2025-24016?

CVE-2025-24016 affects Wazuh versions starting from 4.4.0 up to and including 4.9.0.

4

What type of vulnerability is CVE-2025-24016?

CVE-2025-24016 is categorized as an unsafe deserialization vulnerability.

5

Can CVE-2025-24016 be exploited remotely?

Yes, CVE-2025-24016 can be exploited remotely, allowing attackers to execute arbitrary code on vulnerable servers.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203