CVE-2020-15180

9.0 CRITICAL

📋 TL;DR

This vulnerability allows remote attackers to execute arbitrary commands on MariaDB Galera cluster nodes through command injection in the wsrep_sst_method parameter. It affects MariaDB with the mysql-wsrep component before specific versions, threatening confidentiality, integrity, and availability of database systems.

💻 Affected Systems

Products:
  • MariaDB with mysql-wsrep component
  • Percona XtraDB Cluster
Versions: MariaDB versions before 10.1.47, before 10.2.34, before 10.3.25, before 10.4.15, and before 10.5.6
Operating Systems: All operating systems running affected MariaDB versions
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects MariaDB installations with Galera cluster (wsrep) enabled. Standalone MariaDB installations without wsrep are not vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete compromise of database cluster nodes leading to data theft, destruction, or ransomware deployment across the entire cluster.

🟠

Likely Case

Unauthorized command execution on database servers leading to data exfiltration, privilege escalation, or lateral movement within the network.

🟢

If Mitigated

Limited impact due to network segmentation and proper access controls preventing remote exploitation.

🌐 Internet-Facing: HIGH - Remote exploitation possible without authentication if vulnerable MariaDB instances are exposed to untrusted networks.
🏢 Internal Only: MEDIUM - Requires network access to vulnerable MariaDB instances, but internal attackers or compromised systems could exploit it.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires network access to vulnerable MariaDB instances. Public proof-of-concept code exists demonstrating the command injection.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: MariaDB 10.1.47, 10.2.34, 10.3.25, 10.4.15, 10.5.6 or later

Vendor Advisory: https://mariadb.com/kb/en/cve-2020-15180/

Restart Required: Yes

Instructions:

1. Stop MariaDB service. 2. Backup databases. 3. Upgrade to patched version using package manager (apt/yum). 4. Restart MariaDB service. 5. Verify version and functionality.

🔧 Temporary Workarounds

Network Access Restriction

linux

Restrict network access to MariaDB Galera cluster ports (default 4567, 4568, 4444) to trusted hosts only.

iptables -A INPUT -p tcp --dport 4567 -s trusted_ip -j ACCEPT
iptables -A INPUT -p tcp --dport 4567 -j DROP

Disable wsrep_sst_method Remote Configuration

all

Prevent remote configuration of wsrep_sst_method by removing or restricting SET GLOBAL wsrep_sst_method privileges.

REVOKE SUPER ON *.* FROM 'user'@'%';
REVOKE SYSTEM_VARIABLES_ADMIN ON *.* FROM 'user'@'%';

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate MariaDB Galera cluster from untrusted networks
  • Apply principle of least privilege to database user accounts and remove unnecessary privileges

🔍 How to Verify

Check if Vulnerable:

Check MariaDB version and wsrep status: SHOW VARIABLES LIKE 'version%'; SHOW VARIABLES LIKE 'wsrep%';

Check Version:

mysql -V or SELECT VERSION();

Verify Fix Applied:

Verify version is patched: SELECT VERSION(); and confirm it's 10.1.47+, 10.2.34+, 10.3.25+, 10.4.15+, or 10.5.6+

📡 Detection & Monitoring

Log Indicators:

  • Unusual commands in MariaDB error logs
  • Unexpected process execution from mysql user
  • Failed authentication attempts followed by wsrep_sst_method changes

Network Indicators:

  • Unusual traffic to MariaDB Galera ports (4567, 4568, 4444) from unexpected sources
  • Command injection patterns in network traffic

SIEM Query:

source="mariadb.log" AND ("wsrep_sst_method" OR "command injection" OR "unauthorized SET GLOBAL")

🔗 References

📤 Share & Export