CVE-2021-29702
📋 TL;DR
CVE-2021-29702 is a denial-of-service vulnerability in IBM Db2 where a specially crafted SELECT statement causes the database server to crash and terminate abnormally. This affects Db2 for Linux, UNIX and Windows (including Db2 Connect Server) versions 11.1.4 and 11.5.5. Database administrators and organizations running these specific Db2 versions are impacted.
💻 Affected Systems
- IBM Db2 for Linux, UNIX and Windows
- IBM Db2 Connect Server
📦 What is this software?
Db2 by Ibm
Db2 by Ibm
⚠️ Risk & Real-World Impact
Worst Case
Complete database server crash leading to extended service outage, data unavailability, and potential data corruption if crash occurs during critical operations.
Likely Case
Database service disruption requiring manual restart, causing temporary application downtime and operational impact.
If Mitigated
Minimal impact with proper network segmentation and access controls preventing malicious queries from reaching vulnerable systems.
🎯 Exploit Status
Exploitation requires database credentials to execute SELECT statements, but the vulnerability itself is simple to trigger once authenticated.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Apply fixes from IBM APAR IT37446 - upgrade to versions beyond 11.1.4 and 11.5.5
Vendor Advisory: https://www.ibm.com/support/pages/node/6463985
Restart Required: Yes
Instructions:
1. Review IBM advisory IT37446. 2. Apply the appropriate fix pack or interim fix from IBM. 3. Restart the Db2 database server. 4. Verify the fix is applied successfully.
🔧 Temporary Workarounds
Restrict Database Access
allLimit database user privileges and network access to prevent unauthorized users from executing arbitrary SELECT statements.
db2 "REVOKE SELECT ON TABLE <tablename> FROM <username>"
db2 "REVOKE EXECUTE ON PROCEDURE <procedurename> FROM <username>"
Network Segmentation
linuxImplement firewall rules to restrict database access to only trusted application servers and administrators.
iptables -A INPUT -p tcp --dport 50000 -s <trusted_ip> -j ACCEPT
iptables -A INPUT -p tcp --dport 50000 -j DROP
🧯 If You Can't Patch
- Implement strict database user privilege management following least privilege principles
- Deploy network-based intrusion detection systems to monitor for suspicious SELECT statement patterns
🔍 How to Verify
Check if Vulnerable:
Check Db2 version using 'db2level' command and compare against affected versions 11.1.4 and 11.5.5.
Check Version:
db2level
Verify Fix Applied:
Verify the fix is applied by checking for APAR IT37446 in installed fixes: 'db2 "SELECT * FROM SYSIBMADM.ENV_INST_INFO"' or check version is beyond affected ranges.
📡 Detection & Monitoring
Log Indicators:
- Database server crash logs in db2diag.log
- Abnormal termination entries in system logs
- Failed connection attempts following server crash
Network Indicators:
- Unusual patterns of SELECT statements from single sources
- Database port becoming unresponsive
SIEM Query:
source="db2diag.log" AND ("abnormal termination" OR "server terminated")
🔗 References
- https://exchange.xforce.ibmcloud.com/vulnerabilities/200658
- https://security.netapp.com/advisory/ntap-20210720-0005/
- https://www.ibm.com/support/pages/node/6463985
- https://exchange.xforce.ibmcloud.com/vulnerabilities/200658
- https://security.netapp.com/advisory/ntap-20210720-0005/
- https://www.ibm.com/support/pages/node/6463985