GHSA-r38f-c4h4-hqq2 · Severity: high · Ecosystem: maven — PostgreSQL JDBC Driver SQL Injection in ResultSet.refreshRow() with malicious column names
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.
Conclusion & alert: CVE-2022-31197 is rated High Exploit Risk (68.3/100): CVSS High severity, with medium exploitation likelihood (EPSS 1.66%). Core evidence: 1 public exploit reference(s) are indexed (Exploit-DB). Mandatory action: Public exploits are available—assess exposure, apply mitigations, and prioritize patching.
Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.
| EDB-ID | Source | Kind | Published | Link |
|---|---|---|---|---|
| — | nvd_ref | exploit_tag | Exploit-DB ↗ |
EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).
| # | Date | Old EPSS score | New EPSS score | Delta (New - Old) |
|---|---|---|---|---|
| 1 | 2026-06-15 | 2.46% | 1.66% | -0.80% |
| 2 | 2026-05-22 | 3.31% | 2.46% | -0.85% |
| 3 | 2026-05-08 | — | 3.31% | — |
Full EPSS history (35 records total)
CVSS metrics for this CVE.
| Base score | Version | Severity | Vector | Exploitability | Impact | Score source |
|---|---|---|---|---|---|---|
| 7.1 | 3.1 | HIGH |
|
1.2 | 5.9 | [email protected] |
| 8.0 | 3.1 | HIGH |
|
2.1 | 5.9 | [email protected] |
GHSA-r38f-c4h4-hqq2 · Severity: high · Ecosystem: maven — PostgreSQL JDBC Driver SQL Injection in ResultSet.refreshRow() with malicious column names
| vendor | priority | summary | link |
|---|---|---|---|
alpine
|
high | CVE-2022-31197: 1 source package rows (java-postgresql-jdbc); 7 state rows across 7 repos (3.17-community, 3.18-community, 3.19-community, 3.20-community, 3.21-community, 3.22-community, edge-community); fixed 7, open 0. | https://security.alpinelinux.org/vuln/CVE-2022-31197 |
debian
|
not yet assigned | CVE-2022-31197 not yet assigned priority: Debian including 1 source packages (libpgjava), 5 status rows across 5 suites (bookworm, bullseye, forky, sid, trixie): resolved 5. | https://security-tracker.debian.org/tracker/CVE-2022-31197 |
redhat
|
medium | — | https://access.redhat.com/security/cve/CVE-2022-31197 |
suse
|
high | — | https://www.suse.com/security/cve/CVE-2022-31197/ |
ubuntu
|
medium | CVE-2022-31197 medium priority: Ubuntu including 1 source packages (libpgjava), 13 status rows across 13 suites (bionic, focal, jammy, kinetic, lunar, mantic, noble, oracular, plucky, questing, trusty, upstream, xenial): needs-triage 8, ignored 5. | https://ubuntu.com/security/CVE-2022-31197 |
| Vendor | Product | Version | Raw CPE |
|---|---|---|---|
| postgresql | postgresql_jdbc_driver | < 42.2.26 | cpe:2.3:a:postgresql:postgresql_jdbc_driver:*:*:*:*:*:*:*:* |
| postgresql | postgresql_jdbc_driver | >= 42.3.0, < 42.3.7 | cpe:2.3:a:postgresql:postgresql_jdbc_driver:*:*:*:*:*:*:*:* |
| postgresql | postgresql_jdbc_driver | 42.4.0 | cpe:2.3:a:postgresql:postgresql_jdbc_driver:42.4.0:-:*:*:*:*:*:* |
| postgresql | postgresql_jdbc_driver | 42.4.0 | cpe:2.3:a:postgresql:postgresql_jdbc_driver:42.4.0:rc1:*:*:*:*:*:* |
| postgresql | postgresql_jdbc_driver | 42.4.1 | cpe:2.3:a:postgresql:postgresql_jdbc_driver:42.4.1:rc1:*:*:*:*:*:* |
| debian | debian_linux | 10.0 | cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* |
| fedoraproject | fedora | 35 | cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* |
| fedoraproject | fedora | 36 | cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:* |