CVE-2024-32888 (Java, published 2024-05-15T03:15Z)
Description: value: 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.)
Severity: nan (CVSS v3 base score: )
Weakness: NVD-CWE-noinfo \u2014 Insufficient Information
There is insufficient information about the issue to classify it; details are unkown or unspecified.
Repository: https://github.com/aws/amazon-redshift-jdbc-driver
Files changed:
src/main/java/com/amazon/redshift/core/v3/SimpleParameterList.java
Commit message: More security improvements.


Vulnerable code:
      if (paramType == Oid.TIMESTAMP) {
        type = "timestamp";
      } else if (paramType == Oid.TIMESTAMPTZ) {
        type = "timestamp with time zone";
      } else if (paramType == Oid.TIME) {
        type = "time";
      } else if (paramType == Oid.TIMETZ) {
        type = "time with time zone";
      } else if (paramType == Oid.DATE) {
        type = "date";
      } else if (paramType == Oid.INTERVAL) {
        type = "interval";
      } else if (paramType == Oid.INTERVALY2M) {
        type = "interval year to month";
      } else if (paramType == Oid.INTERVALD2S) {
        type = "interval day to second";
      } else if (paramType == Oid.NUMERIC) {
        type = "numeric";
      }
      else {
        type = null;

Fixed code:
      switch (paramTypes[index])
      {
        case Oid.INT2:
          type = "int2";
          break;
        case Oid.INT4:
          type = "int4";
          break;
        case Oid.INT8:
          type = "int8";
          break;
        case Oid.FLOAT4:
          type = "real";
          break;
        case Oid.FLOAT8:
          type = "double precision";
          break;
        case Oid.TIMESTAMP:
          type = "timestamp";
          break;
        case Oid.TIMESTAMPTZ:
          type = "timestamp with time zone";
          break;
        case Oid.TIME:
          type = "time";
          break;
        case Oid.TIMETZ:
          type = "time with time zone";
          break;
        case Oid.DATE:
          type = "date";
          break;
        case Oid.INTERVAL:
          type = "interval";
          break;
        case Oid.INTERVALY2M:
          type = "interval year to month";
          break;
        case Oid.INTERVALD2S:
          type = "interval day to second";
          break;
        case Oid.NUMERIC:
          type = "numeric";
          break;
        case Oid.UUID:
          type = "uuid";
          break;
        case Oid.BOOL:
          type = "boolean";
          break;
        case Oid.BOX:
          type = "box";
          break;
        case Oid.POINT:
          type = "point";
          break;
        default:
          type = null;