CVE-2022-31197
Summary
| CVE | CVE-2022-31197 |
| State | PUBLIC |
| Assigner | [email protected] |
| Source Priority | CVE Program / NVD first with legacy fallback |
| Published | 2022-08-03 19:15:00 UTC |
| Updated | 2023-11-07 03:47:00 UTC |
| 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. |
NVD Known Affected Configurations (CPE 2.3)
References
| Reference | Source | Link | Tags |
|---|
| [SECURITY] Fedora 36 Update: postgresql-jdbc-42.3.1-4.fc36 - package-announce - Fedora Mailing-Lists |
FEDORA |
lists.fedoraproject.org |
|
| [SECURITY] Fedora 35 Update: postgresql-jdbc-42.2.26-1.fc35 - package-announce - Fedora Mailing-Lists |
FEDORA |
lists.fedoraproject.org |
|
| SQL Injection in ResultSet.refreshRow() with malicious column names · Advisory · pgjdbc/pgjdbc · GitHub |
CONFIRM |
github.com |
|
| [SECURITY] Fedora 35 Update: postgresql-jdbc-42.2.26-1.fc35 - package-announce - Fedora Mailing-Lists |
|
lists.fedoraproject.org |
|
| [SECURITY] [DLA 3140-1] libpgjava security update |
MLIST |
lists.debian.org |
|
| [SECURITY] Fedora 36 Update: postgresql-jdbc-42.3.1-4.fc36 - package-announce - Fedora Mailing-Lists |
|
lists.fedoraproject.org |
|
| Merge pull request from GHSA-r38f-c4h4-hqq2 · pgjdbc/pgjdbc@739e599 · GitHub |
MISC |
github.com |
|
| CVE Program record |
CVE.ORG |
www.cve.org |
canonical |
| NVD vulnerability detail |
NVD |
nvd.nist.gov |
canonical, analysis |
No vendor comments have been submitted for this CVE.
Legacy QID Mappings
- 160431 Oracle Enterprise Linux Security Update for postgresql-jdbc (ELSA-2023-0318)
- 181118 Debian Security Update for libpgjava (DLA 3140-1)
- 183540 Debian Security Update for libpgjava (CVE-2022-31197)
- 241119 Red Hat Update for postgresql-jdbc (RHSA-2023:0318)
- 283174 Fedora Security Update for postgresql (FEDORA-2022-d7d49b2fac)
- 283175 Fedora Security Update for postgresql (FEDORA-2022-cdeabe1bc0)
- 502490 Alpine Linux Security Update for java-postgresql-jdbc
- 672416 EulerOS Security Update for postgresql-jdbc (EulerOS-SA-2022-2803)
- 690940 Free Berkeley Software Distribution (FreeBSD) Security Update for puppetdb (aeb4c85b-3600-11ed-b52d-589cfc007716)
- 752659 SUSE Enterprise Linux Security Update for postgresql-jdbc (SUSE-SU-2022:3541-1)
- 753226 SUSE Enterprise Linux Security Update for postgresql-jdbc (SUSE-SU-2022:3537-1)
- 753484 SUSE Enterprise Linux Security Update for postgresql-jdbc (SUSE-SU-2022:3613-1)
- 940900 AlmaLinux Security Update for postgresql-jdbc (ALSA-2023:0318)
- 960492 Rocky Linux Security Update for postgresql-jdbc (RLSA-2023:0318)