PT-2022-4318

CVE-2022-31197

·

Published

2022-08-03

·

Updated

2026-12-03

Description by

CVSS 3.1
8.0
High
MetricsAV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
Name of the Vulnerable Software and Affected Versions PostgreSQL JDBC Driver versions prior to 42.2.26 PostgreSQL JDBC Driver versions prior to 42.4.1
Description The PGJDBC implementation of the java.sql.ResultRow.refreshRow() method is not performing escaping of column names, allowing a malicious column name that contains a statement terminator, e.g. ;, to 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 applications 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 whose column names would contain the malicious SQL and subsequently invoke the refreshRow() method on the ResultSet.
Recommendations For versions prior to 42.2.26, upgrade to version 42.2.26 or later. For versions prior to 42.4.1, upgrade to version 42.4.1 or later. As a temporary workaround, consider not using the ResultSet.refreshRow() method. If the ResultSet.refreshRow() method is used, ensure that the code that executes that method does not connect to a database that is controlled by an unauthenticated or malicious user.
Exploitability
Exploit
Fix
Impacts
Vendors
Affected products
Related identifiers
GHSA-R38F-C4H4-HQQ2
ALSA-2023:0318
ALSA-2023_0318
ALT-PU-2023-8458
ALT-PU-2023-8462
ALT-PU-2024-16562
BIT-POSTGRESQL-JDBC-DRIVER-2022-31197
CLEANSTART-2024-BR64621
CLEANSTART-2026-IG03910
DLA-3140-1
DLA-3995-1
OESA-2022-1835
OPENSUSE-SU-2022_3537-1
OPENSUSE-SU-2022_3613-1
OPENSUSE-SU-2024:12369-1
RHLW-2026-B44D1F7DAC7A0D3D
RHSA-2023:0318
RHSA-2023_0318
RLSA-2023:0318
SUSE-SU-2022:3537-1
SUSE-SU-2022_3537-1
SUSE-SU-2022:3541-1
SUSE-SU-2022_3541-1
SUSE-SU-2022:3613-1
SUSE-SU-2022_3613-1
SUSE-SU-2022:3705-1
USN-9491-1
Found an issue in the description? Have something to add? Feel free to write us 👾