CVE-2024-1597
pgjdbc SQL Injection via line comment generation
CRITICAL 10.0
At a glance
- Source
- NVD
- EPSS
- EPSS 4.81 % · percentile 92 ()
- State
- PUBLISHED
- Published
- Updated
- Assigner
- PostgreSQL
- NVD status
- Modified
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.
Weaknesses (CWE)
- CWE-89 — Improper Neutralization of Special Elements used in an SQL Command
References
- https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-24rp-q3w6-vc56
- https://www.enterprisedb.com/docs/security/assessments/cve-2024-1597/
- https://www.enterprisedb.com/docs/jdbc_connector/latest/01_jdbc_rel_notes/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TZQTSMESZD2RJ5XBPSXH3TIQVUW5DIUU/
- https://security.netapp.com/advisory/ntap-20240419-0008/
- http://www.openwall.com/lists/oss-security/2024/04/02/6
- https://lists.debian.org/debian-lts-announce/2024/05/msg00007.html
- https://www.sonarsource.com/blog/double-dash-double-trouble-a-subtle-sql-injection-flaw/
- https://lists.debian.org/debian-lts-announce/2024/12/msg00017.html
Scores
| Version | Score | Vector | Scored by |
|---|---|---|---|
| CVSS 3.1 | CRITICAL 10.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H | PostgreSQL |
| CVSS 3.1 | CRITICAL 10.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H | NVD · f86ef6dc-4d3a-42ad-8f28-e6d5547a5007 (Secondary) |
| CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NVD · nvd@nist.gov (Primary) |
Advisories
- GHSA-24rp-q3w6-vc56 — org.postgresql:postgresql vulnerable to SQL Injection via line comment generation
European references
- ENISA EUVD · EUVD-2024-0465
- GCVE · GCVE-0-2024-1597
CERT-FR advisories
- CERTFR-2026-AVI-0627 — Multiples vulnérabilités dans les produits Splunk · cert.ssi.gouv.fr
- CERTFR-2025-AVI-1013 — Multiples vulnérabilités dans les produits IBM · cert.ssi.gouv.fr
- CERTFR-2024-AVI-0841 — Multiples vulnérabilités dans les produits IBM · cert.ssi.gouv.fr
- CERTFR-2024-AVI-0579 — Multiples vulnérabilités dans les produits IBM · cert.ssi.gouv.fr
- CERTFR-2024-AVI-0529 — Multiples vulnérabilités dans les produits IBM · cert.ssi.gouv.fr
- CERTFR-2024-AVI-0459 — Multiples vulnérabilités dans les produits IBM · cert.ssi.gouv.fr
- CERTFR-2024-AVI-0432 — Multiples vulnérabilités dans les produits Atlassian · cert.ssi.gouv.fr
- CERTFR-2024-AVI-0419 — Multiples vulnérabilités dans les produits IBM · cert.ssi.gouv.fr
- CERTFR-2024-AVI-0305 — Multiples vulnérabilités dans les produits IBM · cert.ssi.gouv.fr
- CERTFR-2024-AVI-0157 — Vulnérabilité dans PostgreSQL JDBC · cert.ssi.gouv.fr
Affected configurations (NVD CPE)
cpe:2.3:a:postgresql:postgresql_jdbc_driver:*:*:*:*:*:*:*:*< 42.2.28cpe:2.3:a:postgresql:postgresql_jdbc_driver:*:*:*:*:*:*:*:*≥ 42.3.0 < 42.3.9cpe:2.3:a:postgresql:postgresql_jdbc_driver:*:*:*:*:*:*:*:*≥ 42.4.0 < 42.4.4cpe:2.3:a:postgresql:postgresql_jdbc_driver:*:*:*:*:*:*:*:*≥ 42.5.0 < 42.5.5cpe:2.3:a:postgresql:postgresql_jdbc_driver:*:*:*:*:*:*:*:*≥ 42.6.0 < 42.6.1cpe:2.3:a:postgresql:postgresql_jdbc_driver:*:*:*:*:*:*:*:*≥ 42.7.0 < 42.7.2cpe:2.3:o:fedoraproject:fedora:40:*:*:*:*:*:*:*
Affected products
| Product | Versions |
|---|---|
| pgjdbc · pgjdbc | affected < 42.7.2 ; affected < 42.6.1 ; affected < 42.5.5 ; affected < 42.4.4 ; affected < 42.3.9 ; affected < 42.2.28 |
Sources
| Source | Licence |
|---|---|
| CVE List (CVEProject cvelistV5) | CVE Program Terms of Use |
| EPSS (FIRST.org) | FIRST — attribution requested |
| ENISA EUVD | ENISA — reproduction authorised, source acknowledged |
| CERT-FR (ANSSI) | Licence Ouverte / Etalab 2.0 |
| NVD (NIST) via fkie-cad/nvd-json-data-feeds | Public domain — this product uses data from the NVD API but is not endorsed or certified by the NVD |