
CVE catalog
CVE-2022-31197
libpgjava: CVE-2022-31197
- Severity
- High · CVSS 8.1
CVSS: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.
| Distribution | Package | Release | Version | Status |
|---|---|---|---|---|
| Debian | libpgjava | sid | 42.7.14-1 | fixed |
| Debian | libpgjava | forky | 42.7.14-1 | fixed |
| Debian | libpgjava | trixie | 42.7.7-1 | fixed |
| Debian | libpgjava | bookworm | 42.5.5-0+deb12u1 | fixed |
| Suse | postgresql-jdbc | manager server module 4.2 | 42.2.25-150300.3.8.1 | fixed |
| Suse | postgresql-jdbc | linux enterprise module for server applications 15 sp3 | 42.2.25-150300.3.8.1 | fixed |
| Opensuse | postgresql-jdbc | leap 15.3 | 42.2.25-150300.3.8.1 | fixed |
| Suse | postgresql-jdbc | openstack cloud 9 | 9.4-3.6.3 | fixed |
| Suse | postgresql-jdbc | openstack cloud crowbar 9 | 9.4-3.6.3 | fixed |
| Suse | postgresql-jdbc | linux enterprise server for sap applications 12 sp4 | 9.4-3.6.3 | fixed |
| Suse | postgresql-jdbc | linux enterprise server 12 sp2-bcl | 9.4-3.6.3 | fixed |
| Suse | postgresql-jdbc | linux enterprise server 12 sp3-bcl | 9.4-3.6.3 | fixed |
| Suse | postgresql-jdbc | linux enterprise server 12 sp4-ltss | 9.4-3.6.3 | fixed |
| Suse | postgresql-jdbc | linux enterprise server 12 sp5 | 9.4-3.6.3 | fixed |
| Suse | postgresql-jdbc | linux enterprise server for sap applications 12 sp5 | 9.4-3.6.3 | fixed |
| Suse | postgresql-jdbc | manager server module 4.1 | 42.2.10-150200.3.11.1 | fixed |
| Suse | postgresql-jdbc | linux enterprise module for server applications 15 sp4 | 42.2.25-150400.3.6.1 | fixed |
| Opensuse | postgresql-jdbc | leap 15.4 | 42.2.25-150400.3.6.1 | fixed |
Fixed-version evidence
| Distribution | Package | Type | Release | Fixed version | Urgency | Origin | Bugs |
|---|---|---|---|---|---|---|---|
| Debian | libpgjava | source | sid | 42.4.1-1 | not yet assigned | Not reported | [1016662] |
| Debian | libpgjava | source | forky | 42.4.1-1 | not yet assigned | Not reported | [1016662] |
| Debian | libpgjava | source | trixie | 42.4.1-1 | not yet assigned | Not reported | [1016662] |
| Debian | libpgjava | source | bookworm | 42.4.1-1 | not yet assigned | Not reported | [1016662] |
| Suse | postgresql-jdbc | rpm | manager server module 4.2 | 42.2.25-150300.3.8.1 | Not reported | SUSE-SU-2022:3613-1 | Not reported |
| Suse | postgresql-jdbc | rpm | linux enterprise module for server applications 15 sp3 | 42.2.25-150300.3.8.1 | Not reported | SUSE-SU-2022:3613-1 | Not reported |
| Opensuse | postgresql-jdbc | rpm | leap 15.3 | 42.2.25-150300.3.8.1 | Not reported | SUSE-SU-2022:3613-1 | Not reported |
| Suse | postgresql-jdbc | rpm | openstack cloud 9 | 9.4-3.6.3 | Not reported | SUSE-SU-2022:3541-1 | Not reported |
| Suse | postgresql-jdbc | rpm | openstack cloud crowbar 9 | 9.4-3.6.3 | Not reported | SUSE-SU-2022:3541-1 | Not reported |
| Suse | postgresql-jdbc | rpm | linux enterprise server for sap applications 12 sp4 | 9.4-3.6.3 | Not reported | SUSE-SU-2022:3541-1 | Not reported |
| Suse | postgresql-jdbc | rpm | linux enterprise server 12 sp2-bcl | 9.4-3.6.3 | Not reported | SUSE-SU-2022:3541-1 | Not reported |
| Suse | postgresql-jdbc | rpm | linux enterprise server 12 sp3-bcl | 9.4-3.6.3 | Not reported | SUSE-SU-2022:3541-1 | Not reported |
| Suse | postgresql-jdbc | rpm | linux enterprise server 12 sp4-ltss | 9.4-3.6.3 | Not reported | SUSE-SU-2022:3541-1 | Not reported |
| Suse | postgresql-jdbc | rpm | linux enterprise server 12 sp5 | 9.4-3.6.3 | Not reported | SUSE-SU-2022:3541-1 | Not reported |
| Suse | postgresql-jdbc | rpm | linux enterprise server for sap applications 12 sp5 | 9.4-3.6.3 | Not reported | SUSE-SU-2022:3541-1 | Not reported |
| Suse | postgresql-jdbc | rpm | manager server module 4.1 | 42.2.10-150200.3.11.1 | Not reported | SUSE-SU-2022:3705-1 | Not reported |
| Suse | postgresql-jdbc | rpm | linux enterprise module for server applications 15 sp4 | 42.2.25-150400.3.6.1 | Not reported | SUSE-SU-2022:3537-1 | Not reported |
| Opensuse | postgresql-jdbc | rpm | leap 15.4 | 42.2.25-150400.3.6.1 | Not reported | SUSE-SU-2022:3537-1 | Not reported |
OpenFactory catalog packages
[Debian 12 (Bookworm)]
- [libpostgresql-jdbc-java]Fixed
Source package: [libpgjava]
Details (2)
42.5.5-0+deb12u1· all · bookwormFixed · Fixed:
42.4.1-1dsa · libpgjava · debian · bookworm
42.5.5-0+deb12u1· all · bookwormFixed · Fixed:
42.4.1-1dsa · libpgjava · debian · bookworm
- [libpostgresql-jdbc-java-doc]Fixed
Source package: [libpgjava]
Details (2)
42.5.5-0+deb12u1· all · bookwormFixed · Fixed:
42.4.1-1dsa · libpgjava · debian · bookworm
42.5.5-0+deb12u1· all · bookwormFixed · Fixed:
42.4.1-1dsa · libpgjava · debian · bookworm
Observed:
References
- [https://ftp.suse.com/pub/projects/security/csaf/suse-su-2022_3537-1.json]
- [https://osv.dev/vulnerability/DLA-3140-1]
- [https://osv.dev/vulnerability/DLA-3995-1]
- [https://osv.dev/vulnerability/SUSE-SU-2022:3537-1]
- [https://osv.dev/vulnerability/SUSE-SU-2022:3541-1]
- [https://osv.dev/vulnerability/SUSE-SU-2022:3613-1]
- [https://osv.dev/vulnerability/SUSE-SU-2022:3705-1]
- [https://security-tracker.debian.org/tracker/CVE-2022-31197]
- [https://security.access.redhat.com/data/csaf/v2/vex/2022/cve-2022-31197.json]
- [https://wid.cert-bund.de/.well-known/csaf/white/2023/wid-sec-w-2023-1807.json]
[CERT-Bund public advisories] · [Debian Security Tracker] · [FIRST EPSS] · [OSV Package Vulnerability Database] · [Red Hat security advisories and VEX] · [SUSE security advisories and VEX]