CVE-2025-53639

9.8 CRITICAL

📋 TL;DR

This SQL injection vulnerability in MeterSphere allows attackers to execute arbitrary SQL commands through the sortField parameter in API endpoints. This could lead to data theft, modification, or deletion, potentially compromising the entire database. All MeterSphere instances running versions before 3.6.5-lts are affected.

💻 Affected Systems

Products:
  • MeterSphere
Versions: All versions prior to 3.6.5-lts
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: All deployments using vulnerable API endpoints are affected regardless of configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including data exfiltration, modification, deletion, or potential remote code execution via database functions.

🟠

Likely Case

Data extraction, modification of test results or configurations, and potential privilege escalation within the application.

🟢

If Mitigated

Limited impact with proper input validation, parameterized queries, and database user privilege restrictions.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

SQL injection via sort parameters is a well-known attack vector with many existing tools and techniques.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 3.6.5-lts

Vendor Advisory: https://github.com/metersphere/metersphere/security/advisories/GHSA-vcm3-5w3f-9f45

Restart Required: Yes

Instructions:

1. Backup your MeterSphere instance and database. 2. Update to version 3.6.5-lts using your deployment method (Docker, Kubernetes, or manual). 3. Restart the MeterSphere service. 4. Verify the update was successful.

🔧 Temporary Workarounds

Input Validation Web Application Firewall (WAF) Rule

all

Block requests containing SQL injection patterns in sortField parameter

WAF-specific configuration required

Database User Privilege Reduction

linux

Limit database user permissions to read-only for application queries

ALTER USER 'metersphere'@'%' WITH GRANT OPTION;
REVOKE ALL PRIVILEGES ON metersphere.* FROM 'metersphere'@'%';
GRANT SELECT ON metersphere.* TO 'metersphere'@'%';

🧯 If You Can't Patch

  • Implement strict input validation for sortField parameter in application code
  • Deploy a WAF with SQL injection detection rules

🔍 How to Verify

Check if Vulnerable:

Check if version is below 3.6.5-lts and test sortField parameter with SQL injection payloads

Check Version:

docker exec metersphere cat /opt/metersphere/version.txt || check web interface About page

Verify Fix Applied:

Confirm version is 3.6.5-lts or higher and test that SQL injection attempts are blocked

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL errors in application logs
  • Multiple requests with sortField containing SQL keywords
  • Database query errors from unexpected sources

Network Indicators:

  • HTTP requests with sortField parameter containing UNION, SELECT, INSERT, DELETE, or other SQL keywords
  • Abnormal database connection patterns

SIEM Query:

source="metersphere.logs" AND ("sortField" AND ("UNION" OR "SELECT" OR "INSERT" OR "DELETE" OR "DROP" OR "--" OR "'"))

🔗 References

📤 Share & Export