Search CVEs and advisories

Search CVEs and Linux security advisories by vendor, product, package, or severity, and see which vulnerabilities each advisory addresses.

CVE

CVE-2022-31197

published high CVSS 3.1 · 7.1

SQL Injection in ResultSet.refreshRow() with malicious column names in pgjdbc

Published
03 Aug 2022, 00:00:00 UTC
Updated
03 Nov 2025, 21:46:18 UTC
Language
en

Package status and fixes

Distro / vendorReleasePackage / productPublisher statusFixed buildSource
pgjdbc — pgjdbc>= 42.2.0, < 42.2.26 · >= 42.3.0, < 42.4.1 Affected Not stated GitHub_M
AlmaLinux 9 postgresql-jdbc Advisory build 42.2.18-6.el9_1 ALSA-2023:0318
Alpine Linux edge java-postgresql-jdbc Fixed 42.4.2-r0 Package fix record
Debian bullseye libpgjava Advisory build 42.2.15-1+deb11u2 DLA-3995-1
Oracle Linux 9 postgresql-jdbcaarch64 Advisory build 0:42.2.18-6.el9_1 ELSA-2023-0318
Red Hat Enterprise Linux RHEL-9 postgresql-jdbcnoarch Advisory build 42.2.18-6.el9_1 RHSA-2023:0318
SUSE / openSUSE SLE-12-SP2 postgresql-jdbcnoarch Advisory build 9.4-3.6.3 SUSE-SU-2022:3541-1
Rocky Linux 9 postgresql-jdbcnoarch Listed in advisory Not stated RLSA-2023:0318
Show 30 more entries
Distro / vendorReleasePackage / productPublisher statusFixed buildSource
Alpine Linux v3.16 java-postgresql-jdbc Fixed 42.4.2-r0 Package fix record
Alpine Linux v3.17 java-postgresql-jdbc Fixed 42.4.2-r0 Package fix record
Alpine Linux v3.18 java-postgresql-jdbc Fixed 42.4.2-r0 Package fix record
Alpine Linux v3.19 java-postgresql-jdbc Fixed 42.4.2-r0 Package fix record
Alpine Linux v3.20 java-postgresql-jdbc Fixed 42.4.2-r0 Package fix record
Alpine Linux v3.21 java-postgresql-jdbc Fixed 42.4.2-r0 Package fix record
Alpine Linux v3.22 java-postgresql-jdbc Fixed 42.4.2-r0 Package fix record
Alpine Linux v3.23 java-postgresql-jdbc Fixed 42.4.2-r0 Package fix record
Alpine Linux v3.24 java-postgresql-jdbc Fixed 42.4.2-r0 Package fix record
Debian buster libpgjava Advisory build 42.2.5-2+deb10u2 DLA-3140-1
Oracle Linux 9 postgresql-jdbcx86_64 Advisory build 0:42.2.18-6.el9_1 ELSA-2023-0318
Red Hat Enterprise Linux RHEL-9 postgresql-jdbcsrc Advisory build 42.2.18-6.el9_1 RHSA-2023:0318
SUSE / openSUSE SLE-12-SP3 postgresql-jdbcnoarch Advisory build 9.4-3.6.3 SUSE-SU-2022:3541-1
SUSE / openSUSE SLE-12-SP4 postgresql-jdbcnoarch Advisory build 9.4-3.6.3 SUSE-SU-2022:3541-1
SUSE / openSUSE SLE-12-SP5 postgresql-jdbcnoarch Advisory build 9.4-3.6.3 SUSE-SU-2022:3541-1
SUSE / openSUSE SLE-15-SP3 postgresql-jdbcnoarch Advisory build 42.2.25-150300.3.8.1 SUSE-SU-2022:3613-1
SUSE / openSUSE SLE-15-SP4 postgresql-jdbcnoarch Advisory build 42.2.25-150400.3.6.1 SUSE-SU-2022:3537-1
SUSE / openSUSE openSUSE-Leap-15.3 postgresql-jdbcnoarch Advisory build 42.2.25-150300.3.8.1 SUSE-SU-2022:3613-1
SUSE / openSUSE openSUSE-Leap-15.3 postgresql-jdbc-javadocnoarch Advisory build 42.2.25-150300.3.8.1 SUSE-SU-2022:3613-1
SUSE / openSUSE openSUSE-Leap-15.4 postgresql-jdbcnoarch Advisory build 42.2.25-150400.3.6.1 SUSE-SU-2022:3537-1
SUSE / openSUSE openSUSE-Leap-15.4 postgresql-jdbc-javadocnoarch Advisory build 42.2.25-150400.3.6.1 SUSE-SU-2022:3537-1
SUSE / openSUSE openSUSE-Tumbleweed postgresql-jdbcaarch64 Advisory build 42.2.25-3.1 OPENSUSE-SU-2024:12369-1
SUSE / openSUSE openSUSE-Tumbleweed postgresql-jdbcppc64le Advisory build 42.2.25-3.1 OPENSUSE-SU-2024:12369-1
SUSE / openSUSE openSUSE-Tumbleweed postgresql-jdbcs390x Advisory build 42.2.25-3.1 OPENSUSE-SU-2024:12369-1
SUSE / openSUSE openSUSE-Tumbleweed postgresql-jdbcx86_64 Advisory build 42.2.25-3.1 OPENSUSE-SU-2024:12369-1
SUSE / openSUSE openSUSE-Tumbleweed postgresql-jdbc-javadocaarch64 Advisory build 42.2.25-3.1 OPENSUSE-SU-2024:12369-1
SUSE / openSUSE openSUSE-Tumbleweed postgresql-jdbc-javadocppc64le Advisory build 42.2.25-3.1 OPENSUSE-SU-2024:12369-1
SUSE / openSUSE openSUSE-Tumbleweed postgresql-jdbc-javadocs390x Advisory build 42.2.25-3.1 OPENSUSE-SU-2024:12369-1
SUSE / openSUSE openSUSE-Tumbleweed postgresql-jdbc-javadocx86_64 Advisory build 42.2.25-3.1 OPENSUSE-SU-2024:12369-1
Rocky Linux 9 postgresql-jdbcsrc Listed in advisory Not stated RLSA-2023:0318

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.

en · GitHub_M · cna

Vendor advisories explicitly linked to this CVE.

25

Assessment

CVSS risk assessment and additional context for this vulnerability.

CVSS version
3.1
Base score
7.1 / 10
Severity
high
Provider
GitHub_M · cna
Vector string
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H

Publisher product statements

Version ranges and default statuses as reported by each provider.

Affected vendor and product assertions
VendorProductVersion statusSource
pgjdbc pgjdbc >= 42.2.0, < 42.2.26 (affected)>= 42.3.0, < 42.4.1 (affected) GitHub_M · cna

Weaknesses

1
  • CWE-89 CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (GitHub_M · cna)

References

6

Provider assertions

3

GitHub_M · cna

SQL Injection in ResultSet.refreshRow() with malicious column names in pgjdbc

CISA-ADP · adp

CISA ADP Vulnrichment

CVE · adp

CVE Program Container

Provenance

Schema
5.2
Searchable
yes
Content hash
ba8738a66a43c6238da9057d7a0ed0a5a6737e4b2b6373a42ecac27aa7a0a690
Ingested
23 Sep 2026, 08:00:25 UTC
Source record
Official CVE record

Search filters

Match options apply to free text. CVE words match tokens; use contains:"…" for literal substrings.

Text

Words and phrases
buffer overflow "remote code execution"
Word prefix
auth*
Literal substring (title or description)
contains:"use-after-free"
Exclude a term or filter
-test -vendor:example

Affected product

Vendor
vendor:Example
Product
product:"Demo Widget"

Severity and score

Severity · none, low, medium, high, critical, unknown
severity:critical
CWE identifier
cwe:CWE-863
CVSS score (0–10)
cvss:>=7.0

Dates and status

Published date · comparisons, relative days
published:>=2026-01-01
Updated date · comparisons, relative days
updated:<30d
Status · published (default), rejected, unknown
status:rejected