CVE-2025-65896

9.8 CRITICAL

📋 TL;DR

This SQL injection vulnerability in the asyncmy Python library allows attackers to execute arbitrary SQL commands by manipulating dictionary keys in queries. Any application using asyncmy versions up to 0.2.10 with user-controlled input in dictionary keys is affected. This can lead to complete database compromise.

💻 Affected Systems

Products:
  • asyncmy
Versions: through 0.2.10
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Applications using asyncmy with user-controlled dictionary keys in SQL queries are vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full database compromise including data theft, data destruction, and potential remote code execution via database functions.

🟠

Likely Case

Data exfiltration, privilege escalation, and unauthorized data modification.

🟢

If Mitigated

Limited impact with proper input validation and parameterized queries in place.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires user input to reach vulnerable dictionary key handling in SQL queries.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.2.11 or later

Vendor Advisory: https://github.com/long2ice/asyncmy/issues/134

Restart Required: Yes

Instructions:

1. Update asyncmy: pip install --upgrade asyncmy>=0.2.11
2. Restart all services using asyncmy
3. Verify the update with: pip show asyncmy

🔧 Temporary Workarounds

Input Validation

all

Implement strict validation of dictionary keys before passing to asyncmy queries

Parameterized Queries

all

Use parameterized queries instead of string concatenation with dictionary keys

🧯 If You Can't Patch

  • Implement strict input validation for all dictionary keys used in SQL queries
  • Use web application firewall (WAF) with SQL injection protection rules

🔍 How to Verify

Check if Vulnerable:

Check asyncmy version: pip show asyncmy | grep Version

Check Version:

pip show asyncmy | grep Version

Verify Fix Applied:

Confirm version is 0.2.11 or higher: pip show asyncmy | grep Version

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL query patterns
  • Multiple failed login attempts
  • Unexpected database operations

Network Indicators:

  • SQL syntax in HTTP parameters
  • Unusual database connection patterns

SIEM Query:

source=application_logs AND ("SQL syntax" OR "asyncmy" OR "dictionary key")

🔗 References

📤 Share & Export