Critical Security Flaw in PostgreSQL JDBC Driver (libpgjava) - CVE-2022-21724

libpgjava Updated 02 Oct 2025

Summary

02/02/2022
N/A
No i
High
7.0

UBUNTU-CVE-2022-21724: pgjdbc is the offical PostgreSQL JDBC Driver. Affects libpgjava versions 9.2-1002-1. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The PostgreSQL JDBC Driver, known as pgjdbc, is a crucial library that enables Java applications to interact with PostgreSQL databases. It provides a standard interface for database connectivity, allowing developers to execute SQL queries and manage database transactions seamlessly. However, a significant security vulnerability has been identified in this driver, which could potentially allow attackers to execute arbitrary code by manipulating connection properties.

Vulnerability Detail

The vulnerability, identified as CVE-2022-21724, arises from the way pgjdbc handles certain connection properties. Specifically, the driver instantiates plugin instances based on class names provided via properties such as 'authenticationPluginClassName' and 'sslhostnameverifier'. Unfortunately, it does not verify whether the specified class implements the expected interface before instantiation. This oversight can lead to code execution through arbitrary classes, posing a severe risk to systems utilizing the PostgreSQL library. Attackers can exploit this vulnerability by controlling the JDBC URL or properties, leading to unauthorized access and potential data breaches.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

Currently, there are no known workarounds for this vulnerability. Users are strongly advised to upgrade to the patched version of the package as soon as possible to mitigate the risk.

Conclusion

CVE-2022-21724 represents a critical vulnerability in the PostgreSQL JDBC Driver that can lead to severe security risks. Users are urged to upgrade to the patched version of the libpgjava package to protect their systems from potential exploitation. Regular monitoring and vulnerability management practices, such as using tools like Vulert, can help maintain the security of your applications.

See every vulnerability recorded for libpgjava →

Share this vulnerability

FAQ

CVE-2022-21724 is a security vulnerability in the PostgreSQL JDBC Driver that allows attackers to execute arbitrary code by manipulating connection properties.

You can use Vulert, which monitors open-source vulnerabilities in your software. Simply upload your manifest file like package-lock.json to check for vulnerabilities.

If exploited, this vulnerability could lead to unauthorized access, data breaches, and potential compromise of the entire system using the PostgreSQL JDBC Driver.

Yes, a patched version of the libpgjava package is available. Users should upgrade to this version to mitigate the risk.

The CVSS score for CVE-2022-21724 is 7.0, indicating a high severity level.

Related vulnerabilities

Recent vulnerabilities recorded for libpgjava.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback