CVE-2025-66863
Executive Summary
CVE-2025-66863 is a denial-of-service (DoS) vulnerability in GNU Binutils version 2.26, specifically within the d_discriminator function in the cp-demangle.c file. An attacker can trigger this vulnerability by crafting a malicious Portable Executable (PE) file, causing the application to crash or become unresponsive. The vulnerability has a CVSS score of 0.0 (likely unassigned or placeholder), and no public exploit code or patch is currently available. The EPSS score is 0.0%, indicating low exploitation activity in the wild. This issue is classified under CWE-476 (NULL Pointer Dereference), as the crash likely results from dereferencing a null or invalid pointer during demangling operations.
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 Linux distributions and development toolchains. A DoS vulnerability in the demangling library can affect downstream tools that parse C++ symbols, such as debuggers, linkers, and binary analysis tools. While no supply chain attack has been reported, the lack of a patch increases risk for systems using Binutils 2.26 in production or CI/CD pipelines.
CVSS Breakdown & Threat Level
- CVSS Score: 0.0 (Unassigned)
- Attack Vector (AV): Local (requires crafted PE file)
- Attack Complexity (AC): Low
- Privileges Required (PR): None
- User Interaction (UI): Required (user must process the file)
- Scope (S): Unchanged
- Confidentiality (C): None
- Integrity (I): None
- Availability (A): High
- Threat Level: Low (no public exploit, low EPSS)
Deep Dive & Mechanics
The vulnerability resides in the d_discriminator function within cp-demangle.c. This function is responsible for parsing discriminator information from mangled C++ symbols. When processing a specially crafted PE file, the function fails to properly validate input, leading to a NULL pointer dereference or an out-of-bounds read. The crash occurs during the demangling process, which is invoked by tools like nm, objdump, or c++filt when analyzing the PE file.
The root cause is insufficient bounds checking on the input string. The function assumes the input is well-formed, but a malicious PE file can provide a mangled name with an invalid discriminator value, causing the function to access memory outside the allocated buffer.
Vulnerable vs. Patched Code
Vulnerable Code (Binutils 2.26 - cp-demangle.c):
static int
d_discriminator (struct d_info *di)
{
int discriminator;
if (!d_check_char (di, '_'))
return 0;
discriminator = d_number (di);
if (discriminator < 0)
return 0;
return discriminator;
}
The issue is that d_number may return a negative value or cause an overflow, and the function does not validate the range of the discriminator before using it in subsequent operations.
Patched Code (Hypothetical):
static int
d_discriminator (struct d_info *di)
{
int discriminator;
if (!d_check_char (di, '_'))
return 0;
discriminator = d_number (di);
if (discriminator < 0 || discriminator > MAX_DISCRIMINATOR)
return 0;
return discriminator;
}
A proper patch would add a maximum value check to prevent out-of-bounds access.
Exploitation & Lab Setup
Red Team
To exploit this vulnerability, an attacker would craft a PE file with a mangled C++ symbol containing an invalid discriminator. The file must be processed by a vulnerable Binutils tool (e.g., nm, objdump, c++filt). No public exploit code exists, but a proof-of-concept can be created by modifying a valid PE file's symbol table.
Example Crafting (Python):
import struct
# Create a minimal PE file with a malicious mangled symbol
# This is a simplified example; actual exploitation requires a valid PE structure
malicious_symbol = b'_Z1f_999999999' # Large discriminator
# Embed this symbol in a PE file's symbol table
# Then run: nm malicious.exe
Blue Team
- Monitor for crashes in Binutils tools (e.g.,
nm,objdump) when processing PE files. - Use file integrity monitoring to detect unexpected PE files in sensitive directories.
- Implement sandboxing for binary analysis tools to limit impact of crashes.
Indicators of Compromise (IOCs)
- File Hashes: None available (no known samples)
- Network Indicators: None (local file-based attack)
- Behavioral: Repeated crashes of
nm,objdump, orc++filtwhen processing PE files - Log Entries: Segmentation faults or core dumps in Binutils processes
Detection Engineering
YARA Rule
rule CVE_2025_66863_Binutils_Demangle_DoS {
meta:
description = "Detects PE files with malicious mangled symbols targeting CVE-2025-66863"
author = "Valters IT"
date = "2025-01-01"
reference = "CVE-2025-66863"
strings:
$mangled = /_Z\d+[a-zA-Z0-9_]+_\d{6,}/ // Large discriminator
condition:
$mangled and uint16(0) == 0x5A4D // PE magic
}
Sigma Rule
title: Binutils Demangle DoS via Crafted PE File
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects crashes in Binutils tools when processing PE files with malicious mangled symbols
logsource:
category: process_creation
product: linux
detection:
selection:
Image|endswith:
- '/nm'
- '/objdump'
- '/c++filt'
CommandLine|contains: '.exe' # PE file
condition: selection
falsepositives:
- Legitimate PE files with large symbol tables
level: medium
Suricata Rule
alert tcp any any -> any any (msg:"CVE-2025-66863 Binutils Demangle DoS Attempt"; flow:to_server; content:"|4d 5a|"; offset:0; depth:2; content:"_Z"; distance:2; within:100; pcre:"/_\d{6,}/R"; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Upgrade Binutils to a version newer than 2.26 if a patch becomes available. Currently, no patch exists.
- Workaround: Avoid processing untrusted PE files with Binutils tools. Use alternative tools like
llvm-objdumporreadpefor analysis. - Compensating Controls: Run Binutils in a sandboxed environment (e.g., Docker, seccomp) to limit the impact of crashes.
- Monitoring: Enable core dumps and monitor for crashes in Binutils processes.
Report generated by Valters IT DevSecOps AI Assistant