Vulnerabilities / CVE-2024-1597

critical

CVE-2024-1597

pgjdbc: PostgreSQL JDBC Driver allows attacker to inject SQL if using PreferQueryMode=SIMPLE

Published Modified CWE 89
In the Trivy database since at least 24 Oct 2026, 07:11 UTCWhen it arrived before that build is not recorded.

Severity by source

NVD9.8CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GHSA10.0CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Red Hat9.8CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Bitnami10.0CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Trivy's own label is CRITICAL. Rated critical by NVD, GHSA, Bitnami. Rated lower by Red Hat (high), AlmaLinux (high), Oracle (high), Rocky Linux (high), Ubuntu (medium).

Description

pgjdbc, the PostgreSQL JDBC Driver, allows attacker to inject SQL if using PreferQueryMode=SIMPLE. Note this is not the default. In the default mode there is no vulnerability. A placeholder for a numeric value must be immediately preceded by a minus. There must be a second placeholder for a string value after the first placeholder; both must be on the same line. By constructing a matching string payload, the attacker can inject SQL to alter the query,bypassing the protections that parameterized queries bring against SQL Injection attacks. Versions before 42.7.2, 42.6.1, 42.5.5, 42.4.4, 42.3.9, and 42.2.28 are affected.

Affected packages and fixed versions

SourcePackageFixed in
bitnami::Bitnami Vulnerability Databasepostgresql-jdbc-driver42.2.28, 42.3.9, 42.4.4, 42.5.5, 42.6.1, 42.7.2
maven::GitHub Security Advisory Mavenorg.postgresql:postgresql42.2.28, 42.3.9, 42.4.4, 42.5.5, 42.6.1, 42.7.2
alma 8postgresql-jdbc, postgresql-jdbc-javadoc42.2.14-3.el8_9
alma 9postgresql-jdbc42.2.28-1.el9_3
alpine 3.19java-postgresql-jdbc42.6.2-r0
alpine 3.20java-postgresql-jdbc42.6.2-r0
alpine 3.21java-postgresql-jdbc42.6.2-r0
alpine 3.22java-postgresql-jdbc42.6.2-r0
alpine 3.23java-postgresql-jdbc42.6.2-r0
alpine 3.24java-postgresql-jdbc42.6.2-r0
alpine edgejava-postgresql-jdbc42.6.2-r0
chainguarddependency-track, keycloak, mariadb-10.11 and 3 more4.10.1-r1 and 5 more
Show all 43 entries from 27 sources
SourcePackageFixed in
bitnami::Bitnami Vulnerability Databasepostgresql-jdbc-driver42.2.28, 42.3.9, 42.4.4, 42.5.5, 42.6.1, 42.7.2
maven::GitHub Security Advisory Mavenorg.postgresql:postgresql42.2.28, 42.3.9, 42.4.4, 42.5.5, 42.6.1, 42.7.2
alma 8postgresql-jdbc42.2.14-3.el8_9
alma 8postgresql-jdbc-javadoc42.2.14-3.el8_9
alma 9postgresql-jdbc42.2.28-1.el9_3
alpine 3.19java-postgresql-jdbc42.6.2-r0
alpine 3.20java-postgresql-jdbc42.6.2-r0
alpine 3.21java-postgresql-jdbc42.6.2-r0
alpine 3.22java-postgresql-jdbc42.6.2-r0
alpine 3.23java-postgresql-jdbc42.6.2-r0
alpine 3.24java-postgresql-jdbc42.6.2-r0
alpine edgejava-postgresql-jdbc42.6.2-r0
chainguarddependency-track4.10.1-r1
chainguardkeycloak23.0.7-r0
chainguardmariadb-10.1110.11.8-r2
chainguardmariadb-10.610.6.17-r0
chainguardmariadb-11.211.2.3-r2
chainguardtrino439-r2
debian 10libpgjava42.2.5-2+deb10u4
debian 11libpgjava42.2.15-1+deb11u2
debian 12libpgjava42.5.5-0+deb12u1
debian 13libpgjava42.7.2-1
debian 14libpgjava42.7.2-1
echolibpgjava42.5.5-0+deb12u1
minimosmariadb-10.1110.11.11-r1
minimosmariadb-10.510.5.28-r1
minimosmariadb-10.610.6.21-r1
Oracle Linux 8postgresql-jdbc42.2.14-3.el8_9
Oracle Linux 8postgresql-jdbc-javadoc42.2.14-3.el8_9
Oracle Linux 9postgresql-jdbc42.2.28-1.el9_3
rapidfort Oracle Linux 9postgresql-jdbc0:42.2.28-1.el9_3
Red Hatlibreoffice:flatpak::postgresql-jdbcno fix listed
Red Hatlibreoffice:flatpak::postgresql-jdbc-javadocno fix listed
rocky 8postgresql-jdbc42.2.14-3.el8_9
rocky 8postgresql-jdbc-javadoc42.2.14-3.el8_9
rocky 9postgresql-jdbc42.2.28-1.el9_3
ubuntu 18.04-ESMlibpgjavano fix listed
wolfidependency-track4.10.1-r1
wolfikeycloak23.0.7-r0
wolfimariadb-10.1110.11.8-r2
wolfimariadb-10.610.6.17-r0
wolfimariadb-11.211.2.3-r2
wolfitrino439-r2

References

All 30 references

Vulnerability data compiled from the Trivy vulnerability database (trivy-db, Aqua Security, Apache License 2.0), which aggregates third-party advisories. CVE records are published by The MITRE Corporation under the CVE Terms of Use; CVE is a trademark of MITRE. This product uses data from the NVD API but is not endorsed or certified by the NVD. Severity, titles and advisory data from the GitHub Advisory Database (CC BY 4.0), Red Hat security data (CC BY 4.0) and the other sources linked on each entry. Entries may be summarised or re-formatted; the linked original is the authoritative record.