Arbitrary File Write Vulnerability in libpgjava Package

libpgjava Updated 02 Oct 2025

Summary

10/03/2022
N/A
Yes i
Critical
9.8

CVE-2022-26520: In pgjdbc before 42.3.3, an attacker (who controls the jdbc URL or properties) can call java.util.logging.FileHandler to write to arbitrary files through the loggerFile and loggerLevel connection properties. Affects libpgjava across 2 version ranges.

>= 6d93eb817f334b383d2c8716a50d8c1255e24236, < 9effea487dca529dc5cb0e71600a8c6509819c56 < 42.2.15-1+deb11u1

Fixed in 42.2.15-1+deb11u1. 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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

libpgjava is a JDBC driver for PostgreSQL that allows Java applications to connect to PostgreSQL databases. It provides a set of functionalities for executing SQL commands and managing database connections. However, it has been identified to have a vulnerability that allows attackers to manipulate connection properties, leading to potential security risks.

Vulnerability Detail

In pgjdbc versions prior to 42.3.3, an attacker who controls the JDBC URL or properties can exploit the loggerFile and loggerLevel connection properties to invoke java.util.logging.FileHandler, enabling them to write to arbitrary files. This could lead to severe consequences, such as creating executable JSP files in a Tomcat web root, thereby compromising the server's integrity. The vendor asserts that the vulnerability lies not within pgjdbc itself but in the usage of untrusted connection properties by applications.

How To Fix

Minimum fixed version

42.2.15-1+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade libpgjava

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, avoid using untrusted connection properties in your application. Validate and sanitize any input that could influence the JDBC URL or properties to mitigate the risk of exploitation.

Conclusion

The libpgjava package has a critical vulnerability that allows arbitrary file writing through manipulated JDBC connection properties. It is essential to update to the latest versions to safeguard against potential exploits. Additionally, employing input validation can serve as a temporary measure until the update is applied.

See every vulnerability recorded for libpgjava →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 9.8, indicating a critical level of severity.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

If exploited, this vulnerability could allow attackers to write arbitrary files on the server, potentially leading to unauthorized access or execution of malicious code.

Yes, ensure that you are using libpgjava version 42.2.15-1+deb11u1 for Debian 11, and version 42.3.3-1 or later for Debian 12 and 13 to mitigate this vulnerability.

If an immediate update is not possible, ensure to validate and sanitize any JDBC connection properties to prevent untrusted inputs from being processed.

Related vulnerabilities

Recent vulnerabilities recorded for libpgjava.

How To Fix

Minimum fixed version

42.2.15-1+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade libpgjava

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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