Vulnerability · Published Feb 2, 2022 · Assigned by GitHub_M
CVE-2022-21724Unchecked Class Instantiation when providing Plugin Classes
High 7.0
In plain English
A high-severity security flaw in the java-postgresql-jdbc package (Alpine). Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 3.1% (higher than 88% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.20 | java-postgresql-jdbc | 42.2.25-r0 | ALPINE-CVE-2022-21724 |
| Alpine:v3.21 | java-postgresql-jdbc | 42.2.25-r0 | ALPINE-CVE-2022-21724 |
| Alpine:v3.22 | java-postgresql-jdbc | 42.2.25-r0 | ALPINE-CVE-2022-21724 |
| Alpine:v3.23 | java-postgresql-jdbc | 42.2.25-r0 | ALPINE-CVE-2022-21724 |
| Alpine:v3.24 | java-postgresql-jdbc | 42.2.25-r0 | ALPINE-CVE-2022-21724 |
| Debian:12 | libpgjava | 42.3.2-1 | DEBIAN-CVE-2022-21724 |
| Debian:13 | libpgjava | 42.3.2-1 | DEBIAN-CVE-2022-21724 |
| Debian:14 | libpgjava | 42.3.2-1 | DEBIAN-CVE-2022-21724 |
| Maven | org.postgresql:postgresql | 42.3.2 | GHSA-v7wg-cpwc-24m4 |
| Maven | org.postgresql:postgresql | 42.2.25 | GHSA-v7wg-cpwc-24m4 |
Affected products (as reported)
Weakness: CWE-665 · Vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
References
- https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-v7wg-cpwc-24m4 x_refsource_CONFIRM
- https://github.com/pgjdbc/pgjdbc/commit/f4d0ed69c0b3aae8531d83d6af4c57f22312c813 x_refsource_MISC
- https://security.netapp.com/advisory/ntap-20220311-0005/ x_refsource_CONFIRM
- FEDORA-2022-1151f65e9a vendor-advisory, x_refsource_FEDORA
- [debian-lts-announce] 20220520 [SECURITY] [DLA 3018-1] libpgjava security update mailing-list, x_refsource_MLIST
- DSA-5196 vendor-advisory, x_refsource_DEBIAN