Staging Environment: Content and features may be unstable or change without notice.
Search for vulnerabilities
Vulnerability details: VCID-qnmv-sd5k-bqc2
Vulnerability ID VCID-qnmv-sd5k-bqc2
Aliases CVE-2024-1597
GHSA-24rp-q3w6-vc56
Summary org.postgresql:postgresql vulnerable to SQL Injection via line comment generation # Impact SQL injection is possible when using the non-default connection property `preferQueryMode=simple` in combination with application code that has a vulnerable SQL that negates a parameter value. There is no vulnerability in the driver when using the default query mode. Users that do not override the query mode are not impacted. # Exploitation To exploit this behavior the following conditions must be met: 1. A placeholder for a numeric value must be immediately preceded by a minus (i.e. `-`) 1. There must be a second placeholder for a string value after the first placeholder on the same line. 1. Both parameters must be user controlled. The prior behavior of the driver when operating in simple query mode would inline the negative value of the first parameter and cause the resulting line to be treated as a `--` SQL comment. That would extend to the beginning of the next parameter and cause the quoting of that parameter to be consumed by the comment line. If that string parameter includes a newline, the resulting text would appear unescaped in the resulting SQL. When operating in the default extended query mode this would not be an issue as the parameter values are sent separately to the server. Only in simple query mode the parameter values are inlined into the executed SQL causing this issue. # Example ```java PreparedStatement stmt = conn.prepareStatement("SELECT -?, ?"); stmt.setInt(1, -1); stmt.setString(2, "\nWHERE false --"); ResultSet rs = stmt.executeQuery(); ``` The resulting SQL when operating in simple query mode would be: ```sql SELECT --1,' WHERE false --' ``` The contents of the second parameter get injected into the command. Note how both the number of result columns and the WHERE clause of the command have changed. A more elaborate example could execute arbitrary other SQL commands. # Patch Problem will be patched upgrade to 42.7.2, 42.6.1, 42.5.5, 42.4.4, 42.3.9, 42.2.28, 42.2.28.jre7 The patch fixes the inlining of parameters by forcing them all to be serialized as wrapped literals. The SQL in the prior example would be transformed into: ```sql SELECT -('-1'::int4), (' WHERE false --') ``` # Workarounds Do not use the connection property`preferQueryMode=simple`. (*NOTE: If you do not explicitly specify a query mode then you are using the default of `extended` and are not impacted by this issue.*)
Status Published
Exploitability None
Weighted Severity None
Risk None
Affected and Fixed Packages Package Details
Weaknesses (1)
System Score Found at
cvssv3 9.8 https://access.redhat.com/hydra/rest/securitydata/cve/CVE-2024-1597.json
epss 0.0035 https://api.first.org/data/v1/epss?cve=CVE-2024-1597
cvssv3.1 9.8 https://ftp.suse.com/pub/projects/security/yaml/suse-cvss-scores.yaml
cvssv3.1_qr CRITICAL https://github.com/advisories/GHSA-24rp-q3w6-vc56
cvssv3.1 10.0 https://github.com/pgjdbc/pgjdbc
generic_textual CRITICAL https://github.com/pgjdbc/pgjdbc
cvssv3.1 10.0 https://github.com/pgjdbc/pgjdbc/commit/06abfb78a627277a580d4df825f210e96a4e14ee
generic_textual CRITICAL https://github.com/pgjdbc/pgjdbc/commit/06abfb78a627277a580d4df825f210e96a4e14ee
cvssv3.1 10.0 https://github.com/pgjdbc/pgjdbc/commit/93b0fcb2711d9c1e3a2a03134369738a02a58b40
generic_textual CRITICAL https://github.com/pgjdbc/pgjdbc/commit/93b0fcb2711d9c1e3a2a03134369738a02a58b40
cvssv3.1 10 https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-24rp-q3w6-vc56
cvssv3.1 10.0 https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-24rp-q3w6-vc56
cvssv3.1_qr CRITICAL https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-24rp-q3w6-vc56
generic_textual CRITICAL https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-24rp-q3w6-vc56
ssvc Track* https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-24rp-q3w6-vc56
cvssv3.1 10 https://lists.debian.org/debian-lts-announce/2024/05/msg00007.html
ssvc Track* https://lists.debian.org/debian-lts-announce/2024/05/msg00007.html
cvssv3.1 10 https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TZQTSMESZD2RJ5XBPSXH3TIQVUW5DIUU/
ssvc Track* https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TZQTSMESZD2RJ5XBPSXH3TIQVUW5DIUU/
cvssv3.1 10.0 https://nvd.nist.gov/vuln/detail/CVE-2024-1597
generic_textual CRITICAL https://nvd.nist.gov/vuln/detail/CVE-2024-1597
cvssv3.1 10 https://security.netapp.com/advisory/ntap-20240419-0008/
ssvc Track* https://security.netapp.com/advisory/ntap-20240419-0008/
cvssv3.1 10 https://www.enterprisedb.com/docs/jdbc_connector/latest/01_jdbc_rel_notes/
ssvc Track* https://www.enterprisedb.com/docs/jdbc_connector/latest/01_jdbc_rel_notes/
cvssv3.1 10 https://www.enterprisedb.com/docs/security/assessments/cve-2024-1597/
ssvc Track* https://www.enterprisedb.com/docs/security/assessments/cve-2024-1597/
cvssv3.1 10 http://www.openwall.com/lists/oss-security/2024/04/02/6
ssvc Track* http://www.openwall.com/lists/oss-security/2024/04/02/6
Reference id Reference type URL
https://access.redhat.com/hydra/rest/securitydata/cve/CVE-2024-1597.json
https://api.first.org/data/v1/epss?cve=CVE-2024-1597
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-1597
https://ftp.suse.com/pub/projects/security/yaml/suse-cvss-scores.yaml
https://github.com/pgjdbc/pgjdbc
https://github.com/pgjdbc/pgjdbc/commit/06abfb78a627277a580d4df825f210e96a4e14ee
https://github.com/pgjdbc/pgjdbc/commit/93b0fcb2711d9c1e3a2a03134369738a02a58b40
https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-24rp-q3w6-vc56
https://nvd.nist.gov/vuln/detail/CVE-2024-1597
01_jdbc_rel_notes https://www.enterprisedb.com/docs/jdbc_connector/latest/01_jdbc_rel_notes/
2266523 https://bugzilla.redhat.com/show_bug.cgi?id=2266523
cve-2024-1597 https://www.enterprisedb.com/docs/security/assessments/cve-2024-1597/
GHSA-24rp-q3w6-vc56 https://github.com/advisories/GHSA-24rp-q3w6-vc56
ntap-20240419-0008 https://security.netapp.com/advisory/ntap-20240419-0008/
RHSA-2024:1435 https://access.redhat.com/errata/RHSA-2024:1435
RHSA-2024:1436 https://access.redhat.com/errata/RHSA-2024:1436
RHSA-2024:1649 https://access.redhat.com/errata/RHSA-2024:1649
RHSA-2024:1686 https://access.redhat.com/errata/RHSA-2024:1686
RHSA-2024:1797 https://access.redhat.com/errata/RHSA-2024:1797
RHSA-2024:1999 https://access.redhat.com/errata/RHSA-2024:1999
RHSA-2024:2624 https://access.redhat.com/errata/RHSA-2024:2624
RHSA-2024:3313 https://access.redhat.com/errata/RHSA-2024:3313
RHSA-2024:4375 https://access.redhat.com/errata/RHSA-2024:4375
RHSA-2024:4402 https://access.redhat.com/errata/RHSA-2024:4402
RHSA-2024:5056 https://access.redhat.com/errata/RHSA-2024:5056
TZQTSMESZD2RJ5XBPSXH3TIQVUW5DIUU https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TZQTSMESZD2RJ5XBPSXH3TIQVUW5DIUU/
No exploits are available.
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Found at https://access.redhat.com/hydra/rest/securitydata/cve/CVE-2024-1597.json
Attack Vector (AV) Attack Complexity (AC) Privileges Required (PR) User Interaction (UI) Scope (S) Confidentiality Impact (C) Integrity Impact (I) Availability Impact (A)

network

adjacent_network

local

physical

low

high

none

low

high

none

required

unchanged

changed

high

low

none

high

low

none

high

low

none

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Found at https://ftp.suse.com/pub/projects/security/yaml/suse-cvss-scores.yaml
Attack Vector (AV) Attack Complexity (AC) Privileges Required (PR) User Interaction (UI) Scope (S) Confidentiality Impact (C) Integrity Impact (I) Availability Impact (A)

network

adjacent_network

local

physical

low

high

none

low

high

none

required

unchanged

changed

high

low

none

high

low

none

high

low

none

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H Found at https://github.com/pgjdbc/pgjdbc
Attack Vector (AV) Attack Complexity (AC) Privileges Required (PR) User Interaction (UI) Scope (S) Confidentiality Impact (C) Integrity Impact (I) Availability Impact (A)

network

adjacent_network

local

physical

low

high

none

low

high

none

required

unchanged

changed

high

low

none

high

low

none

high

low

none

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H Found at https://github.com/pgjdbc/pgjdbc/commit/06abfb78a627277a580d4df825f210e96a4e14ee
Attack Vector (AV) Attack Complexity (AC) Privileges Required (PR) User Interaction (UI) Scope (S) Confidentiality Impact (C) Integrity Impact (I) Availability Impact (A)

network

adjacent_network

local

physical

low

high

none

low

high

none

required

unchanged

changed

high

low

none

high

low

none

high

low

none

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H Found at https://github.com/pgjdbc/pgjdbc/commit/93b0fcb2711d9c1e3a2a03134369738a02a58b40
Attack Vector (AV) Attack Complexity (AC) Privileges Required (PR) User Interaction (UI) Scope (S) Confidentiality Impact (C) Integrity Impact (I) Availability Impact (A)

network

adjacent_network

local

physical

low

high

none

low

high

none

required

unchanged

changed

high

low

none

high

low

none

high

low

none

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H Found at https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-24rp-q3w6-vc56
Attack Vector (AV) Attack Complexity (AC) Privileges Required (PR) User Interaction (UI) Scope (S) Confidentiality Impact (C) Integrity Impact (I) Availability Impact (A)

network

adjacent_network

local

physical

low

high

none

low

high

none

required

unchanged

changed

high

low

none

high

low

none

high

low

none

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H Found at https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-24rp-q3w6-vc56
Attack Vector (AV) Attack Complexity (AC) Privileges Required (PR) User Interaction (UI) Scope (S) Confidentiality Impact (C) Integrity Impact (I) Availability Impact (A)

network

adjacent_network

local

physical

low

high

none

low

high

none

required

unchanged

changed

high

low

none

high

low

none

high

low

none


Vector: SSVCv2/E:P/A:Y/T:T/P:M/B:A/M:M/D:R/2024-04-10T04:00:36Z/ Found at https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-24rp-q3w6-vc56
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H Found at https://lists.debian.org/debian-lts-announce/2024/05/msg00007.html
Attack Vector (AV) Attack Complexity (AC) Privileges Required (PR) User Interaction (UI) Scope (S) Confidentiality Impact (C) Integrity Impact (I) Availability Impact (A)

network

adjacent_network

local

physical

low

high

none

low

high

none

required

unchanged

changed

high

low

none

high

low

none

high

low

none


Vector: SSVCv2/E:P/A:Y/T:T/P:M/B:A/M:M/D:R/2024-04-10T04:00:36Z/ Found at https://lists.debian.org/debian-lts-announce/2024/05/msg00007.html
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H Found at https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TZQTSMESZD2RJ5XBPSXH3TIQVUW5DIUU/
Attack Vector (AV) Attack Complexity (AC) Privileges Required (PR) User Interaction (UI) Scope (S) Confidentiality Impact (C) Integrity Impact (I) Availability Impact (A)

network

adjacent_network

local

physical

low

high

none

low

high

none

required

unchanged

changed

high

low

none

high

low

none

high

low

none


Vector: SSVCv2/E:P/A:Y/T:T/P:M/B:A/M:M/D:R/2024-04-10T04:00:36Z/ Found at https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TZQTSMESZD2RJ5XBPSXH3TIQVUW5DIUU/
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H Found at https://nvd.nist.gov/vuln/detail/CVE-2024-1597
Attack Vector (AV) Attack Complexity (AC) Privileges Required (PR) User Interaction (UI) Scope (S) Confidentiality Impact (C) Integrity Impact (I) Availability Impact (A)

network

adjacent_network

local

physical

low

high

none

low

high

none

required

unchanged

changed

high

low

none

high

low

none

high

low

none

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H Found at https://security.netapp.com/advisory/ntap-20240419-0008/
Attack Vector (AV) Attack Complexity (AC) Privileges Required (PR) User Interaction (UI) Scope (S) Confidentiality Impact (C) Integrity Impact (I) Availability Impact (A)

network

adjacent_network

local

physical

low

high

none

low

high

none

required

unchanged

changed

high

low

none

high

low

none

high

low

none


Vector: SSVCv2/E:P/A:Y/T:T/P:M/B:A/M:M/D:R/2024-04-10T04:00:36Z/ Found at https://security.netapp.com/advisory/ntap-20240419-0008/
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H Found at https://www.enterprisedb.com/docs/jdbc_connector/latest/01_jdbc_rel_notes/
Attack Vector (AV) Attack Complexity (AC) Privileges Required (PR) User Interaction (UI) Scope (S) Confidentiality Impact (C) Integrity Impact (I) Availability Impact (A)

network

adjacent_network

local

physical

low

high

none

low

high

none

required

unchanged

changed

high

low

none

high

low

none

high

low

none


Vector: SSVCv2/E:P/A:Y/T:T/P:M/B:A/M:M/D:R/2024-04-10T04:00:36Z/ Found at https://www.enterprisedb.com/docs/jdbc_connector/latest/01_jdbc_rel_notes/
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H Found at https://www.enterprisedb.com/docs/security/assessments/cve-2024-1597/
Attack Vector (AV) Attack Complexity (AC) Privileges Required (PR) User Interaction (UI) Scope (S) Confidentiality Impact (C) Integrity Impact (I) Availability Impact (A)

network

adjacent_network

local

physical

low

high

none

low

high

none

required

unchanged

changed

high

low

none

high

low

none

high

low

none


Vector: SSVCv2/E:P/A:Y/T:T/P:M/B:A/M:M/D:R/2024-04-10T04:00:36Z/ Found at https://www.enterprisedb.com/docs/security/assessments/cve-2024-1597/
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H Found at http://www.openwall.com/lists/oss-security/2024/04/02/6
Attack Vector (AV) Attack Complexity (AC) Privileges Required (PR) User Interaction (UI) Scope (S) Confidentiality Impact (C) Integrity Impact (I) Availability Impact (A)

network

adjacent_network

local

physical

low

high

none

low

high

none

required

unchanged

changed

high

low

none

high

low

none

high

low

none


Vector: SSVCv2/E:P/A:Y/T:T/P:M/B:A/M:M/D:R/2024-04-10T04:00:36Z/ Found at http://www.openwall.com/lists/oss-security/2024/04/02/6
Exploit Prediction Scoring System (EPSS)
Percentile 0.57713
EPSS Score 0.0035
Published At May 29, 2026, 12:55 p.m.
Date Actor Action Source VulnerableCode Version
2026-05-29T08:44:06.620821+00:00 GithubOSV Importer Import https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/02/GHSA-24rp-q3w6-vc56/GHSA-24rp-q3w6-vc56.json 38.6.0