CVE-2022-21724: Unchecked Class Instantiation when providing Plugin Classes

Published Feb 1, 2022
·
Updated

pgjdbc is the offical PostgreSQL JDBC Driver. A security hole was found in the jdbc driver for postgresql database while doing security research. The system using the postgresql library will be attacked when attacker control the jdbc url or properties. pgjdbc instantiates plugin instances based on class names provided via authenticationPluginClassName, sslhostnameverifier, socketFactory, sslfactory, sslpasswordcallback connection properties. However, the driver did not verify if the class implements the expected interface before instantiating the class. This can lead to code execution loaded via arbitrary classes. Users using plugins are advised to upgrade. There are no known workarounds for this issue.

Other sources

pgjdbc is the offical PostgreSQL JDBC Driver. A security hole was found in the jdbc driver for postgresql database while doing security research. The system using the postgresql library will be attacked when attacker control the jdbc url or properties. pgjdbc instantiates plugin instances based on class names provided via authenticationPluginClassName, sslhostnameverifier, socketFactory, sslfactory, sslpasswordcallback connection properties. However, the driver did not verify if the class implements the expected interface before instantiating the class. This can lead to remote code execution loaded via arbitrary classes. Users using plugins are advised to upgrade. There are no known workarounds for this issue.

Reference: https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-v7wg-cpwc-24m4

Upstream patch: https://github.com/pgjdbc/pgjdbc/commit/f4d0ed69c0b3aae8531d83d6af4c57f22312c813

Red Hat

PostgreSQL JDBC Driver (PgJDBC) could allow a remote authenticated attacker to execute arbitrary code on the system, caused by an unchecked class instantiation when providing plugin classes. By sending a specially-crafted request using the "authenticationPluginClassName", "sslhostnameverifier", "socketFactory", "sslfactory", "sslpasswordcallback" classes, an attacker could exploit this vulnerability to execute arbitrary code on the system.

Affected Software

12 affected componentsFixes available
debian/libpgjava
42.2.5-2+deb10u142.2.5-2+deb10u342.2.15-1+deb11u142.5.4-142.6.0-2
IBM Disconnected Log Collector<=v1.0 - v1.8.2
redhat/postgresql<42.2.25
42.2.25
redhat/postgresql<42.3.2
42.3.2
PostgreSQL PostgreSQL JDBC driver<42.2.25
PostgreSQL PostgreSQL JDBC driver>=42.3.0<42.3.2
PostgreSQL PostgreSQL JDBC driver=42.3.2-rc1
Fedoraproject Fedora=35
Quarkus Quarkus<2.7.2
Debian Debian Linux=9.0
Debian Debian Linux=10.0
Debian Debian Linux=11.0

Event History

Feb 1, 2022
CVE Published
12:00 AM
Data Sourced
12:00 AM
RemedyDescriptionSeverityWeaknessAffected Software
Feb 2, 2022
CVE Published
via MITRE·11:48 AM
Data Sourced
via MITRE·11:48 AM
DescriptionSeverity
Feb 4, 2022
Data Sourced
via Red Hat·07:40 PM
DescriptionSeverityAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2022-21724?

CVE-2022-21724 is a vulnerability in the PostgreSQL JDBC Driver (PgJDBC) that could allow a remote authenticated attacker to execute arbitrary code.

2

How does the vulnerability in CVE-2022-21724 occur?

The vulnerability in CVE-2022-21724 occurs when the jdbc url or properties are controlled by the attacker, which can lead to the execution of arbitrary code.

3

What is the severity of CVE-2022-21724?

The severity of CVE-2022-21724 is high, with a CVSS base score of 8.5.

4

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

The PostgreSQL JDBC Driver versions up to and exclusive of 42.2.25 and 42.3.2 are affected by CVE-2022-21724.

5

How can I fix the vulnerability in CVE-2022-21724?

To fix the vulnerability in CVE-2022-21724, you should update the PostgreSQL JDBC Driver to version 42.2.25 or higher.

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