Question about CVE-2022-21724 - Mailing list pgsql-jdbc

From Zuzana Miklankova
Subject Question about CVE-2022-21724
Date
Msg-id CADP8YayBMTdRGicNzv2Urq2J-dVi28m8WJCuzvPSC+Jp4Jc7Nw@mail.gmail.com
Whole thread Raw
List pgsql-jdbc
Hello,

I have a question regarding CVE-2022-21724 - Unchecked Class Instantiation
when providing Plugin Classes, fixed by [1].

The CVE describes that in affected versions the user can load the connection properties classes without checking first if the provided class implements the expected interface. The affected connection properties were the following ones:
authenticationPluginClassName, sslhostnameverifier, socketFactory, sslfactory, sslpasswordcallback.

The related security advisory [2] mentions that the first affected version is REL9.4.1208, with an explanation saying that in this release the socketFactory property first appeared.

However, I have checked the REL9.2-1002 release, and even though socketFactory is not present as expected, there are still the sslhostnameverifier, sslfactory and sslpasswordcallback connection properties available for a user to define.

Classes from these properties are loaded with 'instantiate' method too, without checking if they implement the required interface.

How come, that only the socketFactory has an effect on the CVE presence, so that the first affected version is REL9.4.1208?


Thanks,
Zuzana

[1] https://github.com/pgjdbc/pgjdbc/commit/f4d0ed69c0b3aae8531d83d6af4c57f22312c813
[2] https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-v7wg-cpwc-24m4

pgsql-jdbc by date:

Previous
From: Vladimir Sitnikov
Date:
Subject: [pgjdbc/pgjdbc] 3b13db: test: fix API usage in NotifyTest
Next
From: Dave Cramer
Date:
Subject: [pgjdbc/pgjdbc] 09166b: Release notes 42.4.0 (#2541)