CVE catalog

CVE-2022-31197

libpgjava: CVE-2022-31197

[CVE catalog]

Severity
High · CVSS 8.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
Published
Source
[NVD] · [CVE record]
EPSS
2.35% · Oct 25, 2026

PostgreSQL JDBC Driver (PgJDBC for short) allows Java programs to connect to a PostgreSQL database using standard, database independent Java code. The PGJDBC implementation of the `java.sql.ResultRow.refreshRow()` method is not performing escaping of column names so a malicious column name that contains a statement terminator, e.g. `;`, could lead to SQL injection. This could lead to executing additional SQL commands as the application's JDBC user. User applications that do not invoke the `ResultSet.refreshRow()` method are not impacted. User application that do invoke that method are impacted if the underlying database that they are querying via their JDBC application may be under the control of an attacker. The attack requires the attacker to trick the user into executing SQL against a table name who's column names would contain the malicious SQL and subsequently invoke the `refreshRow()` method on the ResultSet. Note that the application's JDBC user and the schema owner need not be the same. A JDBC application that executes as a privileged user querying database schemas owned by potentially malicious less-privileged users would be vulnerable. In that situation it may be possible for the malicious user to craft a schema that causes the application to execute commands as the privileged user. Patched versions will be released as `42.2.26` and `42.4.1`. Users are advised to upgrade. There are no known workarounds for this issue.

Vulnerable and fixed packages

Distribution-reported package versions and fixes. These do not depend on matching against the OpenFactory package catalog.

DistributionPackageReleaseVersionStatus
Debianlibpgjavasid42.7.14-1fixed
Debianlibpgjavaforky42.7.14-1fixed
Debianlibpgjavatrixie42.7.7-1fixed
Debianlibpgjavabookworm42.5.5-0+deb12u1fixed
Susepostgresql-jdbcmanager server module 4.242.2.25-150300.3.8.1fixed
Susepostgresql-jdbclinux enterprise module for server applications 15 sp342.2.25-150300.3.8.1fixed
Opensusepostgresql-jdbcleap 15.342.2.25-150300.3.8.1fixed
Susepostgresql-jdbcopenstack cloud 99.4-3.6.3fixed
Susepostgresql-jdbcopenstack cloud crowbar 99.4-3.6.3fixed
Susepostgresql-jdbclinux enterprise server for sap applications 12 sp49.4-3.6.3fixed
Susepostgresql-jdbclinux enterprise server 12 sp2-bcl9.4-3.6.3fixed
Susepostgresql-jdbclinux enterprise server 12 sp3-bcl9.4-3.6.3fixed
Susepostgresql-jdbclinux enterprise server 12 sp4-ltss9.4-3.6.3fixed
Susepostgresql-jdbclinux enterprise server 12 sp59.4-3.6.3fixed
Susepostgresql-jdbclinux enterprise server for sap applications 12 sp59.4-3.6.3fixed
Susepostgresql-jdbcmanager server module 4.142.2.10-150200.3.11.1fixed
Susepostgresql-jdbclinux enterprise module for server applications 15 sp442.2.25-150400.3.6.1fixed
Opensusepostgresql-jdbcleap 15.442.2.25-150400.3.6.1fixed

Fixed-version evidence

DistributionPackageTypeReleaseFixed versionUrgencyOriginBugs
Debianlibpgjavasourcesid42.4.1-1not yet assignedNot reported[1016662]
Debianlibpgjavasourceforky42.4.1-1not yet assignedNot reported[1016662]
Debianlibpgjavasourcetrixie42.4.1-1not yet assignedNot reported[1016662]
Debianlibpgjavasourcebookworm42.4.1-1not yet assignedNot reported[1016662]
Susepostgresql-jdbcrpmmanager server module 4.242.2.25-150300.3.8.1Not reportedSUSE-SU-2022:3613-1Not reported
Susepostgresql-jdbcrpmlinux enterprise module for server applications 15 sp342.2.25-150300.3.8.1Not reportedSUSE-SU-2022:3613-1Not reported
Opensusepostgresql-jdbcrpmleap 15.342.2.25-150300.3.8.1Not reportedSUSE-SU-2022:3613-1Not reported
Susepostgresql-jdbcrpmopenstack cloud 99.4-3.6.3Not reportedSUSE-SU-2022:3541-1Not reported
Susepostgresql-jdbcrpmopenstack cloud crowbar 99.4-3.6.3Not reportedSUSE-SU-2022:3541-1Not reported
Susepostgresql-jdbcrpmlinux enterprise server for sap applications 12 sp49.4-3.6.3Not reportedSUSE-SU-2022:3541-1Not reported
Susepostgresql-jdbcrpmlinux enterprise server 12 sp2-bcl9.4-3.6.3Not reportedSUSE-SU-2022:3541-1Not reported
Susepostgresql-jdbcrpmlinux enterprise server 12 sp3-bcl9.4-3.6.3Not reportedSUSE-SU-2022:3541-1Not reported
Susepostgresql-jdbcrpmlinux enterprise server 12 sp4-ltss9.4-3.6.3Not reportedSUSE-SU-2022:3541-1Not reported
Susepostgresql-jdbcrpmlinux enterprise server 12 sp59.4-3.6.3Not reportedSUSE-SU-2022:3541-1Not reported
Susepostgresql-jdbcrpmlinux enterprise server for sap applications 12 sp59.4-3.6.3Not reportedSUSE-SU-2022:3541-1Not reported
Susepostgresql-jdbcrpmmanager server module 4.142.2.10-150200.3.11.1Not reportedSUSE-SU-2022:3705-1Not reported
Susepostgresql-jdbcrpmlinux enterprise module for server applications 15 sp442.2.25-150400.3.6.1Not reportedSUSE-SU-2022:3537-1Not reported
Opensusepostgresql-jdbcrpmleap 15.442.2.25-150400.3.6.1Not reportedSUSE-SU-2022:3537-1Not reported

[Debian bug #1016662]

OpenFactory catalog packages

[Debian 12 (Bookworm)]

  • Source package: [libpgjava]

    Details (2)
    • 42.5.5-0+deb12u1 · all · bookworm

      Fixed · Fixed: 42.4.1-1

      dsa · libpgjava · debian · bookworm

    • 42.5.5-0+deb12u1 · all · bookworm

      Fixed · Fixed: 42.4.1-1

      dsa · libpgjava · debian · bookworm

  • Source package: [libpgjava]

    Details (2)
    • 42.5.5-0+deb12u1 · all · bookworm

      Fixed · Fixed: 42.4.1-1

      dsa · libpgjava · debian · bookworm

    • 42.5.5-0+deb12u1 · all · bookworm

      Fixed · Fixed: 42.4.1-1

      dsa · libpgjava · debian · bookworm

Observed:

References