CVE-2025-65409
Executive Summary
CVE-2025-65409 is a denial-of-service vulnerability in GNU Recutils v1.9, specifically within its encryption/decryption routines. The flaw is triggered when an empty string is supplied as a password, causing a divide-by-zero error that crashes the application. This vulnerability is classified as a low-severity issue due to its local attack vector and requirement for user interaction, but it can be exploited to disrupt services relying on GNU Recutils for data processing.
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
GNU Recutils is a set of tools and libraries for creating and manipulating text-based databases. It is not distributed via common package registries like NPM, PyPI, Go, or Ruby, but is typically included in Linux distributions or compiled from source. The vulnerability affects the core library, meaning any application that links against GNU Recutils and processes user-supplied passwords is potentially at risk. Supply chain risk is low, as the software is not commonly used in automated CI/CD pipelines, but manual exploitation could disrupt data processing workflows.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Local (L) – The attacker must have local access to the system or be able to provide input to a local instance of the tool.
- Attack Complexity (AC): Low (L) – No special conditions are required; simply providing an empty password triggers the flaw.
- Privileges Required (PR): None (N) – No authentication is needed.
- User Interaction (UI): Required (R) – The user must execute the tool with an empty password.
- Scope (S): Unchanged (U) – The vulnerability does not affect other components.
- Confidentiality (C): None (N) – No data is exposed.
- Integrity (I): None (N) – No data is altered.
- Availability (A): High (H) – The crash causes a denial of service.
CVSS Score: 5.5 (Medium) – The vulnerability is easy to exploit but requires local access and user interaction, limiting its impact to availability.
Deep Dive & Mechanics
The vulnerability resides in the encryption/decryption routines of GNU Recutils v1.9. When a user provides an empty string as a password, the code attempts to use this value in a division operation without proper validation. Specifically, the password length is used as a divisor in a key derivation or encryption step. If the length is zero, a divide-by-zero exception occurs, crashing the process.
The affected function is likely within the rec_crypt module, which handles password-based encryption for Recutils databases. The code path is:
- User invokes
recfixorrecselwith--passwordoption. - The password string is passed to the encryption routine.
- The routine calculates a divisor based on password length.
- If length is 0, division by zero occurs, causing a SIGFPE signal and process termination.
This is a classic CWE-369 (Divide By Zero) vulnerability, which can be triggered without any special privileges.
Vulnerable vs. Patched Code
Vulnerable Code (GNU Recutils v1.9):
// Simplified example of the vulnerable routine
int encrypt_data(const char *password, unsigned char *data, size_t len) {
size_t pwd_len = strlen(password);
// Vulnerable: no check for pwd_len == 0
unsigned int key = (unsigned int)(data[0] / pwd_len);
// ... encryption logic
}
Patched Code (Hypothetical fix):
int encrypt_data(const char *password, unsigned char *data, size_t len) {
size_t pwd_len = strlen(password);
if (pwd_len == 0) {
// Handle empty password gracefully
return -1; // or use a default divisor
}
unsigned int key = (unsigned int)(data[0] / pwd_len);
// ... encryption logic
}
The fix requires adding a check for zero-length passwords before performing the division. Since no official patch is available, users must implement this workaround manually or avoid using empty passwords.
Exploitation & Lab Setup
Red Team
Prerequisites:
- GNU Recutils v1.9 installed on a Linux system.
- A Recutils database file (e.g.,
test.rec).
Exploitation Steps:
- Create a simple Recutils database:
echo -e "%rec: test\n\nName: John\nAge: 30" > test.rec - Attempt to encrypt the database with an empty password:
recfix --password="" --encrypt test.rec - The tool will crash with a floating point exception (SIGFPE), causing a denial of service.
Expected Output:
Floating point exception (core dumped)
Blue Team
Detection:
- Monitor for crashes of
recfix,recsel, or other Recutils tools. - Look for log entries indicating a SIGFPE signal.
- Use process monitoring to detect abnormal terminations.
Prevention:
- Validate input passwords before passing them to Recutils.
- Use a wrapper script that rejects empty passwords.
- Apply the hypothetical patch to the source code and recompile.
Indicators of Compromise (IOCs)
- Process Crash:
recfixorrecselterminated with signal 8 (SIGFPE). - Core Dump: Files named
coreorcore.<pid>in the working directory. - System Logs: Entries in
/var/log/syslogordmesgshowing "Floating point exception" for the Recutils process. - File Artifacts: A partially encrypted
.recfile that may be corrupted.
Detection Engineering
YARA Rule
rule CVE_2025_65409_Recutils_DivideByZero {
meta:
description = "Detects attempts to exploit CVE-2025-65409 in GNU Recutils"
author = "Valters IT"
date = "2025-04-10"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2025-65409"
strings:
$s1 = "recfix" ascii wide nocase
$s2 = "recsel" ascii wide nocase
$s3 = "--password=" ascii wide nocase
$s4 = "Floating point exception" ascii wide nocase
condition:
(any of ($s1, $s2)) and $s3 and $s4
}
Sigma Rule
title: CVE-2025-65409 - GNU Recutils Divide-by-Zero DoS
id: 8a3b2c1d-4e5f-6a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects crashes of GNU Recutils tools due to empty password input
author: Valters IT
date: 2025-04-10
logsource:
category: process_creation
product: linux
detection:
selection:
Image|endswith:
- '/recfix'
- '/recsel'
CommandLine|contains: '--password=""'
condition: selection
falsepositives:
- Legitimate use of empty password (unlikely)
level: medium
Suricata Rule
alert tcp any any -> any any (msg:"CVE-2025-65409 - GNU Recutils Divide-by-Zero DoS Attempt"; flow:to_server; content:"recfix"; nocase; content:"--password=""; distance:0; within:100; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Avoid empty passwords: Do not use empty strings as passwords when using GNU Recutils encryption/decryption features.
- Input validation: Implement a wrapper script that rejects empty passwords before passing them to Recutils.
- Monitor for crashes: Set up alerts for SIGFPE signals in Recutils processes.
Long-term Fix:
- Since no official patch is available, users should apply the hypothetical code fix to the source code and recompile GNU Recutils.
- Alternatively, consider using alternative tools for encrypted database management until a patch is released.
Workaround:
- Use a non-empty password (e.g., a single space or a dummy character) to avoid triggering the divide-by-zero.
Valters IT