CVE-2024-32888
📋 TL;DR
This CVE describes a SQL injection vulnerability in the Amazon JDBC Driver for Redshift when using the unsupported 'preferQueryMode=simple' connection property. Attackers could execute arbitrary SQL commands on affected databases. Only users who explicitly set this non-default parameter are vulnerable.
💻 Affected Systems
- Amazon JDBC Driver for Redshift
⚠️ Manual Verification Required
This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.
Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).
🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.
- Review the CVE details at NVD
- Check vendor security advisories for your specific version
- Test if the vulnerability is exploitable in your environment
- Consider updating to the latest version as a precaution
⚠️ Risk & Real-World Impact
Worst Case
Full database compromise including data theft, modification, deletion, and potential privilege escalation to execute arbitrary commands on the database server.
Likely Case
Data exfiltration, unauthorized data modification, or database disruption through SQL injection attacks.
If Mitigated
No impact when using default extended query mode or when proper input validation and parameterized queries are implemented.
🎯 Exploit Status
Exploitation requires application code with vulnerable SQL that negates parameter values, combined with the specific connection property setting.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 2.1.0.28
Vendor Advisory: https://github.com/aws/amazon-redshift-jdbc-driver/security/advisories/GHSA-x3wm-hffr-chwm
Restart Required: Yes
Instructions:
1. Update Amazon Redshift JDBC Driver to version 2.1.0.28 or later. 2. Replace the driver JAR file in your application. 3. Restart the application to load the new driver version.
🔧 Temporary Workarounds
Remove preferQueryMode=simple
allDo not use the 'preferQueryMode=simple' connection property in your JDBC connection strings or configuration.
Remove 'preferQueryMode=simple' from all JDBC connection strings and configuration files
🧯 If You Can't Patch
- Ensure all SQL queries use parameterized statements/prepared statements
- Implement strict input validation and sanitization for all user-supplied data in SQL queries
🔍 How to Verify
Check if Vulnerable:
Check if your application uses Amazon Redshift JDBC Driver version <2.1.0.28 AND has 'preferQueryMode=simple' in connection properties.
Check Version:
Check the driver JAR file name or use: java -cp redshift-jdbc42-*.jar com.amazon.redshift.Driver --version
Verify Fix Applied:
Verify driver version is 2.1.0.28 or later and confirm 'preferQueryMode=simple' is not present in connection strings.
📡 Detection & Monitoring
Log Indicators:
- Unusual SQL query patterns, especially with negation operators
- Multiple failed login attempts or unusual database access patterns
Network Indicators:
- Unusual database query traffic patterns from application servers
SIEM Query:
Search for connection strings containing 'preferQueryMode=simple' in configuration files or application logs
🔗 References
- https://github.com/aws/amazon-redshift-jdbc-driver/commit/0d354a5f26ca23f7cac4e800e3b8734220230319
- https://github.com/aws/amazon-redshift-jdbc-driver/commit/12a5e8ecfbb44c8154fc66041cca2e20ecd7b339
- https://github.com/aws/amazon-redshift-jdbc-driver/commit/bc93694201a291493778ce5369a72befeca5ba7d
- https://github.com/aws/amazon-redshift-jdbc-driver/security/advisories/GHSA-x3wm-hffr-chwm
- https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-24rp-q3w6-vc56
- https://github.com/aws/amazon-redshift-jdbc-driver/commit/0d354a5f26ca23f7cac4e800e3b8734220230319
- https://github.com/aws/amazon-redshift-jdbc-driver/commit/12a5e8ecfbb44c8154fc66041cca2e20ecd7b339
- https://github.com/aws/amazon-redshift-jdbc-driver/commit/bc93694201a291493778ce5369a72befeca5ba7d
- https://github.com/aws/amazon-redshift-jdbc-driver/security/advisories/GHSA-x3wm-hffr-chwm
- https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-24rp-q3w6-vc56
- https://www.sonarsource.com/blog/double-dash-double-trouble-a-subtle-sql-injection-flaw/