BlackTreeCVE Intelligence
← Back to the CVE catalogue
Full vulnerability report · 2022
CVE-2022-31197High confidence

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

pgjdbc · pgjdbc

Official source article: GitHub GHSA-R38F-C4H4-HQQ2 ↗. Check the applicable product and release in the original source.

7.1HighCVSS 3.1
Recommended action
Within 7 days

High technical severity with public exploit material referenced by a structured source; prioritise exposed affected systems while verifying vendor guidance.

Patch available
R
Operational reassessment

Published severity in operational context

Open reassessment dashboard →
Published severityHighOperational priority:Critical, raised one band.upgradedsince 3 Nov 2025

Evidence used

  • No CISA KEV confirmation is currently recorded.
  • A structured source references public exploit or proof-of-concept material.
  • EPSS is 2.23% for the current model date.

Compensating controls

  • Validate the affected product branch and deploy the verified fixed release.
  • Restrict the affected network interface to trusted sources where business-safe.
  • Increase monitoring for the attack path and post-exploitation behaviour described in the report.

Verification

  1. Confirm that the asset runs pgjdbc pgjdbc and falls inside the recorded affected range.
  2. Verify the installed build against the product-specific fixed version after deployment.
  3. Validate exposure, authentication requirements and compensating controls in the actual environment.
  4. Reopen this reassessment when CVSS, KEV, EPSS, exploit evidence or remediation changes.
Mitigation target: Within 3 daysRemediation target: Within 90 days

This automated reassessment organises public evidence. It does not know asset exposure, business impact or control effectiveness and does not replace CVSS or a human risk decision.

Distribution package intelligence

Release-specific package status

Alpine, Debian, ubuntu findings are scoped to the named distribution, release and source package. An absent finding does not mean a package is unaffected.

8 package states
Repository candidate not checked

A published vendor fix does not prove that a matching update is enabled and installable on a particular asset. Confirm the local package candidate before scheduling remediation.

Distribution releaseSource packageVendor stateFixed versionEvidence
Alpine v3.23v3.23 · communityjava-postgresql-jdbcVendor fix publishedAlpine records a security fix at this version. An absent entry does not mean the package is unaffected.42.4.2-r0Alpine Security Database ↗Source updated 11 Sep 2026
Alpine v3.22v3.22 · communityjava-postgresql-jdbcVendor fix publishedAlpine records a security fix at this version. An absent entry does not mean the package is unaffected.42.4.2-r0Alpine Security Database ↗Source updated 11 Sep 2026
Alpine v3.21v3.21 · communityjava-postgresql-jdbcVendor fix publishedAlpine records a security fix at this version. An absent entry does not mean the package is unaffected.42.4.2-r0Alpine Security Database ↗Source updated 19 Aug 2026
Debian trixietrixie · sourcelibpgjavaVendor fix publishedDebian records a fixed source-package version for this release.42.4.1-1Debian Security Tracker ↗Source updated 6 Oct 2026
Debian bookwormbookworm · sourcelibpgjavaVendor fix publishedDebian records a fixed source-package version for this release.42.4.1-1Debian Security Tracker ↗Source updated 6 Oct 2026
Debian forkyforky · sourcelibpgjavaVendor fix publishedDebian records a fixed source-package version for this release.42.4.1-1Debian Security Tracker ↗Source updated 6 Oct 2026
Debian sidsid · sourcelibpgjavaVendor fix publishedDebian records a fixed source-package version for this release.42.4.1-1Debian Security Tracker ↗Source updated 6 Oct 2026
Ubuntu 24.04 LTSnoble · standard archivelibpgjavaUnder evaluationCanonical reports that the package might be affected and still needs evaluation or fixing.Not published in this feedCanonical Ubuntu Security ↗Source updated 5 Oct 2026
Open-source package ranges6 source-attributed ranges

These OSV and GitHub advisory ranges apply only to the named package and ecosystem. A listed fixed version is not a universal product patch or proof that an update is installed.

Ecosystem and packageAffected rangeFirst fixed versionEvidence
Mavenorg.postgresql:postgresqlECOSYSTEM: introduced 0; fixed 42.2.2642.2.26OSV record ↗aggregator derived · 10 Sep 2026
Mavenorg.postgresql:postgresqlECOSYSTEM: introduced 42.4.0; fixed 42.4.142.4.1OSV record ↗aggregator derived · 10 Sep 2026
Mavenorg.postgresql:postgresqlECOSYSTEM: introduced 42.3.0; fixed 42.3.742.3.7OSV record ↗aggregator derived · 10 Sep 2026
mavenorg.postgresql:postgresql< 42.2.2642.2.26GitHub advisory ↗upstream repository advisory · 4 Nov 2025
mavenorg.postgresql:postgresql>= 42.4.0, < 42.4.142.4.1GitHub advisory ↗upstream repository advisory · 4 Nov 2025
mavenorg.postgresql:postgresql>= 42.3.0, < 42.3.742.3.7GitHub advisory ↗upstream repository advisory · 4 Nov 2025
Direct vendor intelligence

Authoritative vendor CSAF and VEX advisories

Structured product status and remediation from the issuing vendor. Product-state explanations are always visible; large lists can be searched or downloaded.

1 current
CVE-2022-31197 · CSAF 2.0 · revision 3 · finalRed Hat Product Securitypostgresql: SQL Injection in ResultSet.refreshRow() with malicious column names
180 known affected

The vendor explicitly identifies these products as affected by this CVE.

  • quarkus-jdbc-postgresql-deployment as a component of Red Hat build of Apicurio Registry 2
  • jdbc-postgresql as a component of Red Hat Decision Manager 7
  • autocorr-af (libreoffice:flatpak) as a component of Red Hat Enterprise Linux 8
  • autocorr-bg (libreoffice:flatpak) as a component of Red Hat Enterprise Linux 8
  • autocorr-ca (libreoffice:flatpak) as a component of Red Hat Enterprise Linux 8
  • autocorr-cs (libreoffice:flatpak) as a component of Red Hat Enterprise Linux 8
  • autocorr-da (libreoffice:flatpak) as a component of Red Hat Enterprise Linux 8
  • autocorr-de (libreoffice:flatpak) as a component of Red Hat Enterprise Linux 8
  • autocorr-en (libreoffice:flatpak) as a component of Red Hat Enterprise Linux 8
  • autocorr-es (libreoffice:flatpak) as a component of Red Hat Enterprise Linux 8
  • autocorr-fa (libreoffice:flatpak) as a component of Red Hat Enterprise Linux 8
  • autocorr-fi (libreoffice:flatpak) as a component of Red Hat Enterprise Linux 8
Summary
A flaw was found in PostgresQL. This flaw allows an attacker to benefit from a miss escaping character and leads to a SQL injection attack due to Java.sql.ResultRow.refreshRow() implementation from PGSQL.
Remediation
For details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258 If the postgresql service is running, it will be automatically restarted after installing this update.
Optional official sources

National CERT insights
?CERT means Computer Emergency Response Team; CSIRT is the closely related term Computer Security Incident Response Team.

Choose official national sources for this report. Each advisory shows its original language. Your selection is remembered on this device and included in shared links.

Official European source

ENISA European Vulnerability Database

Official EUVD identifiers, advisory evidence and known-exploited context. Missing fields are not treated as evidence of low risk.

1 current
ENISA EUVD identifier

EUVD-2022-6614

No EUVD known-exploited evidence

ENISA has published the identifier mapping but no EUVD description has been stored yet.

EUVD state
Present in the current official mapping
Known exploitation
Not present in the current ENISA EUVD known-exploited dataset. This is not proof of no exploitation.
ENISA score
Not supplied in the stored EUVD record
Advisory evidence
No linked advisory details stored yet
Recommended actionWithin 7 days

High technical severity with public exploit material referenced by a structured source; prioritise exposed affected systems while verifying vendor guidance.

Patch available
01

What, why and how

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.

What

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.

Why

Attacker-controlled data is not kept separate from SQL query syntax, allowing the intended database operation to be changed.

How

An attacker operating through a network path may attempt exploitation with low privileges. If successful, the issue may execute code or commands in the affected security context.

What

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.

Why

Attacker-controlled data is not kept separate from SQL query syntax, allowing the intended database operation to be changed.

How

An attacker operating through a network path may attempt exploitation with low privileges. If successful, the issue may execute code or commands in the affected security context.

02

Exploit reality and attack path

CVSS severity, EPSS forecast probability, public exploit material and CISA-confirmed exploitation are separate signals.

Observed exploitation
?Confirmed exploitation and public exploit material are separate signals. Attacks can occur without public proof-of-concept or exploit code.
No confirmed evidence

No CISA KEV match was present at the last successful refresh. This means no confirmation from that source, not proof of no exploitation.

Public PoC / exploit material
?Confirmed exploitation and public exploit material are separate signals. Attacks can occur without public proof-of-concept or exploit code.
Reference recorded

A structured CVE source labels at least one public reference as exploit material. BlackTree has not independently validated that it is safe, reliable or weaponised.

Likely attack path
a network path → Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') → execute code or commands in the affected security context
Attack surface
Network
Privileges required
Low: a basic authenticated account is required
User interaction
Required interaction required
Attack complexity
High: exploitation depends on specific conditions
Security boundary
Unchanged: impact remains within the vulnerable component's security authority
Weakness
?CWE means Common Weakness Enumeration: a standard category for the underlying weakness.
CWE-89 ↗

CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.

CVSS vector
?CVSS means Common Vulnerability Scoring System. The vector records the metric values used to calculate technical severity.
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H

Common Vulnerability Scoring System 3.1: the compact vector below is decoded into plain language.

AVNetworkAttack vector: The vulnerable component can be reached over a network.ACHighAttack complexity: Successful exploitation depends on specific conditions outside the attacker's direct control.PRLowPrivileges required: The attacker needs basic user-level privileges.UIRequiredUser interaction: Another user must perform an action for exploitation to succeed.SUnchangedScope: The security impact remains within the vulnerable component's authority.CHighConfidentiality impact: A successful attack can cause a major loss.IHighIntegrity impact: A successful attack can cause a major loss.AHighAvailability impact: A successful attack can cause a major loss.
Post-exploitation / living off the land
After compromise, an attacker may use built-in shells, scripting engines, scheduled tasks and native network utilities for discovery, persistence or movement. This is a plausible LoTL path, not evidence that it has occurred for every attack.
NetworkRemote code executionCWE-89Public exploit reference
A

Official authority intelligence

Only matched European and national findings are included. Language selectors and unavailable sources are omitted.

BSI · German · WID-SEC-2023-1807Oracle Fusion Middleware: Mehrere Schwachstellen

Ein Angreifer aus dem angrenzenden Netzwerk oder ein entfernter anonymer, authentisierter oder lokaler Angreifer kann mehrere Schwachstellen in Oracle Fusion Middleware ausnutzen, um die Vertraulichkeit, Integrität und Verfügbarkeit zu gefährden.

Official advisory ↗
BSI · German · WID-SEC-2023-0809IBM QRadar SIEM: Mehrere Schwachstellen

Ein entfernter, anonymer Angreifer kann mehrere Schwachstellen in IBM QRadar SIEM ausnutzen, um beliebigen Programmcode auszuführen, Informationen offenzulegen, Informationen falsch darzustellen, einen Denial of Service Zustand herbeizuführen, Sicherheitsvorkehrungen zu umgehen, einen Cross-Site-Scripting-Angriff durchzuführen oder unbekannte Auswirkungen zu verursachen.

Official advisory ↗
BSI · German · WID-SEC-2022-0910PostgreSQL JDBC Treiber: Schwachstelle ermöglicht SQL Injection

Ein entfernter, authentisierter Angreifer kann eine Schwachstelle im JDBC Treiber für PostgreSQL ausnutzen, um eine SQL Injection durchzuführen.

Official advisory ↗
Cyber Security Agency of Singapore · English · CSA-SB-20220810Security Bulletin 10 Aug 2022

The Cyber Security Agency of Singapore included this CVE in its official Security Bulletin 10 Aug 2022, published on 10 August 2022. Open the linked bulletin for the product, severity and reference information published in that issue.

Official advisory ↗
CERT-FR · French · CERTFR-2025-AVI-1013Multiples vulnérabilités dans les produits IBM

vembre 2025 https://www.ibm.com/support/pages/node/7250926 Bulletin de sécurité IBM 7250956 du 12 novembre 2025 https://www.ibm.com/support/pages/node/7250956 Bulletin de sécurité IBM 7250959 du 12 novembre 2025 https://www.ibm.com/support/pages/node/7250959 Bulletin de sécurité IBM 7250971 du 12 novembre 2025 https://www.ibm.com/support/pages/node/7250971 Bulletin de sécurité IBM 7251173 du 13 novembre 2025 https://www.ibm.com/support/pages/node/7251173 Bulletin de sécurité IBM 7250474 du 26 novembre 2025 https://www.ibm.com/support/pages/node/7250474 Référence CVE CVE-2020-16971 https://www.cve.org/CVERecord?id=CVE-2020-16971 Référence CVE CVE-2022-31197 https://www.cve.org/CVERecord?id=CVE-2022-31197 Référence CVE CVE-2022-3171 https://www.cve.org/CVERecord?id=CVE-2022-3171 Référence CVE CVE-2022-3509 https://www.cve.org/CVERecord?id=CVE-2022-3509 Référence CVE CVE-2022-3510 https://www.cve.org/CVERecord?id=CVE-2022-3510 Référence CVE CVE-2022-41946 https://www.cve.org/CVERecord?id=CVE-2022-41946 Référence CVE CVE-2022-49985 https://www.cve.org/CVERecord?id=CVE-2022-49985 Référence CVE CVE-2022-50087 https://www.cve.org/CVERecord?id=CVE-2022-50087 Référence CVE CVE-2023-1370 https://www.cve.org/CVERecord?id=CVE-2023-1370 Référence CVE CVE-2023-26133 https://www.cve.org/CVERecord?id=CVE-2023

Official advisory ↗
CERT-FR · French · CERTFR-2023-AVI-0276Multiples vulnérabilités dans les produits IBM

d?id=CVE-2022-29901 Référence CVE CVE-2022-30580 https://www.cve.org/CVERecord?id=CVE-2022-30580 Référence CVE CVE-2022-30629 https://www.cve.org/CVERecord?id=CVE-2022-30629 Référence CVE CVE-2022-30630 https://www.cve.org/CVERecord?id=CVE-2022-30630 Référence CVE CVE-2022-30631 https://www.cve.org/CVERecord?id=CVE-2022-30631 Référence CVE CVE-2022-30632 https://www.cve.org/CVERecord?id=CVE-2022-30632 Référence CVE CVE-2022-30633 https://www.cve.org/CVERecord?id=CVE-2022-30633 Référence CVE CVE-2022-30635 https://www.cve.org/CVERecord?id=CVE-2022-30635 Référence CVE CVE-2022-31129 https://www.cve.org/CVERecord?id=CVE-2022-31129 Référence CVE CVE-2022-31197 https://www.cve.org/CVERecord?id=CVE-2022-31197 Référence CVE CVE-2022-32148 https://www.cve.org/CVERecord?id=CVE-2022-32148 Référence CVE CVE-2022-32189 https://www.cve.org/CVERecord?id=CVE-2022-32189 Référence CVE CVE-2022-34917 https://www.cve.org/CVERecord?id=CVE-2022-34917 Référence CVE CVE-2022-36033 https://www.cve.org/CVERecord?id=CVE-2022-36033 Référence CVE CVE-2022-36364 https://www.cve.org/CVERecord?id=CVE-2022-36364 Référence CVE CVE-2022-3676 https://www.cve.org/CVERecord?id=CVE-2022-3676 Référence CVE CVE-2022-37598 https://www.cve.org/CVERecord?id=CVE-2022-37598 Référence CVE CVE-2022-37599 https://www.cve.org/CVERecord?id=CV

Official advisory ↗
CERT-FR · French · CERTFR-2022-AVI-743Vulnérabilité dans PostgreSQL JDBC

Une vulnérabilité a été découverte dans PostgreSQL JDBC. Elle permet à un attaquant de provoquer une exécution de code arbitraire à distance.

Official advisory ↗
JVN iPedia · Japanese · JVNDB-2022-014279PostgreSQL.org の PostgreSQL JDBC ドライバ他複数ベンダの製品における SQL インジェクションの脆弱性

PostgreSQL.org の PostgreSQL JDBC ドライバ他複数ベンダの製品には、SQL インジェクションの脆弱性が存在します。

Official advisory ↗
03

Patch and workaround

Operational remediation based on structured source evidence.

Status
?Patch availability is based on structured fixed-version fields and authoritative update references. If no fix is verified, check the vendor advisory before making a change.
Patch available
Affected
Fixed
Action
For details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258 If the postgresql service is running, it will be automatically restarted after installing this update.
Workaround
No verified workaround is recorded. If business-safe, reduce exposure to the affected interface and allow only trusted sources until authoritative guidance is available.
04

Evidence and provenance

Published 3 Aug 2022 · Last source change 3 Nov 2025, 21:46 UTC · CWE-89 · Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

CVE recordCVE.org · 5.2
CVSS sourceCNA
EPSS source
?The date BlackTree first stored a score for this CVE from the daily FIRST EPSS feed.
FIRST · tracked since 2026-08-14
European sourceENISA EUVD · EUVD-2022-6614
Product sourceVendor CSAF · Red Hat Product Security
Remediation sourceVendor CSAF · Red Hat Product Security
CWE sourceCNA
NVD statusNVD modified after enrichment

Core structured fields are present and their contributing authorities are shown above.

Material change intelligence

What changed after publication

View recent updates ↗
  1. Affected versionsThe structured affected or fixed version information changed.
    Before
    >= 42.2.0, < 42.2.26; >= 42.3.0, < 42.4.1 · Fixed: An authoritative update reference is available, but the fixed version is not recorded in the structured CVE fields. Check the linked vendor advisory for the applicable release.
    After
    >= 42.2.0, < 42.2.26; >= 42.3.0, < 42.4.1 · Fixed: For details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258 If the postgresql service is running, it will be automatically restarted after installing this update.
    Red Hat Product Security ↗
Material fields only · duplicate refreshes suppressed · history retained for the configured operational retention period
Technical terms and abbreviations used in this report
CVE
Common Vulnerabilities and Exposures: the public identifier for one disclosed vulnerability.
CVSS
Common Vulnerability Scoring System: a technical severity framework; it is not patching priority by itself.
EPSS
Exploit Prediction Scoring System: FIRST's estimate of the probability that exploitation activity will be observed in the next 30 days; it is a forecast, not confirmation.
CWE
Common Weakness Enumeration: the standard category describing the underlying software or hardware weakness.
CNA
CVE Numbering Authority: an organisation authorised to assign and publish CVE records.
CISA ADP
Cybersecurity and Infrastructure Security Agency Authorized Data Publisher: structured enrichment added to a CVE record.
NVD
National Vulnerability Database: NIST's enrichment service for CVE records.
CERT / CSIRT
A computer security incident response team that publishes warnings or coordinates incident response.
PoC
Proof of concept: public material that demonstrates or helps reproduce exploitation.
CSAF
Common Security Advisory Framework: a machine-readable format for security advisories.
LoTL
Living off the land: abuse of legitimate tools or system functions during an attack.
Free version - for non-commercial use only.CVE-2022-31197 · cve.blacktree.nl