CVE-2024-51431
Executive Summary
CVE-2024-51431 exposes a critical security flaw in the LB-LINK BL-WR 1300H router, specifically version 1.0.4. The vulnerability stems from hardcoded credentials stored in the /etc/shadow file, which are easily guessable. This allows an attacker with local or network access to the device's file system to obtain valid credentials, potentially leading to full administrative control over the router. The lack of a known patch and the public disclosure of the issue elevate the risk for all users of this device.
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 an NPM, PyPI, Go, or Ruby package. It is a firmware-level issue in an embedded device (router). The supply chain risk is that the vendor (LB-LINK) shipped a product with a hardcoded, guessable password, and has not released a security update to address it. This places the burden of mitigation on the end-user.
CVSS Breakdown & Threat Level
The CVSS score is listed as 0.0, which is likely a placeholder or error. Based on the vulnerability description, a more realistic assessment would be:
- Attack Vector (AV): Local (L) – Requires access to the device's file system, but could be achieved via other vulnerabilities or physical access.
- Attack Complexity (AC): Low (L) – The credentials are easily guessable.
- Privileges Required (PR): None (N) – No prior authentication needed to exploit the hardcoded credentials once file system access is obtained.
- User Interaction (UI): None (N) – No user action required.
- Scope (S): Changed (C) – Exploitation can impact resources beyond the original vulnerable component (e.g., gaining admin access to the router).
- Confidentiality (C): High (H) – Full disclosure of all router data.
- Integrity (I): High (H) – Full control to modify router settings.
- Availability (A): High (H) – Could lead to denial of service or complete device takeover.
Estimated CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Estimated Score: 8.4 (High)
Deep Dive & Mechanics
The vulnerability is a classic case of hardcoded credentials (CWE-798). The router's firmware stores user credentials (likely the root or admin password) in the /etc/shadow file. This file is meant to store hashed passwords, but the issue is that the password hash is derived from a known, guessable, or static password.
Mechanics:
- An attacker gains access to the router's file system. This could be through:
- Physical access (e.g., connecting via UART or JTAG).
- Exploiting another vulnerability (e.g., command injection, path traversal).
- Default credentials for a web interface or SSH.
- The attacker reads the
/etc/shadowfile. - The attacker extracts the password hash for a privileged user (e.g.,
root). - The attacker cracks the hash using a dictionary or brute-force attack, or the password is already known from public disclosures.
- The attacker uses the cracked password to log in via SSH, Telnet, or the web interface, gaining full administrative control.
Vulnerable vs. Patched Code
Vulnerable Code (BL-WR 1300H v1.0.4):
The /etc/shadow file contains an entry like:
root:$1$salt$hash:0:0:99999:7:::
Where $1$salt$hash is a hash of a weak, guessable password (e.g., admin, password, 123456).
Patched Code (Hypothetical): A patched version would:
- Remove the hardcoded password from the firmware.
- Force the user to set a strong, unique password during initial setup.
- Store the password hash securely, using a strong hashing algorithm (e.g., SHA-512 with a random salt).
Exploitation & Lab Setup
Red Team
Objective: Gain root access to the LB-LINK BL-WR 1300H router.
Lab Setup:
- Hardware: LB-LINK BL-WR 1300H router (v1.0.4).
- Software: Kali Linux VM,
hashcat,john,ssh,nmap. - Network: Connect the router to a isolated lab network.
Steps:
- Reconnaissance:
nmap -sV -p 22,80,443 <router_ip> - Gain File System Access (Example via default web creds):
- Try default credentials:
admin:admin,admin:password,root:root. - If successful, look for a command injection or file read vulnerability in the web interface.
- Try default credentials:
- Extract
/etc/shadow:# If you have a command injection: curl "http://<router_ip>/cgi-bin/...?cmd=cat%20/etc/shadow" - Crack the Hash:
# Save the hash to a file (hash.txt) # Use hashcat with a wordlist hashcat -m 500 -a 0 hash.txt /usr/share/wordlists/rockyou.txt - Gain Root Access:
ssh root@<router_ip> # Enter the cracked password
Blue Team
Objective: Detect and prevent exploitation of hardcoded credentials.
Detection:
- Monitor for Unauthorized File Access: Alert on any process reading
/etc/shadowthat is not the expected authentication daemon (e.g.,sshd,login). - Monitor for Brute-Force Attacks: Detect multiple failed SSH login attempts.
- Monitor for Anomalous Network Traffic: Look for connections to the router from unexpected IPs, especially on ports 22 (SSH) and 23 (Telnet).
Prevention:
- Change Default Credentials Immediately: The most critical step. Change the admin password to a strong, unique password.
- Disable Unnecessary Services: Disable Telnet and SSH if not needed. If SSH is required, use key-based authentication.
- Network Segmentation: Place the router in a separate VLAN with strict firewall rules.
- Firmware Updates: Monitor the vendor's website for any security updates. If none are available, consider replacing the device.
- Intrusion Detection System (IDS): Deploy an IDS (e.g., Snort, Suricata) to detect exploitation attempts.
Indicators of Compromise (IOCs)
- File System: Presence of a known weak password hash in
/etc/shadow. - Network: SSH or Telnet connections from unexpected IPs.
- Logs: Multiple failed SSH login attempts from the same IP.
- Processes: Unauthorized processes reading
/etc/shadow(e.g.,cat,cp,scp).
Detection Engineering
YARA Rule
rule CVE_2024_51431_Hardcoded_Creds {
meta:
description = "Detects hardcoded credentials in LB-LINK BL-WR 1300H firmware"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-51431"
strings:
$shadow_entry = /root:\$1\$[a-zA-Z0-9\/\.]{8}\$[a-zA-Z0-9\/\.]{22}:/
$weak_password = "admin" nocase
$weak_password2 = "password" nocase
$weak_password3 = "123456" nocase
condition:
$shadow_entry and any of ($weak_password*)
}
Sigma Rule
title: Detection of Hardcoded Credential Exploitation on LB-LINK Router
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects attempts to read /etc/shadow on a LB-LINK router
author: Valters IT
logsource:
category: process_creation
product: linux
detection:
selection:
Image|endswith: '/cat'
CommandLine|contains: '/etc/shadow'
condition: selection
falsepositives:
- Legitimate system administration
level: high
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET 22 (msg:"CVE-2024-51431 - Possible SSH Brute Force on LB-LINK Router"; flow:to_server,established; content:"SSH-"; depth:4; threshold: type both, track by_src, count 5, seconds 60; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: Change the router's admin password to a strong, unique password. This is the most effective mitigation.
- Firmware Update: Check the LB-LINK website for any firmware updates. If none are available, consider the device end-of-life and replace it.
- Network Controls: Restrict access to the router's management interface to trusted IPs only. Use a firewall to block SSH/Telnet from the internet.
- Physical Security: Ensure the router is in a physically secure location to prevent direct file system access.
- Monitoring: Implement the detection rules provided above to identify any exploitation attempts.
Valters IT - Securing Digital Frontiers
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.