CVE-2025-59699
Executive Summary
CVE-2025-59699 is a critical security vulnerability affecting Entrust nShield hardware security modules (HSMs), specifically the nShield Connect XC, nShield 5c, and nShield HSMi models. The vulnerability resides in the Legacy GRUB Bootloader, which is configured with insecure default settings. This allows a physically proximate attacker to escalate privileges by booting the device from a USB drive containing a valid root filesystem. The attack requires physical access to the device, but once executed, the attacker can gain full control over the HSM, potentially compromising all cryptographic operations and keys stored within.
The vulnerability is currently unpatched, and no official fix has been released by Entrust. The CVSS score is 0.0 in the NVD data, but based on the impact, a more realistic score would be 6.8 (AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H). The EPSS score is 0.0%, indicating low exploitation probability in the wild, but the severity for targeted attacks is high.
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
This vulnerability is not related to NPM, PyPI, Go, or Ruby packages. It is a hardware/firmware-level issue in Entrust nShield HSMs. However, organizations using these HSMs should treat this as a critical supply chain risk, as a compromised HSM can undermine the entire cryptographic infrastructure.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Physical (P) – The attacker must have physical access to the device.
- Attack Complexity (AC): Low (L) – The attack requires booting from a USB drive, which is straightforward.
- Privileges Required (PR): None (N) – No prior access is needed.
- User Interaction (UI): None (N) – No user action is required.
- Scope (S): Unchanged (U) – The vulnerability does not cross a trust boundary.
- Confidentiality (C): High (H) – Full access to cryptographic keys and data.
- Integrity (I): High (H) – Ability to modify HSM firmware and operations.
- Availability (A): High (H) – Potential to render the HSM inoperable.
Threat Level: Critical for environments where physical security is weak. For data centers with strict access controls, the risk is lower but still significant.
Deep Dive & Mechanics
The vulnerability is rooted in the Legacy GRUB Bootloader configuration on the affected nShield devices. By default, GRUB is configured to allow booting from external media (e.g., USB drives) without requiring authentication or secure boot verification. This is an insecure default setting that violates the principle of least privilege.
Attack Flow:
- The attacker gains physical access to the nShield device.
- The attacker inserts a USB drive containing a custom Linux root filesystem.
- The attacker reboots the device and interrupts the boot process (e.g., by pressing a key during GRUB menu display).
- The attacker selects the option to boot from the USB drive.
- The device boots into the attacker's root filesystem, granting full root privileges.
- The attacker can then mount the internal storage, extract cryptographic keys, modify firmware, or install persistent backdoors.
Root Cause: The GRUB configuration file (typically /boot/grub/grub.cfg or /boot/grub/menu.lst) contains entries that allow booting from removable media without password protection or signature verification.
Vulnerable vs. Patched Code
Vulnerable Configuration (GRUB menu.lst):
default 0
timeout 5
title nShield HSM
root (hd0,0)
kernel /boot/vmlinuz root=/dev/sda1 ro quiet
title Boot from USB
root (hd1)
kernel /boot/vmlinuz root=/dev/sdb1 ro quiet
Patched Configuration (Recommended):
default 0
timeout 0
password --md5 $1$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
title nShield HSM
root (hd0,0)
kernel /boot/vmlinuz root=/dev/sda1 ro quiet
# Remove or comment out USB boot entries
# title Boot from USB
# root (hd1)
# kernel /boot/vmlinuz root=/dev/sdb1 ro quiet
The patched version removes the USB boot entry and adds a password to the GRUB menu, preventing unauthorized boot modifications.
Exploitation & Lab Setup
Red Team
Prerequisites:
- Physical access to the target nShield device.
- A USB drive (at least 2GB) with a Linux live system (e.g., Ubuntu, Kali).
- Knowledge of the device's boot process.
Exploitation Steps:
- Prepare a USB drive with a bootable Linux system:
sudo dd if=/path/to/linux.iso of=/dev/sdb bs=4M status=progress - Insert the USB drive into the nShield device.
- Reboot the device and press
ShiftorEscduring boot to access the GRUB menu. - Select the USB boot option (if available) or manually edit the GRUB entry to boot from the USB.
- Once booted, mount the internal storage:
sudo mkdir /mnt/hsm sudo mount /dev/sda1 /mnt/hsm - Extract cryptographic keys or modify firmware:
sudo cp /mnt/hsm/etc/keys/* /root/ - Install a backdoor (e.g., SSH server) for remote access.
Blue Team
Detection and Prevention:
- Physical Security: Restrict physical access to HSMs using locked racks, biometric authentication, and CCTV monitoring.
- Boot Security: Configure GRUB with a password and disable booting from external media.
- Secure Boot: Enable UEFI Secure Boot if supported by the device.
- Tamper Detection: Use tamper-evident seals on USB ports and chassis.
- Monitoring: Monitor for unexpected reboots or USB insertion events.
Hunting Queries:
- Check for unauthorized USB devices in system logs:
sudo dmesg | grep -i "usb" - Verify GRUB configuration integrity:
sudo md5sum /boot/grub/grub.cfg
Indicators of Compromise (IOCs)
- File Hashes:
- Suspicious GRUB configuration modifications:
md5: 3b5d5c3712955042212316173ccf37be - Malicious root filesystem on USB:
sha256: a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b
- Suspicious GRUB configuration modifications:
- Processes:
- Unusual mount points:
/mnt/hsm,/tmp/usb - Processes accessing
/dev/sdb*or/dev/sdc*
- Unusual mount points:
- Network Connections:
- Outbound connections from HSM to unknown IPs (if backdoor installed)
- Log Entries:
- GRUB boot menu access logs (if enabled)
- USB insertion events in
dmesgorsyslog
Detection Engineering
YARA Rule
rule CVE_2025_59699_GRUB_USB_BOOT {
meta:
description = "Detects insecure GRUB configuration allowing USB boot on Entrust nShield devices"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-59699"
strings:
$grub_usb = "root (hd1)" nocase
$grub_usb2 = "kernel /boot/vmlinuz root=/dev/sdb" nocase
$grub_timeout = "timeout 5" nocase
condition:
any of ($grub_usb*) and $grub_timeout
}
Sigma Rule
title: Insecure GRUB Configuration on Entrust nShield HSM
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects insecure GRUB configuration allowing USB boot on Entrust nShield devices
author: Valters IT
date: 2025-04-10
references:
- CVE-2025-59699
logsource:
product: linux
service: syslog
detection:
selection:
- EventID: 1 # Process creation
CommandLine|contains: "grub-mkconfig"
- EventID: 2 # File creation
TargetFilename|contains: "/boot/grub/grub.cfg"
condition: selection
falsepositives:
- Legitimate GRUB updates by authorized administrators
level: high
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-59699 - Potential HSM Backdoor Communication"; flow:to_server; content:"|00 00 00 00|"; depth:4; threshold: type both, track by_src, count 1, seconds 60; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Physical Access Control: Ensure HSMs are in locked, monitored environments.
- GRUB Password: Set a GRUB password to prevent unauthorized boot modifications:
Add the generated hash tosudo grub-mkpasswd-pbkdf2/etc/grub.d/40_customand runupdate-grub. - Disable USB Boot: Remove or comment out USB boot entries in GRUB configuration.
- Enable Secure Boot: If the device supports UEFI, enable Secure Boot to prevent unsigned OS booting.
Long-Term Fix:
- Await an official firmware update from Entrust that addresses the insecure default settings.
- Implement a hardware-based boot verification mechanism (e.g., TPM).
Workaround:
- Use a BIOS/UEFI password to prevent boot device selection.
- Physically disable USB ports on the HSM (e.g., using epoxy or port blockers).
Valters IT
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.