CVE-2022-26520: Postgresql Postgresql Vulnerability

LOW
Advisory Identifier: GHSA-727h-hrw8-jg8q
Published
Advisory Summary

CVE-2022-26520 is a LOW postgresql vulnerability (General Security Weakness) affecting Postgresql libraries in the Maven ecosystem. The issue involves postgresql. Remediation is available by upgrading affected packages to version 42.3.3.

CVE-2022-26520 at a Glance

CVE Identifier CVE-2022-26520
GHSA Identifier GHSA-727h-hrw8-jg8q
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Postgresql
Package Ecosystem Maven
Published Date
Last Updated

How to Fix CVE-2022-26520

To remediate this vulnerability, upgrade all affected Postgresql dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.postgresql:postgresql fixed: 42.3.3
<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>42.3.3</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.postgresql

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2022-26520, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.postgresql

Analyze the terminal output to locate any version of Postgresql in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 42.3.3), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.postgresql command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Postgresql, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

In pgjdbc before 42.3.3, an attacker (who controls the jdbc URL or properties) can call java.util.logging.FileHandler to write to arbitrary files through the loggerFile and loggerLevel connection properties. An example situation is that an attacker could create an executable JSP file under a Tomcat web root. NOTE: the vendor's position is that there is no pgjdbc vulnerability; instead, it is a vulnerability for any application to use the pgjdbc driver with untrusted connection properties.

CVE-2022-26520 Affected Postgresql Versions

1 component(s)
Fixed Versions:
42.3.3
Product / Package Ecosystem Affected Versions Fixed Version
org.postgresql:postgresql
Maven
≥ 42.1.0
< 42.3.3
42.3.3

References

Frequently Asked Questions

What is CVE-2022-26520?
CVE-2022-26520 is a security vulnerability in Postgresql involving postgresql under General Security Weakness.
Which Postgresql versions are affected?
Affected versions include releases prior to 42.3.3 across affected packages: org.postgresql:postgresql.
What version fixes CVE-2022-26520?
Upgrading to 42.3.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is postgresql affected?
Yes, org.postgresql:postgresql is affected in releases prior to 42.3.3. Upgrade your dependency to 42.3.3 or later.
What CWE is associated with CVE-2022-26520?
CVE-2022-26520 is classified under General Security Weakness.
How can I check Maven dependencies for CVE-2022-26520?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.postgresql'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-727h-hrw8-jg8q",
  "modified" : "2023-08-03T17:41:54Z",
  "published" : "2022-03-11T00:02:02Z",
  "aliases" : [ "CVE-2022-26520" ],
  "summary" : "Path traversal in org.postgresql:postgresql",
  "details" : "In pgjdbc before 42.3.3, an attacker (who controls the jdbc URL or properties) can call java.util.logging.FileHandler to write to arbitrary files through the loggerFile and loggerLevel connection properties. An example situation is that an attacker could create an executable JSP file under a Tomcat web root. NOTE: the vendor's position is that there is no pgjdbc vulnerability; instead, it is a vulnerability for any application to use the pgjdbc driver with untrusted connection properties.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.postgresql:postgresql"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "42.1.0"
      }, {
        "fixed" : "42.3.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-673j-qm5f-xpv8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-26520"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pgjdbc/pgjdbc/pull/2454/commits/017b929977b4f85795f9ad2fa5de6e80978b8ccc"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pgjdbc/pgjdbc"
  }, {
    "type" : "WEB",
    "url" : "https://jdbc.postgresql.org/documentation/changelog.html#version_42.3.3"
  }, {
    "type" : "WEB",
    "url" : "https://jdbc.postgresql.org/documentation/head/tomcat.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2022/dsa-5196"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-09-08T00:02:20Z",
    "nvd_published_at" : "2022-03-10T17:47:00Z"
  }
}