CVE-2025-66864
Executive Summary
CVE-2025-66864 is a denial-of-service vulnerability in the GNU Binutils library, specifically within the d_print_comp_inner function in the cp-demangle.c file. The flaw is triggered when processing a crafted Portable Executable (PE) file, leading to a crash or hang. The vulnerability affects Binutils version 2.26. No official patch has been released, and no public proof-of-concept or exploit code is available at this time. The EPSS score is 0.0%, indicating low exploitation activity in the wild.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
Binutils is a critical component in many software supply chains, used by compilers, linkers, and binary analysis tools. A vulnerability in its demangling routine can propagate to downstream tools that rely on it for processing PE files. Organizations using Binutils 2.26 in build pipelines, malware analysis sandboxes, or binary instrumentation frameworks should assess their exposure.
CVSS Breakdown & Threat Level
- CVSS Score: 0.0 (No vector assigned)
- Attack Vector: Local (requires crafted PE file)
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Required (user must open or process the malicious PE file)
- Scope: Unchanged
- Confidentiality Impact: None
- Integrity Impact: None
- Availability Impact: High (denial of service)
- Threat Level: Low (no public exploit, low EPSS)
Deep Dive & Mechanics
The vulnerability resides in the d_print_comp_inner function within cp-demangle.c. This function is responsible for printing demangled C++ symbol names. When processing a specially crafted PE file, the function enters an infinite loop or performs an invalid memory access, causing the application to crash or hang.
The root cause is a missing or incorrect bounds check when iterating over demangled components. An attacker can craft a PE file with malformed symbol data that triggers this condition, leading to denial of service.
Vulnerable vs. Patched Code
Vulnerable Code (Binutils 2.26, cp-demangle.c):
static void d_print_comp_inner (struct d_print_info *dpi, int options, struct demangle_component *dc) {
// ... missing bounds check on component index
while (dc->type == DEMANGLE_COMPONENT_QUAL_NAME) {
// infinite loop if dc->u.s_binary.left points to itself
dc = dc->u.s_binary.left;
}
}
Patched Code (Hypothetical fix):
static void d_print_comp_inner (struct d_print_info *dpi, int options, struct demangle_component *dc) {
int max_depth = 1000; // prevent infinite recursion
while (dc->type == DEMANGLE_COMPONENT_QUAL_NAME && max_depth-- > 0) {
if (dc->u.s_binary.left == dc) break; // self-reference check
dc = dc->u.s_binary.left;
}
}
Exploitation & Lab Setup
Red Team
No public exploit code is available. To reproduce the vulnerability, an attacker would craft a PE file with a malformed C++ symbol that causes an infinite loop in the demangler. Example steps:
- Create a PE file with a symbol name containing a self-referencing demangle component.
- Use a tool like
objdumpornmfrom Binutils 2.26 to process the file. - Observe the tool hang or crash.
Proof-of-Concept (Conceptual):
# This is a conceptual example; no working exploit exists.
import struct
def craft_malicious_pe():
# Craft a minimal PE with a malformed symbol
# that triggers infinite loop in d_print_comp_inner
pass
Blue Team
To detect exploitation attempts:
- Monitor for Binutils processes (e.g.,
objdump,nm,strings) that hang or crash when processing PE files. - Use file integrity monitoring to detect crafted PE files with unusual symbol structures.
- Implement sandboxing for binary analysis tools to limit impact.
Indicators of Compromise (IOCs)
- File Hashes: No known malicious samples.
- Process Anomalies: Binutils processes (objdump, nm, strings) consuming 100% CPU or crashing.
- Network: None (local vulnerability).
- Registry/File System: PE files with malformed symbol tables.
Detection Engineering
YARA Rule
rule CVE_2025_66864_Binutils_PE_DOS {
meta:
description = "Detects PE files crafted to exploit CVE-2025-66864 in Binutils 2.26"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-66864"
strings:
$pe_magic = "MZ"
$symbol_hint = { 00 00 00 00 } // placeholder for malformed symbol pattern
condition:
$pe_magic at 0 and #symbol_hint > 0
}
Sigma Rule
title: Binutils CVE-2025-66864 Denial of Service
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects Binutils processes (objdump, nm) crashing or hanging due to crafted PE files
logsource:
category: process_creation
product: windows
detection:
selection:
Image|endswith:
- '\objdump.exe'
- '\nm.exe'
- '\strings.exe'
CommandLine|contains: '.pe'
condition: selection
falsepositives:
- Legitimate large PE files
level: medium
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-66864 Binutils PE Denial of Service"; flow:to_server,established; content:"MZ"; offset:0; depth:2; content:"|00 00 00 00|"; distance:0; within:4; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
- Upgrade Binutils: Upgrade to a version newer than 2.26 if a patch becomes available.
- Workaround: Avoid processing untrusted PE files with Binutils 2.26.
- Sandboxing: Run binary analysis tools in isolated environments with resource limits.
- Monitoring: Deploy YARA/Sigma rules to detect crafted PE files.
- Vendor Contact: Monitor the GNU Binutils project for official patches.
Valters IT
DevSecOps & Cyber Threat Intelligence