Skip to main content

Over 150 LLM Providers · Over 5,300 Models The most extensible AI-powered pentesting platform. Open source. Star on GitHub

CVE-2022-31197

7.1 · HIGH
Published Aug 3, 2022 postgresql CWE-89 EPSS 2.09% (80th pctl)

Overview

CVE-2022-31197 is a high-severity vulnerability affecting postgresql postgresql_jdbc_driver. It was published on August 3, 2022 and has a CVSS 3.1 base score of 7.1 (HIGH).

This vulnerability has a CVSS 3.1 base score of 7.1, rated HIGH. It can be exploited remotely over the network. Some level of privileges is required for exploitation.

Technical 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

Remediation

Check the references section for vendor advisories and patches from postgresql. Update postgresql_jdbc_driver to the latest patched version. If immediate patching is not possible, review the CVSS vector to understand the attack surface and apply compensating controls such as network segmentation or access restrictions.

Affected Products

Vendor Product Versions Status
postgresql postgresql_jdbc_driver >= 0, < 42.2.26 Affected

Frequently Asked Questions

What is CVE-2022-31197?

CVE-2022-31197 is a high-severity vulnerability affecting postgresql postgresql_jdbc_driver. It was published on August 3, 2022 and has a CVSS 3.1 base score of 7.1 (HIGH).

How severe is CVE-2022-31197?

This vulnerability has a CVSS 3.1 base score of 7.1, rated HIGH. It can be exploited remotely over the network. Some level of privileges is required for exploitation.

How do I fix or remediate CVE-2022-31197?

Check the references section for vendor advisories and patches from postgresql. Update postgresql_jdbc_driver to the latest patched version. If immediate patching is not possible, review the CVSS vector to understand the attack surface and apply compensating controls such as network segmentation or access restrictions.

How can CyberStrike help with CVE-2022-31197?

CyberStrike's AI-powered security agents can automatically detect CVE-2022-31197 across your infrastructure using autonomous pentesting, DAST scanning, and HackBrowser. The platform continuously monitors for known vulnerabilities and provides actionable remediation guidance prioritized by real-world exploitability.