Pgjdbc · Pgjdbc · CVE-2022-21724
**Name of the Vulnerable Software and Affected Versions**
pgjdbc versions prior to the fixed version
**Description**
A security issue was found in the pgjdbc driver for PostgreSQL databases. The driver instantiates plugin instances based on class names provided via `authenticationPluginClassName`, `sslhostnameverifier`, `socketFactory`, `sslfactory`, `sslpasswordcallback` connection properties. However, it does not verify if the class implements the expected interface before instantiating it, which can lead to code execution loaded via arbitrary classes. This can be exploited when an attacker controls the JDBC URL or properties.
**Recommendations**
For pgjdbc, upgrade to a version that includes the fix for this issue.
As a temporary workaround, consider restricting the use of the vulnerable connection properties `authenticationPluginClassName`, `sslhostnameverifier`, `socketFactory`, `sslfactory`, `sslpasswordcallback` until a patch is available.
Avoid using plugins that may instantiate arbitrary classes via these properties until the issue is resolved.