CVE-2024-35181

5.9 MEDIUM

📋 TL;DR

A SQL injection vulnerability in Meshery versions prior to 0.7.22 allows attackers to execute arbitrary SQL commands via the 'order' query parameter in the GetMeshSyncResourcesKinds API endpoint. This can lead to arbitrary file writes, data theft, and modification of sensitive configuration data. All Meshery deployments running vulnerable versions are affected.

💻 Affected Systems

Products:
  • Meshery
Versions: All versions prior to 0.7.22
Operating Systems: All platforms running Meshery
Default Config Vulnerable: ⚠️ Yes
Notes: The vulnerability exists in the default API endpoint /api/system/meshsync/resources/kinds and requires no special configuration to be exploitable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers can write arbitrary files to the server, steal session cookies from performance profiles, access Kubernetes configurations, and potentially achieve remote code execution through file manipulation.

🟠

Likely Case

Attackers can extract sensitive data from the database including performance profiles, application data, and Kubernetes configurations, potentially leading to lateral movement within the infrastructure.

🟢

If Mitigated

With proper input validation and parameterized queries, the SQL injection would be prevented, limiting impact to normal API functionality.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

The vulnerability is in a publicly accessible API endpoint and SQL injection exploitation is well-understood with many available tools.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.7.22

Vendor Advisory: https://github.com/meshery/meshery/security/advisories

Restart Required: Yes

Instructions:

1. Stop Meshery service. 2. Update to version 0.7.22 or later using your deployment method (Docker, Kubernetes, etc.). 3. Restart Meshery service. 4. Verify the fix by checking the version and testing the vulnerable endpoint.

🔧 Temporary Workarounds

API Endpoint Restriction

all

Block or restrict access to the vulnerable API endpoint using network controls or web application firewall rules.

# Example nginx location block
location /api/system/meshsync/resources/kinds {
    deny all;
    return 403;
}

Input Validation Filter

all

Implement input validation at the proxy/WAF level to reject SQL injection patterns in the 'order' parameter.

# Example ModSecurity rule
SecRule ARGS:order "@detectSQLi" "id:1001,phase:2,deny,status:403,msg:'SQL Injection Attempt'"

🧯 If You Can't Patch

  • Implement strict network segmentation to limit access to Meshery API endpoints to trusted sources only.
  • Deploy a web application firewall (WAF) with SQL injection protection rules in front of Meshery.

🔍 How to Verify

Check if Vulnerable:

Check if Meshery version is below 0.7.22 and test the /api/system/meshsync/resources/kinds endpoint with SQL injection payloads in the 'order' parameter.

Check Version:

mesheryctl version or check Meshery UI dashboard for version information

Verify Fix Applied:

After patching, verify version is 0.7.22 or higher and test that SQL injection payloads no longer execute successfully.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL queries in application logs
  • Multiple failed attempts to /api/system/meshsync/resources/kinds
  • ATTACH DATABASE commands in SQL logs

Network Indicators:

  • SQL keywords in HTTP GET parameters
  • Unusual patterns of requests to the vulnerable endpoint
  • Stacked query patterns in HTTP traffic

SIEM Query:

source="meshery" AND (url="/api/system/meshsync/resources/kinds" AND (param="order" AND value MATCHES "(?i)(SELECT|UNION|ATTACH|--|;)"))

🔗 References

📤 Share & Export