CVE-2022-26520
Java vulnerability analysis and mitigation

Overview

In PostgreSQL JDBC (pgjdbc) versions before 42.3.3, a vulnerability was identified where an attacker with control over the JDBC URL or connection properties could exploit the loggerFile and loggerLevel connection properties to write arbitrary files to the system. This vulnerability was assigned CVE-2022-26520 and was disclosed in March 2022. For example, an attacker could potentially create an executable JSP file under a Tomcat web root, leading to potential remote code execution (GitHub Advisory, CVE Mitre).

Technical details

The vulnerability stems from the ability to manipulate the loggerFile and loggerLevel connection properties in the JDBC URL. An attacker could specify an arbitrary filename in the loggerFileName connection parameter, for example: 'jdbc:postgresql://localhost:5432/test?user=test&password=test&loggerLevel=DEBUG&loggerFile=./blah.jsp&<%Runtime.getRuntime().exec(request.getParameter("i"));%>'. This could result in the creation of a valid JSP file potentially leading to Remote Code Execution (GitHub Advisory).

Impact

The vulnerability could allow an attacker to write arbitrary files to the system, potentially leading to remote code execution if the attacker can write to sensitive locations such as web application directories. This could result in complete system compromise if successfully exploited (GitHub Advisory).

Mitigation and workarounds

The vulnerability was fixed in version 42.3.3 by removing the LoggerFile implementation, which will now be ignored by the driver. For earlier versions, applications should sanitize inputs to the driver and ensure that JDBC URLs and connection properties are not exposed to untrusted users. The vendor recommends using java.util.logging for logging configuration instead (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related Java vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-26866HIGH8.8
  • JavaJava
  • org.apache.hugegraph:hg-pd-core
NoYesDec 12, 2025
CVE-2025-54981HIGH7.5
  • JavaJava
  • org.apache.streampark:streampark
NoYesDec 12, 2025
CVE-2025-67721MEDIUM6.3
  • JavaJava
  • trino
NoYesDec 12, 2025
CVE-2025-53960MEDIUM5.9
  • JavaJava
  • org.apache.streampark:streampark
NoYesDec 12, 2025
CVE-2025-54947MEDIUM5.3
  • JavaJava
  • org.apache.streampark:streampark
NoYesDec 12, 2025

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