{"id":"CVE-2025-24016","aliases":["CVE-2025-24016","GHSA-hcrc-79hj-m3qh","GO-2025-3459"],"related":[],"kind":"vulnerability","state":"published","title":"Remote code execution in Wazuh server","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\nAn unsafe deserialization vulnerability allows for remote code execution on Wazuh servers.  \nThe 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.\n\n### Details\nDistributedAPI 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.  \n\nUsing 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.\n\nIt is also possible to exploit the bug as a compromised agent, in certain configurations.  \nA 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.\n\n```\nuser          server A              server B         agent\n  |               |                     |             |\n  | -get-config-> |                     |             |\n  |               | --get-config-dapi-> |             |\n  |               |                     | --getconf-> |\n  |               |                     | <-payload-- |\n  |               X <-----payload------ |             |\n  |               |                     |             |\n```\n\nIt 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`.\n\n### PoC\nTo trigger using the server API (assuming default credentials):  \n```bash\ncurl -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\n```\nthis will shut down the master server.\n\n### Impact\nThis is a remote code execution on Wazuh server, affecting the latest version (v4.9.0 at this time)","format":"markdown","source":"ghsa"},{"lang":"en","text":"Remote code execution in Wazuh server in github.com/wazuh/wazuh","format":"markdown","source":"go"},{"lang":"es","text":"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.","source":"nvd"},{"lang":"en","text":"Wazuh contains a deserialization of untrusted data vulnerability that allows for remote code execution on Wazuh servers.","source":"kev"}],"published":"2025-02-10T19:08:09.058Z","modified":"2026-06-17T08:57:53.677Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:H","score":9.9,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:H","score":9.9,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:H/E:H","score":9.9,"rating":"CRITICAL"}],"cwes":["CWE-502"],"affected":[{"ranges":[{"version":">= 4.4.0, < 4.9.1","status":"affected"}],"vendor":"wazuh","product":"wazuh","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"4.4.0","status":"affected","fixed":"4.9.1"}],"ecosystem":"Go","package":"github.com/wazuh/wazuh","purl":"pkg:golang/github.com/wazuh/wazuh","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"4.4.0+incompatible","status":"affected","fixed":"4.9.1+incompatible"}],"ecosystem":"Go","package":"github.com/wazuh/wazuh","purl":"pkg:golang/github.com/wazuh/wazuh","source":"go"},{"ranges":[{"status":"affected","introduced":"4.4.0","fixed":"4.9.1"}],"vendor":"wazuh","product":"wazuh","cpe":"cpe:2.3:a:wazuh:wazuh:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[],"vendor":"Wazuh","product":"Wazuh Server","source":"kev"}],"references":[{"url":"https://github.com/wazuh/wazuh/security/advisories/GHSA-hcrc-79hj-m3qh","tags":["exploit","kev","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd","kev"]},{"url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2025-24016","tags":["government-resource","us-government-resource","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-24016","tags":["advisory","kev"],"sources":["ghsa","go","kev"]},{"url":"https://github.com/wazuh/wazuh","tags":["package"],"sources":["ghsa"]},{"url":"https://wazuh.com/blog/addressing-the-cve-2025-24016-vulnerability/","tags":["kev"],"sources":["kev"]}],"credits":[],"assigner":"GitHub_M","kev":{"dateAdded":"2025-06-10","dueDate":"2025-07-01","name":"Wazuh Server Deserialization of Untrusted Data Vulnerability","requiredAction":"Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable.","ransomware":false,"notes":"https://wazuh.com/blog/addressing-the-cve-2025-24016-vulnerability/ ; https://github.com/wazuh/wazuh/security/advisories/GHSA-hcrc-79hj-m3qh ; https://nvd.nist.gov/vuln/detail/CVE-2025-24016"},"ssvc":{"scorer":"CISA-ADP","exploitation":"active","automatable":"no","technicalImpact":"total","date":"2025-08-20T03:56:07.089Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-24016","url":"https://www.cve.org/CVERecord?id=CVE-2025-24016","licence":"CVE Terms of Use","modified":"2026-02-26T19:09:19.971Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hcrc-79hj-m3qh","url":"https://github.com/advisories/GHSA-hcrc-79hj-m3qh","licence":"CC-BY-4.0","modified":"2025-10-22T19:27:44.000Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2025-3459","url":"https://pkg.go.dev/vuln/GO-2025-3459","licence":"CC-BY-4.0","modified":"2026-03-03T04:57:12.523Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-24016","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-24016","licence":"Public domain","modified":"2026-06-17T08:57:53.677Z"},{"source":"kev","name":"CISA KEV","id":"CVE-2025-24016","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog?search_api_fulltext=CVE-2025-24016","licence":"CC0-1.0","modified":"2025-06-10T00:00:00.000Z"}],"updatedAt":"2026-11-25T22:58:53.931Z","epss":{"score":0.45506,"percentile":0.99087,"date":"2026-11-30T12:00:22.000Z"}}