CVE-2025-36366
📋 TL;DR
IBM Db2 databases are vulnerable to denial of service attacks when users execute queries containing the JSON_Object scalar function, which can trigger an unhandled exception and crash the server. This affects Db2 for Linux, UNIX, Windows, and Db2 Connect Server installations. Any authenticated user with query execution privileges can potentially exploit this vulnerability.
💻 Affected Systems
- IBM Db2 for Linux, UNIX and Windows
- IBM Db2 Connect Server
📦 What is this software?
Db2 by Ibm
Db2 by Ibm
Db2 by Ibm
Db2 by Ibm
Db2 by Ibm
Db2 by Ibm
⚠️ Risk & Real-World Impact
Worst Case
Complete database server crash requiring manual restart, causing extended service disruption and potential data corruption if transactions are interrupted.
Likely Case
Temporary denial of service affecting all database connections until server restart, impacting dependent applications and services.
If Mitigated
Minimal impact with proper access controls limiting who can execute arbitrary queries and monitoring to detect abuse.
🎯 Exploit Status
Exploitation is straightforward once an attacker has database credentials. No special tools or advanced techniques required beyond executing the triggering query.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Refer to IBM advisory for version-specific fixes
Vendor Advisory: https://www.ibm.com/support/pages/node/7257681
Restart Required: Yes
Instructions:
1. Review IBM advisory for your specific Db2 version. 2. Apply the recommended fix pack or interim fix. 3. Restart the Db2 instance to apply changes. 4. Test functionality after patching.
🔧 Temporary Workarounds
Restrict JSON_Object Function Access
allRevoke EXECUTE privileges on JSON_Object function from non-administrative users
REVOKE EXECUTE ON FUNCTION JSON_Object FROM PUBLIC
REVOKE EXECUTE ON FUNCTION JSON_Object FROM <username>
Implement Query Monitoring
allMonitor and alert on queries containing JSON_Object function calls
Configure Db2 audit policies to log JSON_Object usage
Set up real-time monitoring for suspicious query patterns
🧯 If You Can't Patch
- Implement strict access controls to limit who can execute arbitrary queries
- Deploy network segmentation and firewall rules to restrict database access to trusted sources only
🔍 How to Verify
Check if Vulnerable:
Check if your Db2 version is listed in the IBM advisory and test if JSON_Object function is accessible to non-admin users.
Check Version:
db2level (on Db2 command line) or SELECT SERVICE_LEVEL, BUILD_NUM FROM SYSIBMADM.ENV_INST_INFO
Verify Fix Applied:
After patching, attempt to reproduce the crash with the JSON_Object function and verify the server remains stable.
📡 Detection & Monitoring
Log Indicators:
- Database crash logs
- Abnormal termination events
- Error messages related to JSON_Object function
- High frequency of JSON_Object queries
Network Indicators:
- Sudden drop in database connections
- Application errors indicating database unavailability
SIEM Query:
source="db2_audit_logs" AND (function="JSON_Object" OR error="unhandled exception")