CVE-2024-32888
Critical · 10.0CVSS
10.0
EPSS
0.8%
Published
May 15, 2024
CISA due date
—
Cloudanix analysis
Some applications using a nonstandard Redshift database connection setting may let attackers change database queries and access or alter data they should not be able to reach.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Moderate
- Impact
- Full Compromise
- Component
- Library
- Class
- SQL Injection
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
This flaw is a conditional SQL injection issue in the Amazon Redshift JDBC Driver before version 2.1.0.28. It is only exposed when an application explicitly sets the unsupported connection property `preferQueryMode=simple` and the application constructs a vulnerable SQL statement that negates a parameter value. In that mode, the driver can fail to preserve intended parameterization semantics, allowing attacker-controlled input to alter the SQL statement sent to Amazon Redshift. Successful exploitation can allow unauthorized query manipulation, data disclosure, data modification, or destructive database operations depending on the database permissions of the application account. Applications using the default extended query mode are not affected.
Why it matters to the business
If exploitable in an application, this vulnerability can allow an unauthenticated remote attacker to manipulate database queries issued by the application, potentially exposing sensitive analytics data, corrupting business records, or disrupting reporting and data processing workflows. The CVSS score is critical, but real-world exposure is narrower because exploitation requires the non-default `preferQueryMode=simple` setting and vulnerable application SQL construction. It is not currently listed in CISA KEV, is not known to be used in ransomware campaigns, and has a low EPSS score, so prioritization should focus first on internet-facing or high-trust applications that use the Redshift JDBC driver with the affected connection option.
How an attack unfolds
An attacker first identifies an application endpoint that accepts input later used in a Redshift-backed query. The application must be using an affected Amazon Redshift JDBC Driver version and must explicitly enable the unsupported `preferQueryMode=simple` connection property. The attacker then supplies crafted input to a parameter that is used in application SQL involving a negated parameter value. Because the driver is operating in simple query mode, the intended separation between SQL structure and attacker-controlled data can break down in the vulnerable pattern. The resulting SQL sent to Redshift may include attacker-influenced logic rather than only the intended value. If the application database role has sufficient privileges, the attacker may read unauthorized data, alter query filters, modify records, run additional database operations, or cause query failures and availability impact. There are no known named threat actors or public exploitation campaigns associated with this issue based on the supplied data.
How to fix it
Upgrade the Amazon Redshift JDBC Driver to version 2.1.0.28 or later. For source-based consumers, ensure the driver includes the upstream fix commit `51af003d4be170042faef20dadbcf4f992e10d8a`. Remove the unsupported connection property `preferQueryMode=simple` from all Redshift JDBC connection strings and configuration files; the default extended query mode is not affected. Review application code for SQL patterns that negate parameter values and ensure all SQL uses safe parameter binding without string concatenation. Apply least-privilege permissions to Redshift application roles so that any query manipulation has limited blast radius. If immediate upgrade is not possible, mitigation should prioritize removing `preferQueryMode=simple`, redeploying affected services, and rotating or constraining credentials used by exposed applications.
How to confirm the fix worked
Confirm dependency inventories, build manifests, container images, and deployed artifacts use Amazon Redshift JDBC Driver version 2.1.0.28 or later. Search application configuration, environment variables, secrets templates, deployment manifests, and connection-string builders for `preferQueryMode=simple`; affected deployments should not contain this setting. Validate runtime behavior by checking effective JDBC URLs or startup logs where connection properties are emitted. Review application source for negated parameter SQL patterns and verify that prepared statements are still used safely. In Redshift, review recent query history and audit logs for suspicious SQL fragments, unexpected changes to query predicates, failed syntax attempts, or unusual access by application database users. After remediation, run regression tests for affected database access paths and confirm no JDBC connections are established in simple query mode.
Typical attack path
- Find an application endpoint or API parameter that influences a Redshift query.
- Confirm or infer that the application uses the Amazon Redshift JDBC Driver before version 2.1.0.28.
- Confirm or infer that the JDBC connection string explicitly sets `preferQueryMode=simple`.
- Target application functionality where user input is bound into SQL that negates a parameter value.
- Submit crafted input designed to alter the SQL logic generated by the application and driver combination.
- Use the manipulated query behavior to bypass filters, access unauthorized rows, modify data, or disrupt database-backed functionality.
- Repeat against higher-value queries or accounts if the application database role has broad Redshift permissions.
How to detect it
To determine whether this was already exploited, correlate application request logs, API gateway or web server logs, application error logs, JDBC/database exception logs, and Amazon Redshift audit/query logs. Focus on applications that used an affected driver version and explicitly configured `preferQueryMode=simple`. In application logs, look for parameters containing SQL metacharacters, comment markers, tautologies, encoded quotes, or repeated probing that coincides with database syntax errors or unusual response sizes. In Redshift, review user activity logs, query logs, STL_QUERY, STL_ERROR, STL_UTILITYTEXT, SVL_STATEMENTTEXT, and related audit exports for unexpected predicates, comments, UNION-style probes, information schema reconnaissance, unauthorized SELECTs, DDL, COPY/UNLOAD activity, or queries issued by application users outside expected application behavior. Pay special attention to query text generated by application service accounts after suspicious HTTP requests. Absence of a generic IOC does not prove safety because payloads are application-specific and exploitation depends on the affected SQL pattern.
- preferQueryMode=simple
- preferQueryMode%3Dsimple
- com.amazon.redshift.jdbc.Driver
- redshift-jdbc42
- redshift-jdbc
- Amazon Redshift JDBC Driver
- SQLState
- syntax error at or near
- unterminated quoted string
- ERROR: syntax error
- ERROR: unterminated quoted string
- UNION SELECT
- union select
- information_schema.tables
- information_schema.columns
- pg_catalog
- --
- /*
- */
- ' OR '1'='1
- " OR "1"="1
- OR 1=1
- or 1=1
- ; DROP TABLE
- ;DROP TABLE
- UNLOAD (
- COPY
- STL_QUERY
- STL_ERROR
- SVL_STATEMENTTEXT
What your security team should do
- Inventory all applications and services that use the Amazon Redshift JDBC Driver, including packaged applications, data pipelines, ETL jobs, BI middleware, and container images.
- Prioritize internet-facing, partner-facing, and high-privilege applications that connect to Redshift and accept user-controlled input.
- Upgrade the driver to version 2.1.0.28 or later, or confirm inclusion of fix commit `51af003d4be170042faef20dadbcf4f992e10d8a`.
- Immediately remove `preferQueryMode=simple` from Redshift JDBC connection strings and configuration because the default query mode is not affected.
- Search code for vulnerable SQL construction involving negated parameter values and verify all user input remains safely parameterized.
- Review Redshift audit logs and application logs for suspicious SQL injection patterns, especially around endpoints that recently returned database errors or unusual result sets.
- Reduce Redshift permissions for application roles to the minimum required privileges, especially write, DDL, unload/export, and administrative capabilities.
- Because this is not currently in KEV and EPSS is low, track it as high severity for confirmed exposure rather than assuming broad exploitation across all Redshift JDBC users.
The record
The Amazon JDBC Driver for Redshift is a Type 4 JDBC driver that provides database connectivity through the standard JDBC application program interfaces (APIs) available in the Java Platform, Enterprise Editions. Prior to version 2.1.0.28, SQL injection is possible when using the non-default connection property `preferQueryMode=simple` in combination with application code which has a vulnerable SQL that negates a parameter value. There is no vulnerability in the driver when using the default, extended query mode. Note that `preferQueryMode` is not a supported parameter in Redshift JDBC driver, and is inherited code from Postgres JDBC driver. Users who do not override default settings to utilize this unsupported query mode are not affected. This issue is patched in driver version 2.1.0.28. As a workaround, do not use the connection property `preferQueryMode=simple`. (NOTE: Those who do not explicitly specify a query mode use the default of extended query mode and are not affected by this issue.)
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Maven | com.amazon.redshift:redshift-jdbc42 | 0 | 2.1.0.28 |
| Maven | org.postgresql:postgresql | 0 | 42.2.8 |
| Maven | org.postgresql:postgresql | 0 | 42.2.28 |
| Maven | org.postgresql:postgresql | 42.3.0 | 42.3.9 |
| Maven | org.postgresql:postgresql | 42.4.0 | 42.4.4 |
| Maven | org.postgresql:postgresql | 42.5.0 | 42.5.5 |
| Maven | org.postgresql:postgresql | 42.6.0 | 42.6.1 |
| Maven | org.postgresql:postgresql | 42.7.0 | 42.7.2 |
| Bitnami | postgresql-jdbc-driver | 0 | 42.2.28 |
| Bitnami | postgresql-jdbc-driver | 42.7.0 | 42.7.2 |
| Chainguard | mariadb-10.6 | 0 | 10.6.17-r0 |
| Chainguard | mariadb-11.2 | 0 | 11.2.3-r2 |
| Chainguard | trino | 0 | 472-r0 |
| Chainguard | trino-config | 0 | 472-r0 |
| Chainguard | trino-oci-entrypoint | 0 | 472-r0 |
| Chainguard | trino-plugin-accumulo | 0 | 472-r0 |
| Chainguard | trino-plugin-ai-functions | 0 | 472-r0 |
| Chainguard | trino-plugin-atop | 0 | 472-r0 |
| Chainguard | trino-plugin-bigquery | 0 | 472-r0 |
| Chainguard | trino-plugin-blackhole | 0 | 472-r0 |
| Chainguard | trino-plugin-cassandra | 0 | 472-r0 |
| Chainguard | trino-plugin-clickhouse | 0 | 472-r0 |
| Chainguard | trino-plugin-delta-lake | 0 | 472-r0 |
| Chainguard | trino-plugin-druid | 0 | 472-r0 |
| Chainguard | trino-plugin-duckdb | 0 | 472-r0 |
| Chainguard | trino-plugin-elasticsearch | 0 | 472-r0 |
| Chainguard | trino-plugin-example-http | 0 | 472-r0 |
| Chainguard | trino-plugin-exasol | 0 | 472-r0 |
| Chainguard | trino-plugin-exchange-filesystem | 0 | 472-r0 |
| Chainguard | trino-plugin-exchange-hdfs | 0 | 472-r0 |
| Chainguard | trino-plugin-faker | 0 | 472-r0 |
| Chainguard | trino-plugin-functions-python | 0 | 472-r0 |
| Chainguard | trino-plugin-geospatial | 0 | 472-r0 |
| Chainguard | trino-plugin-google-sheets | 0 | 472-r0 |
| Chainguard | trino-plugin-hive | 0 | 472-r0 |
| Chainguard | trino-plugin-http-event-listener | 0 | 472-r0 |
| Chainguard | trino-plugin-http-server-event-listener | 0 | 472-r0 |
| Chainguard | trino-plugin-hudi | 0 | 472-r0 |
| Chainguard | trino-plugin-iceberg | 0 | 472-r0 |
| Chainguard | trino-plugin-ignite | 0 | 472-r0 |
| Chainguard | trino-plugin-jmx | 0 | 472-r0 |
| Chainguard | trino-plugin-kafka | 0 | 472-r0 |
| Chainguard | trino-plugin-kafka-event-listener | 0 | 472-r0 |
| Chainguard | trino-plugin-kinesis | 0 | 472-r0 |
| Chainguard | trino-plugin-kudu | 0 | 472-r0 |
| Chainguard | trino-plugin-lakehouse | 0 | 472-r0 |
| Chainguard | trino-plugin-ldap-group-provider | 0 | 472-r0 |
| Chainguard | trino-plugin-local-file | 0 | 472-r0 |
| Chainguard | trino-plugin-loki | 0 | 472-r0 |
| Chainguard | trino-plugin-mariadb | 0 | 472-r0 |
| Chainguard | trino-plugin-memory | 0 | 472-r0 |
| Chainguard | trino-plugin-ml | 0 | 472-r0 |
| Chainguard | trino-plugin-mongodb | 0 | 472-r0 |
| Chainguard | trino-plugin-mysql | 0 | 472-r0 |
| Chainguard | trino-plugin-mysql-event-listener | 0 | 472-r0 |
| Chainguard | trino-plugin-opa | 0 | 472-r0 |
| Chainguard | trino-plugin-openlineage | 0 | 472-r0 |
| Chainguard | trino-plugin-opensearch | 0 | 472-r0 |
| Chainguard | trino-plugin-oracle | 0 | 472-r0 |
| Chainguard | trino-plugin-password-authenticators | 0 | 472-r0 |
| Chainguard | trino-plugin-phoenix5 | 0 | 472-r0 |
| Chainguard | trino-plugin-pinot | 0 | 472-r0 |
| Chainguard | trino-plugin-postgresql | 0 | 472-r0 |
| Chainguard | trino-plugin-prometheus | 0 | 472-r0 |
| Chainguard | trino-plugin-ranger | 0 | 472-r0 |
| Chainguard | trino-plugin-raptor-legacy | 0 | 472-r0 |
| Chainguard | trino-plugin-redis | 0 | 472-r0 |
| Chainguard | trino-plugin-redshift | 0 | 472-r0 |
| Chainguard | trino-plugin-resource-group-managers | 0 | 472-r0 |
| Chainguard | trino-plugin-session-property-managers | 0 | 472-r0 |
| Chainguard | trino-plugin-singlestore | 0 | 472-r0 |
| Chainguard | trino-plugin-snowflake | 0 | 472-r0 |
| Chainguard | trino-plugin-spooling-filesystem | 0 | 472-r0 |
| Chainguard | trino-plugin-sqlserver | 0 | 472-r0 |
| Chainguard | trino-plugin-teradata-functions | 0 | 472-r0 |
| Chainguard | trino-plugin-thrift | 0 | 472-r0 |
| Chainguard | trino-plugin-tpcds | 0 | 472-r0 |
| Chainguard | trino-plugin-tpch | 0 | 472-r0 |
| Chainguard | trino-plugin-vertica | 0 | 472-r0 |
| Debian:11 | libpgjava | 0 | No fix |
| Debian:12 | libpgjava | 0 | No fix |
| Debian:13 | libpgjava | 0 | 42.7.2-1 |
| Debian:14 | libpgjava | 0 | 42.7.2-1 |
| Ubuntu:20.04:LTS | libpgjava | 0 | No fix |
| Ubuntu:22.04:LTS | libpgjava | 0 | No fix |
| Ubuntu:24.04:LTS | libpgjava | 0 | 42.7.2-1 |
| Ubuntu:Pro:14.04:LTS | libpgjava | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | libpgjava | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | libpgjava | 0 | No fix |
| Wolfi | trino | 0 | 472-r0 |
| Wolfi | trino-config | 0 | 472-r0 |
| Wolfi | trino-oci-entrypoint | 0 | 472-r0 |
| Wolfi | trino-plugin-accumulo | 0 | 472-r0 |
| Wolfi | trino-plugin-ai-functions | 0 | 472-r0 |
| Wolfi | trino-plugin-atop | 0 | 472-r0 |
| Wolfi | trino-plugin-bigquery | 0 | 472-r0 |
| Wolfi | trino-plugin-blackhole | 0 | 472-r0 |
| Wolfi | trino-plugin-cassandra | 0 | 472-r0 |
| Wolfi | trino-plugin-clickhouse | 0 | 472-r0 |
| Wolfi | trino-plugin-delta-lake | 0 | 472-r0 |
| Wolfi | trino-plugin-druid | 0 | 472-r0 |
| Wolfi | trino-plugin-duckdb | 0 | 472-r0 |
| Wolfi | trino-plugin-elasticsearch | 0 | 472-r0 |
| Wolfi | trino-plugin-example-http | 0 | 472-r0 |
| Wolfi | trino-plugin-exasol | 0 | 472-r0 |
| Wolfi | trino-plugin-exchange-filesystem | 0 | 472-r0 |
| Wolfi | trino-plugin-exchange-hdfs | 0 | 472-r0 |
| Wolfi | trino-plugin-faker | 0 | 472-r0 |
| Wolfi | trino-plugin-functions-python | 0 | 472-r0 |
| Wolfi | trino-plugin-geospatial | 0 | 472-r0 |
| Wolfi | trino-plugin-google-sheets | 0 | 472-r0 |
| Wolfi | trino-plugin-hive | 0 | 472-r0 |
| Wolfi | trino-plugin-http-event-listener | 0 | 472-r0 |
| Wolfi | trino-plugin-http-server-event-listener | 0 | 472-r0 |
| Wolfi | trino-plugin-hudi | 0 | 472-r0 |
| Wolfi | trino-plugin-iceberg | 0 | 472-r0 |
| Wolfi | trino-plugin-ignite | 0 | 472-r0 |
| Wolfi | trino-plugin-jmx | 0 | 472-r0 |
| Wolfi | trino-plugin-kafka | 0 | 472-r0 |
| Wolfi | trino-plugin-kafka-event-listener | 0 | 472-r0 |
| Wolfi | trino-plugin-kinesis | 0 | 472-r0 |
| Wolfi | trino-plugin-kudu | 0 | 472-r0 |
| Wolfi | trino-plugin-lakehouse | 0 | 472-r0 |
| Wolfi | trino-plugin-ldap-group-provider | 0 | 472-r0 |
| Wolfi | trino-plugin-local-file | 0 | 472-r0 |
| Wolfi | trino-plugin-loki | 0 | 472-r0 |
| Wolfi | trino-plugin-mariadb | 0 | 472-r0 |
| Wolfi | trino-plugin-memory | 0 | 472-r0 |
| Wolfi | trino-plugin-ml | 0 | 472-r0 |
| Wolfi | trino-plugin-mongodb | 0 | 472-r0 |
| Wolfi | trino-plugin-mysql | 0 | 472-r0 |
| Wolfi | trino-plugin-mysql-event-listener | 0 | 472-r0 |
| Wolfi | trino-plugin-opa | 0 | 472-r0 |
| Wolfi | trino-plugin-openlineage | 0 | 472-r0 |
| Wolfi | trino-plugin-opensearch | 0 | 472-r0 |
| Wolfi | trino-plugin-oracle | 0 | 472-r0 |
| Wolfi | trino-plugin-password-authenticators | 0 | 472-r0 |
| Wolfi | trino-plugin-phoenix5 | 0 | 472-r0 |
| Wolfi | trino-plugin-pinot | 0 | 472-r0 |
| Wolfi | trino-plugin-postgresql | 0 | 472-r0 |
| Wolfi | trino-plugin-prometheus | 0 | 472-r0 |
| Wolfi | trino-plugin-ranger | 0 | 472-r0 |
| Wolfi | trino-plugin-raptor-legacy | 0 | 472-r0 |
| Wolfi | trino-plugin-redis | 0 | 472-r0 |
| Wolfi | trino-plugin-redshift | 0 | 472-r0 |
| Wolfi | trino-plugin-resource-group-managers | 0 | 472-r0 |
| Wolfi | trino-plugin-session-property-managers | 0 | 472-r0 |
| Wolfi | trino-plugin-singlestore | 0 | 472-r0 |
| Wolfi | trino-plugin-snowflake | 0 | 472-r0 |
| Wolfi | trino-plugin-spooling-filesystem | 0 | 472-r0 |
| Wolfi | trino-plugin-sqlserver | 0 | 472-r0 |
| Wolfi | trino-plugin-teradata-functions | 0 | 472-r0 |
| Wolfi | trino-plugin-thrift | 0 | 472-r0 |
| Wolfi | trino-plugin-tpcds | 0 | 472-r0 |
| Wolfi | trino-plugin-tpch | 0 | 472-r0 |
| Wolfi | trino-plugin-vertica | 0 | 472-r0 |
| maven | org.postgresql/postgresql | 42.3.0 | 42.3.9 |
| maven | org.postgresql/postgresql | 42.4.0 | 42.4.4 |
| maven | org.postgresql/postgresql | 42.5.0 | 42.5.5 |
| maven | org.postgresql/postgresql | 42.6.0 | 42.6.1 |
| maven | org.postgresql/postgresql | 42.7.0 | 42.7.2 |
Related vulnerabilities
- CVE-2025-49146 pgjdbc is an open source postgresql JDBC Driver. Also affects org.postgresql:postgresql
- CVE-2023-52969 MariaDB Server 10.4 through 10.5.*, 10.6 through 10.6.*, 10.7 through 10.11.*, and 11.0… Also affects mariadb-10.6
- CVE-2023-52970 MariaDB Server 10.4 through 10.5.*, 10.6 through 10.6.*, 10.7 through 10.11.*, 11.0… Also affects mariadb-10.6
- CVE-2026-1605 In Eclipse Jetty, versions 12.0.0-12.0.31 and 12.1.0-12.0.5, class GzipHandler exposes a… Also affects trino
- CVE-2026-1225 ACE vulnerability in configuration file processing by QOS.CH logback-core up to and… Also affects trino
- CVE-2025-67721 Aircompressor is a library with ports of the Snappy, LZO, LZ4, and Zstandard compression… Also affects trino
- CVE-2025-59419 Netty is an asynchronous, event-driven network application framework. Also affects trino
- CVE-2025-59250 JDBC Driver for SQL Server has improper input validation issue Also affects trino