BreachSpiderVerified, not vibes

CVE-2022-31197 in Debian Linux and 2 more products

High 8.0

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 ...

Affects 3 products from 3 vendors. Facts below cite their sources.

CVSS 3.18.0
EPSS2.2%
EPSS percentile83th
FixUnknown

Remotely exploitable over the network, low complexity, low privileges required, requires user interaction, impact contained to the vulnerable component, full confidentiality impact, full integrity impact, full availability impact.

Affected products and versions

VendorProductAffected versions
Debian Debian Linux 10.0
Fedoraproject Fedora 35 36
Postgresql Postgresql Jdbc Driver 42.4.0 42.4.1 < 42.2.26 ≥ 42.3.0, < 42.3.7

A product listed here is affected only at the versions shown. Use the free check to test the exact version you run.

Fix and vendor advisory

No official vendor advisory link on record. See the CVE record.

Exploitation

CISA known-exploitedNot in the CISA KEV catalog
Public exploitNot confirmed

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.

Source: NIST NVD / MITRE CVE.

Record details

CVE IDCVE-2022-31197
BreachSpider IDBS-2022-GLOBAL-066741-H
CVSS vectorCVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
Published2022-08-03
Last modified2026-06-17
Weakness (CWE)
SourceNVD

Weakness definitions

CWE-89: SQL Injection

Attacker inserts SQL commands into application queries through user-controlled input, allowing unauthorized database access.

Related attack patterns (CAPEC)

CAPEC-7 Blind SQL Injection via CWE-89

CAPEC-108 Command Line Execution through SQL Injection via CWE-89

CAPEC-109 Object Relational Mapping Injection via CWE-89

CAPEC-110 SQL Injection through SOAP Parameter Tampering via CWE-89

CAPEC-470 Expanding Control over the Operating System from the Database via CWE-89

Show all 6

CAPEC-66 SQL Injection via CWE-89

Mapping is CWE to CAPEC per MITRE CAPEC 3.9.

Analysis AI-written, not human-reviewed

A vulnerability in the PostgreSQL JDBC Driver (PgJDBC) could allow SQL injection through the `java.sql.ResultRow.refreshRow()` method due to improper escaping of column names.

An attacker could exploit this vulnerability by providing a malicious column name that includes a statement terminator, such as ';', leading to the execution of arbitrary SQL commands.

Questions

What is CVE-2022-31197?

A vulnerability in the PostgreSQL JDBC Driver (PgJDBC) could allow SQL injection through the `java.sql.ResultRow.refreshRow()` method due to improper escaping of column names.

What is the CVSS score for CVE-2022-31197?

CVE-2022-31197 has CVSS 8.0 (High). Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H. EPSS: 2.2%.

Is CVE-2022-31197 actively exploited?

No confirmed active exploitation of CVE-2022-31197 as of 2026-09-25.

How do I remediate CVE-2022-31197?

Priority: HIGH.

What systems are affected by CVE-2022-31197?

CVE-2022-31197 affects Debian Debian Linux; Fedoraproject Fedora; Postgresql Postgresql Jdbc Driver.

For developers and AI agents

Run this check from your own code or agent

REST API

curl -s https://breachspider.com/api/v1/assets/correlate-cves \
 -H "Authorization: Bearer $BREACHSPIDER_API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"assets":[{"asset_id":"dev-1","vendor":"Debian","product":"Debian Linux","version":"1.0"}]}'

API reference

Python SDK

pip install breachspider

PyPI · GitHub

MCP for AI agents

# hosted: add as a connector
https://mcp.breachspider.com/mcp
# local
pipx install breachspider-mcp

Setup for Claude, ChatGPT, Cursor

Free trial: 14 days, 750 device checks, no card.

Page facts from NVD, MITRE, CISA and vendor advisories, record last modified 2026-06-17.