CVE-2021-38239

7.5 HIGH

📋 TL;DR

This SQL injection vulnerability in DataEase allows attackers to extract sensitive database information by manipulating the orders parameter in API requests. It affects all DataEase deployments before version 1.2.0. Attackers can exploit this without authentication to access database contents.

💻 Affected Systems

Products:
  • DataEase
Versions: All versions before 1.2.0
Operating Systems: All platforms running DataEase
Default Config Vulnerable: ⚠️ Yes
Notes: Affects all deployments with the vulnerable API endpoint enabled

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including user credentials, sensitive business data, and potential lateral movement to other systems

🟠

Likely Case

Extraction of sensitive information from database tables including user data, configuration details, and application data

🟢

If Mitigated

Limited information disclosure if database permissions are properly restricted and input validation is implemented

🌐 Internet-Facing: HIGH - The vulnerable endpoint is accessible via API and can be exploited remotely without authentication
🏢 Internal Only: HIGH - Even internal attackers or compromised systems can exploit this to gain database access

🎯 Exploit Status

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

Simple SQL injection via parameter manipulation, no authentication required

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.2.0

Vendor Advisory: https://github.com/dataease/dataease/issues/510

Restart Required: Yes

Instructions:

1. Backup your DataEase instance and database. 2. Upgrade to DataEase version 1.2.0 or later. 3. Restart the DataEase service. 4. Verify the fix by testing the vulnerable endpoint.

🔧 Temporary Workarounds

WAF Rule Implementation

all

Implement web application firewall rules to block SQL injection patterns in the orders parameter

# Example ModSecurity rule: SecRule ARGS:orders "@detectSQLi" "id:1001,phase:2,deny,status:403"

Input Validation Filter

all

Add input validation middleware to sanitize the orders parameter before processing

# Example Python validation: import re; if not re.match(r'^[a-zA-Z0-9_,\s]+$', orders_param): raise ValueError('Invalid input')

🧯 If You Can't Patch

  • Implement strict input validation and parameterized queries at the application layer
  • Restrict network access to the DataEase API endpoint using firewall rules

🔍 How to Verify

Check if Vulnerable:

Test the endpoint /api/sys_msg/list/1/10 with SQL injection payloads in the orders parameter (e.g., orders=1' OR '1'='1)

Check Version:

Check DataEase version in web interface or via API endpoint /api/system/version

Verify Fix Applied:

After patching, test the same endpoint with SQL injection payloads and verify they are rejected or sanitized

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL queries in database logs
  • Multiple failed login attempts following SQL injection patterns
  • Requests to /api/sys_msg/list with unusual orders parameter values

Network Indicators:

  • HTTP requests containing SQL keywords in URL parameters
  • Unusual traffic patterns to the vulnerable endpoint

SIEM Query:

source="web_logs" AND uri_path="/api/sys_msg/list" AND (query_string CONTAINS "UNION" OR query_string CONTAINS "SELECT" OR query_string CONTAINS "OR '1'='1'")

🔗 References

📤 Share & Export