CVE-2023-22578

10.0 CRITICAL

📋 TL;DR

CVE-2023-22578 is a critical SQL injection vulnerability in the Sequelize.js ORM library due to improper attribute filtering. Attackers can execute arbitrary SQL commands on databases using vulnerable Sequelize applications. This affects any application using Sequelize with untrusted user input in attribute filtering operations.

💻 Affected Systems

Products:
  • Sequelize.js ORM library
Versions: All versions before 6.32.1
Operating Systems: All platforms running Node.js
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists when using attribute filtering with user-controlled input. Applications not using attribute filtering or using it only with trusted data are not affected.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including data theft, data manipulation, privilege escalation, and potential remote code execution on the database server.

🟠

Likely Case

Data exfiltration, data corruption, and potential application compromise through database manipulation.

🟢

If Mitigated

Limited impact with proper input validation, parameterized queries, and database permission restrictions in place.

🌐 Internet-Facing: HIGH - Web applications using Sequelize with user-controlled input are directly exposed to SQL injection attacks.
🏢 Internal Only: MEDIUM - Internal applications may still be vulnerable if they process untrusted input, though attack surface is reduced.

🎯 Exploit Status

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

SQL injection is a well-understood attack vector with many existing tools and techniques. The vulnerability is in a popular library making exploitation straightforward.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 6.32.1 and later

Vendor Advisory: https://csirt.divd.nl/CVE-2023-22578

Restart Required: Yes

Instructions:

1. Update Sequelize dependency to version 6.32.1 or later. 2. Run 'npm update sequelize' or 'yarn upgrade sequelize'. 3. Restart your Node.js application. 4. Test application functionality after update.

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Implement strict input validation and sanitization for all user-controlled data used in attribute filtering.

Database Permission Restrictions

all

Limit database user permissions to minimum required operations (SELECT only where possible).

🧯 If You Can't Patch

  • Implement Web Application Firewall (WAF) with SQL injection rules
  • Isolate database servers and restrict network access

🔍 How to Verify

Check if Vulnerable:

Check package.json or run 'npm list sequelize' to see installed version. If version is below 6.32.1, you are vulnerable.

Check Version:

npm list sequelize | grep sequelize

Verify Fix Applied:

After updating, verify version is 6.32.1 or higher with 'npm list sequelize'. Test attribute filtering functionality with safe test inputs.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL query patterns in database logs
  • Multiple failed login attempts or unusual WHERE clauses
  • SQL syntax errors in application logs

Network Indicators:

  • Unusual database connection patterns
  • Large data transfers from database server

SIEM Query:

source="database_logs" AND ("UNION SELECT" OR "OR 1=1" OR "--" OR ";--" OR "EXEC(" OR "WAITFOR DELAY")

🔗 References

📤 Share & Export