CVE-2026-44901
Remote code execution via untrusted sort_casting in Wazuh result merge.
- CVSS 8.4
- CWE-502
- Design Defects
- Remote
Wazuh is a free and open source platform used for threat prevention, detection, and response. From 4.0.0 until 4.14.6 and 5.0.0-beta2, AffectedItemsWazuhResult.merge() in framework/wazuh/core/results.py trusts the sort_casting field in a cluster worker's JSON response. During a distributed API merge, attacker-controlled type names are resolved through Python builtins without an allowlist. A compromised worker can set sort_casting to exec and place Python source in affected_items, causing the master to execute the payload as root when responses from multiple nodes are merged. This issue is fixed in versions 4.14.6 and 5.0.0-beta2.
- CWE
- CWE-502
- CVSS base score
- 8.4
- Published
- 2026-08-19
- OWASP
- A08 Software and Data Integrity Failures
- Orthogonal defect classification
- Build/Package/Merge
- Code defect classification
- Serialization Issues
- Category
- Design Defects
- Subcategory
- Poorly Designed Access Controls
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- Wazuh
Solution
Upgrade Wazuh to version 4.14.6 (or later) / 5.0.0‑beta2 (or later).
Vulnerable code sample
import json
class AffectedItemsWazuhResult:
def __init__(self, items=None, sort_casting=None):
self.affected_items = items or []
self.sort_casting = sort_casting
def merge(self, other_json):
data = json.loads(other_json)
# VULNERABLE: unsanitized builtin resolution allows exec of attacker-controlled code
cast_func = getattr(__builtins__, data.get('sort_casting', 'str'))
self.affected_items.extend([cast_func(item) for item in data.get('affected_items', [])])Patched code sample
import json
class AffectedItemsWazuhResult:
def __init__(self, items=None, sort_casting=None):
self.affected_items = items or []
self.sort_casting = sort_casting
def merge(self, other_json):
data = json.loads(other_json)
# FIX: restrict to safe casting functions
allowed = {'str': str, 'int': int, 'float': float}
cast_name = data.get('sort_casting', 'str')
cast_func = allowed.get(cast_name, str)
self.affected_items.extend([cast_func(item) for item in data.get('affected_items', [])])Published fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- fix: add type validation check (wazuh/wazuh)
framework/wazuh/core/results.py · AffectedItemsWazuhResult.decode_json,framework/wazuh/core/results.py · merge
Cite this entry
@misc{vaitp:cve202644901,
title = {{Remote code execution via untrusted sort_casting in Wazuh result merge.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-44901},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-44901/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
