ADVISORIES

Vulnerability

CVE-2022-31197

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.

69 advisories report this vulnerability, across 13 ecosystems.

Advisories

  • ALPINE-CVE-2022-31197

    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()`…

    CVE-2022-31197 Alpine Updated 20 November 2026
  • ALPINE-EDGE-CVE-2022-31197
    CVE-2022-31197 Alpine Updated 18 November 2026
  • ALSA-2023:0318

    Moderate: postgresql-jdbc security update

    CVE-2022-31197 AlmaLinux Updated 29 October 2026
  • CGA-35fq-3q9x-2xgr
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-3766-6329-r925
    CVE-2022-31197 Chainguard Updated 5 November 2026
  • CGA-397g-95r7-c8vf
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-3j2j-rv6v-g8hc
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-3vfp-c8pq-98p3
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-4495-r7v3-h8w4
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-4crq-8v3w-g2j7
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-65xj-cvxw-f25w
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-69xg-vgxq-vf74
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-6g8m-2xvf-gc4m
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-72m9-c3h9-rf7q
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-7qc9-pgmh-p35r
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-89ff-pjm5-c2c3
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-89pg-x4qp-hr64
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-8wg4-h7jg-pxq4
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-9j3w-cfr5-px8p
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-c2gf-gx26-g2cv
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-cxmw-7x96-wmwc
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-f794-g8q2-xhhh
    CVE-2022-31197 Chainguard Updated 5 November 2026
  • CGA-fccr-3435-qv72
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-fg4h-hf65-9phv
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-fqm5-f9mh-mgcg
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-fqv6-m5xf-9wf3
    CVE-2022-31197 Chainguard Updated 28 January 2026
  • CGA-fwrj-xww7-9cr7
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-fxxj-v2vr-ww4p
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-g6g6-g572-692w
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-hcm4-fgpc-rxhf
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-j7j2-p77w-cfq5
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-jq9q-9rgp-cjjf
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-m46m-p6m9-fqfj
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-m6fg-fvx3-w64q
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-m9wc-cvv3-2wr6
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-mqm2-qhj2-q27q
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-mwxq-86vf-h79h
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-mxxw-9hq8-gqq2
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-p45w-hp7r-g2rg
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-prx8-hm2q-gjvc
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-q3g9-5w84-xj4v
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-qch5-3rw3-xjq6
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-qh73-p2g4-4g2m
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-v7hr-qpg9-6m9r
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-vh92-j834-f49h
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-vmv6-9c94-f2f9
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-wfm2-v7mx-vgh6
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-wjj7-9wvq-98hp
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-wp8x-8h78-xcwq
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-wwx3-m3wf-hjh4
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-wx49-pr69-mg24
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-xgpx-hcw5-grjj
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-xj3j-rrm7-8mv4
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • CGA-xmqc-xp64-32vj
    CVE-2022-31197 ChainguardWolfi Updated 5 November 2026
  • DEBIAN-CVE-2022-31197

    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()`…

    CVE-2022-31197 Debian Updated 20 November 2026
  • DLA-3140-1

    libpgjava - security update

    CVE-2022-31197 Debian Updated 20 November 2026
  • DLA-3995-1

    libpgjava - security update

    CVE-2022-31197CVE-2022-41946CVE-2024-1597 Debian Updated 20 November 2026
  • ELSA-2023-0318

    ELSA-2023-0318: postgresql-jdbc security update (MODERATE)

    Moderate CVE-2022-31197 Oracle Linux Updated 24 January 2023
  • GHSA-r38f-c4h4-hqq2

    PostgreSQL JDBC Driver SQL Injection in ResultSet.refreshRow() with malicious column names

    High CVE-2022-31197 Maven Updated 10 September 2026
  • OESA-2022-1835

    postgresql-jdbc security update

    High CVE-2022-31197 openEuler Updated 18 August 2026
  • RHSA-2023:0318

    Red Hat Security Advisory: postgresql-jdbc security update

    CVE-2022-31197 Red Hat Updated 24 November 2026
  • RHVEX-CVE-2022-31197

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

    Moderate CVE-2022-31197 Red Hat Updated 23 November 2026
  • RLSA-2023:0318

    Moderate: postgresql-jdbc security update

    CVE-2022-31197 Rocky Linux Updated 4 February 2026
  • SUSE-SU-2022:3537-1

    Security update for postgresql-jdbc

    CVE-2022-31197 SUSEopenSUSE Updated 4 February 2026
  • SUSE-SU-2022:3541-1

    Security update for postgresql-jdbc

    CVE-2022-31197 SUSE Updated 4 February 2026
  • SUSE-SU-2022:3613-1

    Security update for postgresql-jdbc

    CVE-2022-31197 SUSEopenSUSE Updated 4 February 2026
  • SUSE-SU-2022:3705-1

    Security update for postgresql-jdbc

    CVE-2022-31197 SUSE Updated 4 February 2026
  • SUSEVEX-CVE-2022-31197

    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()`…

    Important CVE-2022-31197 SUSE Updated 16 October 2026
  • UBUNTU-CVE-2022-31197

    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()`…

    CVE-2022-31197 Ubuntu Updated 17 October 2026

References