CVE-2019-19754
Executive Summary
CVE-2019-19754 identifies a critical security flaw in HiveOS, a popular operating system for cryptocurrency mining rigs. The vulnerability stems from the inclusion of static, baked-in SSH host keys within the installation image. This practice allows an attacker to perform a man-in-the-middle (MITM) attack by impersonating a legitimate HiveOS node, as the host key is identical across all installations. Furthermore, the static key enables trivial identification of all public-facing HiveOS nodes via Shodan.io, exposing the entire attack surface. The vendor acknowledged the issue but has not released a patch, leaving all versions up to 0.6-102@191212 vulnerable.
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 a classic supply chain security failure. The HiveOS installation image, distributed as a single monolithic artifact, contains a hard-coded cryptographic secret (the SSH host key). Any user downloading and installing this image inherits the same key, breaking the fundamental trust model of SSH. An attacker who compromises the distribution channel or obtains a copy of the image can extract the private key and use it to intercept all subsequent SSH connections to any HiveOS node.
CVSS Breakdown & Threat Level
While the NVD assigned a CVSS score of 0.0 (likely due to incomplete data at the time), the actual severity is high. A realistic CVSS v3.1 vector would be:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
- Attack Vector (AV): Network – The attack can be launched remotely.
- Attack Complexity (AC): Low – The attacker only needs to intercept network traffic.
- Privileges Required (PR): None – No authentication needed.
- User Interaction (UI): None – The victim does not need to perform any action.
- Scope (S): Unchanged – The compromise is limited to the vulnerable component.
- Confidentiality (C): High – All SSH traffic can be decrypted.
- Integrity (I): High – The attacker can inject commands or modify data in transit.
- Availability (A): None – The attack does not directly affect availability.
Threat Level: Critical (9.1)
Deep Dive & Mechanics
The vulnerability is rooted in the SSH protocol's host key mechanism. When a client connects to an SSH server for the first time, the server presents its host key. The client stores this key to verify future connections, preventing MITM attacks. If the host key is static and known to an attacker, they can:
- Identify Targets: Use Shodan.io to search for the specific SSH host key fingerprint associated with HiveOS. This instantly reveals all public-facing HiveOS nodes.
- Launch MITM Attack: Position themselves between a legitimate HiveOS node and an administrator connecting via SSH. The attacker presents the known host key, and the client accepts it (since it matches the stored key). The attacker then decrypts, reads, and potentially modifies all traffic.
The technical flaw is in the HiveOS build process. The SSH host key pair (/etc/ssh/ssh_host_rsa_key, ssh_host_ecdsa_key, etc.) is generated once during image creation and included in the distributed image. Every installation uses the same keys.
Vulnerable vs. Patched Code
Vulnerable (HiveOS <= 0.6-102@191212): The SSH host keys are baked into the image. An administrator can verify this by checking the host key fingerprint:
ssh-keyscan -t rsa <hiveos-ip> 2>/dev/null | ssh-keygen -lf -
If the fingerprint matches the known HiveOS fingerprint (e.g., SHA256:...), the system is vulnerable.
Patched (Hypothetical):
A patched version would generate unique host keys on first boot. This is typically done by a script in /etc/rc.local or a systemd service:
#!/bin/bash
# Regenerate SSH host keys on first boot
if [ ! -f /etc/ssh/.keys_generated ]; then
rm -f /etc/ssh/ssh_host_*
dpkg-reconfigure openssh-server
touch /etc/ssh/.keys_generated
fi
This ensures each installation has a unique key pair.
Exploitation & Lab Setup
Red Team (Attacker)
Objective: Intercept SSH traffic to a HiveOS node.
Lab Setup:
- Identify Target: Use Shodan.io with the dork
ssh host key fingerprint:"HiveOS"to find a public HiveOS node. - ARP Spoofing (Local Network): If on the same subnet, use
arpspoofto redirect traffic. - MITM Attack: Use
mitmproxyorssh-mitmto intercept the SSH connection.
Example using ssh-mitm:
# Install ssh-mitm
pip install ssh-mitm
# Run the MITM server, using the known HiveOS host key
ssh-mitm --remote-host <target-ip> --host-key-file /path/to/hiveos_ssh_host_rsa_key
The attacker then waits for an administrator to connect to the target. The MITM server presents the known key, and the attacker can log all traffic.
Blue Team (Defender)
Objective: Detect and mitigate the use of static SSH host keys.
Detection:
Check Host Key Uniqueness: On each HiveOS node, run:
for key in /etc/ssh/ssh_host_*; do ssh-keygen -lf "$key" doneCompare fingerprints across nodes. If they match, the system is vulnerable.
Network Monitoring: Look for SSH connections where the host key fingerprint matches the known HiveOS fingerprint. This can be done with a custom Zeek script.
Mitigation:
- Regenerate Keys Immediately:
sudo rm -f /etc/ssh/ssh_host_* sudo dpkg-reconfigure openssh-server sudo systemctl restart sshd - Update Known Hosts: After regeneration, all clients must update their
~/.ssh/known_hostsfile with the new key.
Indicators of Compromise (IOCs)
- Static SSH Host Key Fingerprint: The SHA256 fingerprint of the RSA host key (example, not actual):
SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - Shodan Search:
ssh host key fingerprint:"HiveOS" - Network Traffic: SSH connections where the server host key matches the known HiveOS key.
- File Hashes: The MD5 hash of the HiveOS image (e.g.,
0.6-102@191212):MD5:yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
Detection Engineering
YARA Rule
rule detect_hiveos_static_ssh_key {
meta:
description = "Detects HiveOS static SSH host key in files or memory"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2019-19754"
strings:
$rsa_key = "-----BEGIN OPENSSH PRIVATE KEY-----" ascii wide
$hiveos_fingerprint = "SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ascii wide
condition:
$rsa_key and $hiveos_fingerprint
}
Sigma Rule
title: Detection of Static SSH Host Key in HiveOS
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects SSH connections using the known HiveOS static host key.
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2019-19754
logsource:
category: network_connection
product: zeek
detection:
selection:
ssh.server_host_key|contains: 'SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
condition: selection
falsepositives:
- Legitimate HiveOS nodes that have not been patched
level: high
Suricata Rule
alert tcp any any -> any 22 (msg:"CVE-2019-19754 HiveOS Static SSH Host Key Detected"; flow:to_server; content:"SSH-2.0-OpenSSH"; nocase; pcre:"/SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/"; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: Regenerate SSH host keys on every HiveOS node as described in the Blue Team section.
- Long-term Fix: The vendor must release a patched image that generates unique keys on first boot. Until then, users must manually regenerate keys after each installation.
- Network Segmentation: Place HiveOS nodes on isolated management networks to reduce exposure.
- Monitoring: Implement the provided detection rules to identify any nodes still using the static keys.
- Vendor Communication: Pressure the vendor to release a security update.
Valters IT
Securing your digital infrastructure, one vulnerability at a time.
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.