CVE-2022-26520: Critical severity PostgreSQL PostgreSQL JDBC driver vulnerability

Published Feb 1, 2022
·
Updated

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

Other sources

A flaw was found in Postgres JDBC. This flaw allows an attacker to use a method to write arbitrary files through the connection properties settings. For example, an attacker can create an executable file under the server the application is running and make it a new part of the application or server.

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.

https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-673j-qm5f-xpv8 https://jdbc.postgresql.org/documentation/changelog.html#version42.3.3 https://github.com/pgjdbc/pgjdbc/pull/2454/commits/017b929977b4f85795f9ad2fa5de6e80978b8ccc https://jdbc.postgresql.org/documentation/head/tomcat.html

Red Hat

Affected Software

6 affected componentsFixes available
maven/org.postgresql:postgresql>=42.1.0<42.3.3
42.3.3
debian/libpgjava
42.2.5-2+deb10u142.2.5-2+deb10u342.2.15-1+deb11u142.5.4-142.6.0-2
PostgreSQL PostgreSQL JDBC driver>=42.1.0<=42.1.4
PostgreSQL PostgreSQL JDBC driver>=42.3.0<42.3.3
Debian Debian Linux=10.0
Debian Debian Linux=11.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade maven/org.postgresql:postgresql to a version that resolves this vulnerability.

    Fixed in 42.3.3
  2. Upgrade

    Upgrade debian/libpgjava to a version that resolves this vulnerability.

    Fixed in 42.2.5-2+deb10u1Fixed in 42.2.5-2+deb10u3Fixed in 42.2.15-1+deb11u1Fixed in 42.5.4-1Fixed in 42.6.0-2
  3. Upgrade

    Upgrade pgjdbc to a version that resolves this vulnerability.

    Fixed in 42.3.3Patch GHSA-673j-qm5f-xpv8
  4. Configuration

    Ensure the JDBC URL and connection properties that set loggerFile and loggerLevel are not attacker-controlled (only use trusted, application-controlled values), because in pgjdbc versions before 42.3.3 attacker-controlled loggerFile/loggerLevel can be used to write arbitrary files via java.util.logging.FileHandler.

    pgjdbc loggerFile / loggerLevel connection properties (used to configure java.util.logging.FileHandler) = Do not supply untrusted values; ensure attacker cannot control jdbc URL or these properties
  5. Compensating control

    If the application accepts user-controlled JDBC URL/properties (directly or indirectly), prevent that by validating/whitelisting connection property inputs so an attacker cannot set java.util.logging.FileHandler parameters such as loggerFile/loggerLevel.

Event History

Feb 1, 2022
CVE Published
12:00 AM
Data Sourced
12:00 AM
RemedyDescriptionSeverityWeaknessAffected Software
Mar 7, 2022
CVE Published
via MITRE·05:00 PM
Data Sourced
via MITRE·05:00 PM
Description
Mar 10, 2022
Disputed
05:47 PM
Mar 11, 2022
Advisory Published
12:02 AM
Mar 14, 2022
Data Sourced
via Red Hat·09:17 PM
DescriptionSeverityAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is CVE-2022-26520?

CVE-2022-26520 is a vulnerability found in Postgres JDBC that allows an attacker to write to arbitrary files.

2

How does the CVE-2022-26520 vulnerability work?

The vulnerability allows an attacker who controls the jdbc URL or properties to call java.util.logging.FileHandler to write to arbitrary files through the loggerFile and loggerLevel connection properties.

3

What is the severity of CVE-2022-26520?

The severity of CVE-2022-26520 is critical with a CVSS score of 9.8.

4

Which software versions are affected by CVE-2022-26520?

Versions of Postgres JDBC prior to 42.3.3 and certain versions of libpgjava and PostgreSQL JDBC Driver are affected by CVE-2022-26520.

5

How can I fix the CVE-2022-26520 vulnerability?

To fix the CVE-2022-26520 vulnerability, you should update your Postgres JDBC library to version 42.3.3 or later.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203