Search covers the description text, product and vendor names and weakness types (also partial words).

CVE-2022-31197
postgresql postgresql jdbc driver

Score8 High
CVSS 3.1
Exploit probability (EPSS)2.2%
within the next 30 days
CategorySQL & query injection
Published3 August 2022
Last modified: 17 June 2026

In short

This vulnerability can be exploited remotely over the network, with a regular user account, if a user clicks a link, opens a file or similar.

A successful attack has high impact: reading confidential data, modifying data, crashing the system or making it unavailable.

Weakness type: SQL injection.

✨ AI commentary

After a short ad, a plain-language commentary on this vulnerability is shown. AI can make mistakes; base decisions on the official sources.

Official description

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.

CVSS: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H

Weakness: CWE-89 – SQL injection

Affected products

VendorProductVersions
postgresqlpostgresql jdbc driver<42.2.26
postgresqlpostgresql jdbc driver>=42.3.0 <42.3.7
postgresqlpostgresql jdbc driver42.4.0
postgresqlpostgresql jdbc driver42.4.1
debiandebian linux10.0
fedoraprojectfedora35
fedoraprojectfedora36

Sources

Latest in the same category

  • CVE-2026-137097 Not scored
    Net::WoRMS versions before 1.901 for Perl allow SQL injection via SOAP response fields in the SQL output of printRecord. Net::WoRMS is a tool for querying the World Register of Marine Species (WoRMS). The SQL output…
    SQL & query injection · 30 November 2026
  • CVE-2026-139990 High 8.7
    GLPI 11.0.0 before 11.0.9 contains an unauthenticated sql injection vulnerability in the planning availability check via the begin and end parameters. Attackers can send genical and checkavailability parameters to…
    SQL & query injection · 30 November 2026
  • CVE-2023-54424 High 8.7
    JIESHUN JieLink+ Intelligent Terminal Operation Platform contains a SQL injection vulnerability that allows unauthenticated attackers to execute arbitrary SQL queries through the deviceId parameter of the…
    SQL & query injection · 30 November 2026
  • CVE-2026-120705 High 8.6KEV
    GeoServer is an open source server that allows users to share and edit geospatial data. Prior to "org.geoserver:gs-wfs-core" versions 2.27.7, 2.28.6, and 3.0.2 and prior to "org.geotools:gt-metadata" versions 33.7,…
    osgeo geoserver · SQL & query injection · 30 November 2026
  • CVE-2026-139882 High 7.1
    OS4ED openSIS Classic through 9.3 contains an sql injection vulnerability in api/StudentEnrollmentInfo.php and api/StaffInfo.php via the unquoted sch_year parameter. Attackers holding any valid API key and secret can…
    SQL & query injection · 30 November 2026
  • CVE-2026-139877 Critical 9.1
    mysql2 before 3.25.0 contains an sql injection vulnerability in Connection.format() and Connection.escape() because quotes are always backslash-escaped regardless of session SQL mode. When NO_BACKSLASH_ESCAPES is…
    SQL & query injection · 30 November 2026