CVE-2025-66866
Executive Summary
CVE-2025-66866 is a denial-of-service (DoS) vulnerability discovered in the GNU Binutils package, specifically in the d_abi_tags function within the cp-demangle.c file. The flaw affects Binutils version 2.26 and allows an attacker to cause a crash or hang by providing a crafted Portable Executable (PE) file. The vulnerability is triggered during the demangling process, where improper handling of ABI tags leads to a null pointer dereference or infinite loop. No public proof-of-concept (PoC) or patch is currently available, and the EPSS score is 0.0%, indicating low exploitation activity. This issue 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
CVSS Breakdown & Threat Level
The CVSS score is listed as 0.0, which is likely a placeholder. Based on the nature of the vulnerability (DoS via crafted PE file), a reasonable CVSS v3.1 vector would be:
- Attack Vector (AV): Local (L) – requires the victim to process a malicious file.
- Attack Complexity (AC): Low (L) – no special conditions.
- Privileges Required (PR): None (N) – no authentication needed.
- User Interaction (UI): Required (R) – user must open the file.
- Scope (S): Unchanged (U) – affects only the vulnerable component.
- Confidentiality (C): None (N) – no data exposure.
- Integrity (I): None (N) – no data modification.
- Availability (A): High (H) – causes service disruption.
Estimated CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Estimated Base Score: 5.5 (Medium)
Threat Level: Medium. The vulnerability requires user interaction and local access, but it can be exploited to crash applications using Binutils (e.g., objdump, nm).
Deep Dive & Mechanics
The vulnerability resides in the d_abi_tags function in cp-demangle.c, which is part of the C++ demangling library in Binutils. The function is responsible for parsing and handling ABI tags in mangled C++ symbols. When processing a crafted PE file, the function fails to properly validate input, leading to a null pointer dereference or an infinite loop.
Root Cause: The d_abi_tags function iterates over a list of ABI tags without checking for null pointers or malformed data. A specially crafted PE file can cause the function to access invalid memory or enter an endless loop, resulting in a denial of service.
Attack Vector: An attacker crafts a malicious PE file with mangled symbols that trigger the bug. The victim must use a Binutils tool (e.g., objdump -t, nm, or c++filt) to process the file.
Impact: The tool crashes or hangs, preventing legitimate use. In automated environments (e.g., malware analysis pipelines), this can disrupt operations.
Vulnerable vs. Patched Code
Vulnerable Code (Binutils 2.26, cp-demangle.c):
static void
d_abi_tags (struct d_info *di)
{
while (d_peek_char (di) == 'B')
{
d_advance (di, 1);
// Missing null check for d_identifier
struct demangle_component *tag = d_identifier (di, 0);
if (tag == NULL)
return; // This check is missing in vulnerable version
// Process tag...
}
}
Patched Code (Hypothetical fix):
static void
d_abi_tags (struct d_info *di)
{
while (d_peek_char (di) == 'B')
{
d_advance (di, 1);
struct demangle_component *tag = d_identifier (di, 0);
if (tag == NULL)
return; // Added null check to prevent crash
// Process tag...
}
}
Note: No official patch has been released. The fix would involve adding null pointer checks and bounds validation in the d_abi_tags function.
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- Binutils 2.26 installed on a Linux system.
- A crafted PE file (e.g.,
malicious.exe) with mangled symbols that trigger the bug.
Steps:
- Create a malicious PE file using a hex editor or a custom script. The file must contain a mangled C++ symbol with an invalid ABI tag sequence.
- Run the vulnerable tool:
objdump -t malicious.exe - The tool will crash or hang, demonstrating the DoS.
Example Crafted Symbol (in PE file):
_Z1fB
This symbol starts with _Z (mangled C++), followed by 1f (function name), and B (ABI tag). The bug is triggered when the B tag is not followed by a valid identifier.
Blue Team (Defense & Detection)
Detection:
- Monitor for crashes of Binutils tools (
objdump,nm,c++filt). - Use file integrity monitoring to detect unexpected PE files.
- Implement sandboxing for PE file analysis.
Mitigation:
- Upgrade to a patched version of Binutils (when available).
- Use alternative tools for PE analysis (e.g.,
readpefrompev). - Restrict execution of Binutils tools to trusted users.
Indicators of Compromise (IOCs)
- File Hashes: (None available – no known samples)
- File Names:
malicious.exe,crafted_pe.exe - Process Names:
objdump,nm,c++filt - Log Entries: Segmentation faults or core dumps from Binutils tools.
- Network: No network indicators (local DoS).
Detection Engineering
YARA Rule
rule CVE_2025_66866_Binutils_DoS {
meta:
description = "Detects crafted PE files exploiting CVE-2025-66866"
author = "Valters IT"
date = "2025-04-01"
reference = "CVE-2025-66866"
strings:
$mangled = /_Z[a-zA-Z0-9_]+B/ // Mangled symbol with 'B' tag
$pe_magic = {4D 5A} // MZ header
condition:
$pe_magic at 0 and #mangled > 0
}
Sigma Rule
title: Binutils Crash via Crafted PE File
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects crashes of Binutils tools due to CVE-2025-66866
logsource:
category: process_creation
product: linux
detection:
selection:
Image|endswith:
- '/objdump'
- '/nm'
- '/c++filt'
ExitCode: -11 # SIGSEGV
condition: selection
falsepositives:
- Legitimate crashes due to other bugs
level: medium
Suricata Rule
alert tcp any any -> any any (msg:"CVE-2025-66866 Binutils DoS via PE"; flow:to_client; content:"|4D 5A|"; offset:0; depth:2; content:"_Z"; distance:0; within:100; pcre:"/_Z[a-zA-Z0-9_]+B/"; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Avoid processing untrusted PE files with Binutils 2.26. Use alternative tools like
readpeorpev. - Short-term: Apply vendor patch when available. Monitor Binutils releases for updates.
- Long-term: Implement file validation before processing with Binutils. Use sandboxed environments for analysis.
- Detection: Deploy YARA/Sigma rules to identify malicious PE files and monitor for crashes.
Valters IT Securing digital frontiers, one CVE at a time.