Skip to content

CVE-2022-41946 TemporaryFolder on unix-like systems does not limit access to created files in pgjdbc

MediumCVSS 5.5 EPSS 0.55%
Published
Updated
Exploit status
No public exploit known
Technology
UbuntuDebian

Description

pgjdbc is an open source postgresql JDBC Driver. In affected versions a prepared statement using either PreparedStatement.setText(int, InputStream) or PreparedStatemet.setBytea(int, InputStream) will create a temporary file if the InputStream is larger than 2k. This will create a temporary file which is readable by other users on Unix like systems, but not MacOS. On Unix like systems, the system's temporary directory is shared between all users on that system. Because of this, when files and directories are written into this directory they are, by default, readable by other users on that same system. This vulnerability does not allow other users to overwrite the contents of these directories or files. This is purely an information disclosure vulnerability. Because certain JDK file system APIs were only added in JDK 1.7, this this fix is dependent upon the version of the JDK you are using. Java 1.7 and higher users: this vulnerability is fixed in 4.5.0. Java 1.6 and lower users: no patch is available. If you are unable to patch, or are stuck running on Java 1.6, specifying the java.io.tmpdir system environment variable to a directory that is exclusively owned by the executing user will mitigate this vulnerability.

Upgrade path

24 packages: 13 fixed, 9 with no fix yet.

PackageAffectedFixed inStatus
ubuntu/libpgjava(Ubuntu 14.04) = 9.2-1002-1; All versions No fix listed No fix yet
ubuntu/libpgjava(Ubuntu 16.04) = 9.2-1002-1; All versions No fix listed No fix yet
ubuntu/libpgjava(Ubuntu 22.04) = 42.2.23-1; = 42.2.24-1; = 42.3.1-1; = 42.3.2-1 +2 more No fix listed No fix yet
ubuntu/libpgjava(Ubuntu 24.04) = 42.5.4-1; = 42.6.0-2; = 42.7.0-1; = 42.7.1-1 +2 more No fix listed No fix yet
ubuntu/libpgjava(Ubuntu 25.10) = 42.7.5-1; = 42.7.5-2; = 42.7.7-1; All versions No fix listed No fix yet
ubuntu/libpgjava(Ubuntu 26.04) = 42.7.7-1; = 42.7.8-1; = 42.7.8-2; = 42.7.9-1 +2 more No fix listed No fix yet
ubuntu/libpgjava(Ubuntu 26.10) = 42.7.10-1; = 42.7.11-1; = 42.7.12-1; = 42.7.13-1 +1 more No fix listed No fix yet
ubuntu/libpgjava(Ubuntu Pro 18.04) = 9.4.1212-1; = 9.4.1212-1ubuntu0.1~esm1; All versions No fix listed No fix yet
ubuntu/libpgjava(Ubuntu Pro 20.04) = 42.2.6-1; = 42.2.8-1; = 42.2.9-1; = 42.2.10-1 +2 more No fix listed No fix yet
alpine/java-postgresql-jdbc(Alpine v3.17) < 42.5.1-r0 42.5.1-r0 Fixed
alpine/java-postgresql-jdbc(Alpine v3.18) < 42.5.1-r0 42.5.1-r0 Fixed
alpine/java-postgresql-jdbc(Alpine v3.19) < 42.5.1-r0 42.5.1-r0 Fixed
alpine/java-postgresql-jdbc(Alpine v3.20) < 42.5.1-r0 42.5.1-r0 Fixed
alpine/java-postgresql-jdbc(Alpine v3.21) < 42.5.1-r0 42.5.1-r0 Fixed
alpine/java-postgresql-jdbc(Alpine v3.22) < 42.5.1-r0 42.5.1-r0 Fixed
alpine/java-postgresql-jdbc(Alpine v3.23) < 42.5.1-r0 42.5.1-r0 Fixed
alpine/java-postgresql-jdbc(Alpine v3.24) < 42.5.1-r0 42.5.1-r0 Fixed
debian/libpgjava(Debian 12) < 42.5.1-1 42.5.1-1 Fixed
debian/libpgjava(Debian 13) < 42.5.1-1 42.5.1-1 Fixed
debian/libpgjava(Debian 14) < 42.5.1-1 42.5.1-1 Fixed
org.postgresql/postgresql(Maven) = 42.2.0; = 42.2.0.jre6; = 42.2.0.jre7; = 42.2.1 +93 more 42.2.27, 42.3.8, 42.4.3, 42.5.1 Fixed
postgresql jdbc driver = 42.5.0; = 42.5.0-rc1; >= 42.2.0, < 42.2.27; >= 42.3.0, < 42.3.8 +1 more 42.2.27, 42.3.8, 42.4.3 Fixed
debian linux = 10.0 No fix listed Versions listed
pgjdbc = > 42.3.0, < 42.3.8; = >= 42.2.0, < 42.2.27; = >= 42.4.0, < 42.4.3; = >= 42.5.0, < 42.5.1 No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
org.postgresql/postgresql(Maven) >= 42.2.0, < 42.2.27 42.2.27
org.postgresql/postgresql(Maven) = 42.2.0 No fix listed
org.postgresql/postgresql(Maven) = 42.2.0.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.0.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.1 No fix listed
org.postgresql/postgresql(Maven) = 42.2.1.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.1.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.10 No fix listed
org.postgresql/postgresql(Maven) = 42.2.10.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.10.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.11 No fix listed
org.postgresql/postgresql(Maven) = 42.2.11.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.11.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.12 No fix listed
org.postgresql/postgresql(Maven) = 42.2.12.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.12.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.13 No fix listed
org.postgresql/postgresql(Maven) = 42.2.13.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.13.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.14 No fix listed
org.postgresql/postgresql(Maven) = 42.2.14.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.14.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.15 No fix listed
org.postgresql/postgresql(Maven) = 42.2.15.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.15.jre7 No fix listed
Show 133 more
ProductAffected versionsFixed in
org.postgresql/postgresql(Maven) = 42.2.16 No fix listed
org.postgresql/postgresql(Maven) = 42.2.16.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.16.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.17 No fix listed
org.postgresql/postgresql(Maven) = 42.2.17.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.17.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.18 No fix listed
org.postgresql/postgresql(Maven) = 42.2.18.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.18.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.19 No fix listed
org.postgresql/postgresql(Maven) = 42.2.19.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.19.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.2 No fix listed
org.postgresql/postgresql(Maven) = 42.2.2.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.2.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.20 No fix listed
org.postgresql/postgresql(Maven) = 42.2.20.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.20.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.21 No fix listed
org.postgresql/postgresql(Maven) = 42.2.21.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.21.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.22 No fix listed
org.postgresql/postgresql(Maven) = 42.2.22.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.22.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.23 No fix listed
org.postgresql/postgresql(Maven) = 42.2.23.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.23.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.24 No fix listed
org.postgresql/postgresql(Maven) = 42.2.24.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.24.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.25 No fix listed
org.postgresql/postgresql(Maven) = 42.2.25.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.25.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.26 No fix listed
org.postgresql/postgresql(Maven) = 42.2.26.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.26.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.3 No fix listed
org.postgresql/postgresql(Maven) = 42.2.3.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.3.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.4 No fix listed
org.postgresql/postgresql(Maven) = 42.2.4.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.4.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.5 No fix listed
org.postgresql/postgresql(Maven) = 42.2.5.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.5.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.6.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.6.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.7.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.7.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.8 No fix listed
org.postgresql/postgresql(Maven) = 42.2.8.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.8.jre7 No fix listed
org.postgresql/postgresql(Maven) = 42.2.9 No fix listed
org.postgresql/postgresql(Maven) = 42.2.9.jre6 No fix listed
org.postgresql/postgresql(Maven) = 42.2.9.jre7 No fix listed
org.postgresql/postgresql(Maven) >= 42.3.0, < 42.3.8 42.3.8
org.postgresql/postgresql(Maven) = 42.3.0 No fix listed
org.postgresql/postgresql(Maven) = 42.3.1 No fix listed
org.postgresql/postgresql(Maven) = 42.3.2 No fix listed
org.postgresql/postgresql(Maven) = 42.3.3 No fix listed
org.postgresql/postgresql(Maven) = 42.3.4 No fix listed
org.postgresql/postgresql(Maven) = 42.3.5 No fix listed
org.postgresql/postgresql(Maven) = 42.3.6 No fix listed
org.postgresql/postgresql(Maven) = 42.3.7 No fix listed
org.postgresql/postgresql(Maven) >= 42.4.0, < 42.4.3 42.4.3
org.postgresql/postgresql(Maven) = 42.4.0 No fix listed
org.postgresql/postgresql(Maven) = 42.4.1 No fix listed
org.postgresql/postgresql(Maven) = 42.4.2 No fix listed
org.postgresql/postgresql(Maven) >= 42.5.0, < 42.5.1 42.5.1
org.postgresql/postgresql(Maven) = 42.5.0 No fix listed
pgjdbc = >= 42.2.0, < 42.2.27 No fix listed
pgjdbc = > 42.3.0, < 42.3.8 No fix listed
pgjdbc = >= 42.4.0, < 42.4.3 No fix listed
pgjdbc = >= 42.5.0, < 42.5.1 No fix listed
ubuntu/libpgjava(Ubuntu:22.04) All versions No fix listed
postgresql jdbc driver >= 42.2.0, < 42.2.27 42.2.27
postgresql jdbc driver >= 42.3.0, < 42.3.8 42.3.8
postgresql jdbc driver >= 42.4.0, < 42.4.3 42.4.3
postgresql jdbc driver = 42.5.0 No fix listed
postgresql jdbc driver = 42.5.0-rc1 No fix listed
debian linux = 10.0 No fix listed
ubuntu/libpgjava(Ubuntu:24.04) All versions No fix listed
ubuntu/libpgjava(Ubuntu:26.04) All versions No fix listed
ubuntu/libpgjava(Ubuntu:26.10) All versions No fix listed
debian/libpgjava(Debian:12) < 42.5.1-1 42.5.1-1
debian/libpgjava(Debian:14) < 42.5.1-1 42.5.1-1
debian/libpgjava(Debian:13) < 42.5.1-1 42.5.1-1
ubuntu/libpgjava(Ubuntu:14.04) All versions No fix listed
ubuntu/libpgjava(Ubuntu:14.04) = 9.2-1002-1 No fix listed
ubuntu/libpgjava(Ubuntu:16.04) All versions No fix listed
ubuntu/libpgjava(Ubuntu:16.04) = 9.2-1002-1 No fix listed
ubuntu/libpgjava(Ubuntu:Pro:18.04) All versions No fix listed
ubuntu/libpgjava(Ubuntu:Pro:18.04) = 9.4.1212-1 No fix listed
ubuntu/libpgjava(Ubuntu:Pro:18.04) = 9.4.1212-1ubuntu0.1~esm1 No fix listed
ubuntu/libpgjava(Ubuntu:Pro:20.04) All versions No fix listed
ubuntu/libpgjava(Ubuntu:Pro:20.04) = 42.2.6-1 No fix listed
ubuntu/libpgjava(Ubuntu:Pro:20.04) = 42.2.8-1 No fix listed
ubuntu/libpgjava(Ubuntu:Pro:20.04) = 42.2.9-1 No fix listed
ubuntu/libpgjava(Ubuntu:Pro:20.04) = 42.2.10-1 No fix listed
ubuntu/libpgjava(Ubuntu:Pro:20.04) = 42.2.10-1ubuntu0.1~esm1 No fix listed
ubuntu/libpgjava(Ubuntu:22.04) = 42.2.23-1 No fix listed
ubuntu/libpgjava(Ubuntu:22.04) = 42.2.24-1 No fix listed
ubuntu/libpgjava(Ubuntu:22.04) = 42.3.1-1 No fix listed
ubuntu/libpgjava(Ubuntu:22.04) = 42.3.2-1 No fix listed
ubuntu/libpgjava(Ubuntu:22.04) = 42.3.3-1 No fix listed
ubuntu/libpgjava(Ubuntu:24.04) = 42.5.4-1 No fix listed
ubuntu/libpgjava(Ubuntu:24.04) = 42.6.0-2 No fix listed
ubuntu/libpgjava(Ubuntu:24.04) = 42.7.0-1 No fix listed
ubuntu/libpgjava(Ubuntu:24.04) = 42.7.1-1 No fix listed
ubuntu/libpgjava(Ubuntu:24.04) = 42.7.2-1 No fix listed
ubuntu/libpgjava(Ubuntu:25.10) All versions No fix listed
ubuntu/libpgjava(Ubuntu:25.10) = 42.7.5-1 No fix listed
ubuntu/libpgjava(Ubuntu:25.10) = 42.7.5-2 No fix listed
ubuntu/libpgjava(Ubuntu:25.10) = 42.7.7-1 No fix listed
ubuntu/libpgjava(Ubuntu:26.10) = 42.7.10-1 No fix listed
ubuntu/libpgjava(Ubuntu:26.10) = 42.7.11-1 No fix listed
ubuntu/libpgjava(Ubuntu:26.10) = 42.7.12-1 No fix listed
ubuntu/libpgjava(Ubuntu:26.10) = 42.7.13-1 No fix listed
ubuntu/libpgjava(Ubuntu:26.04) = 42.7.7-1 No fix listed
ubuntu/libpgjava(Ubuntu:26.04) = 42.7.8-1 No fix listed
ubuntu/libpgjava(Ubuntu:26.04) = 42.7.8-2 No fix listed
ubuntu/libpgjava(Ubuntu:26.04) = 42.7.9-1 No fix listed
ubuntu/libpgjava(Ubuntu:26.04) = 42.7.10-1 No fix listed
alpine/java-postgresql-jdbc(Alpine:v3.17) < 42.5.1-r0 42.5.1-r0
alpine/java-postgresql-jdbc(Alpine:v3.18) < 42.5.1-r0 42.5.1-r0
alpine/java-postgresql-jdbc(Alpine:v3.19) < 42.5.1-r0 42.5.1-r0
alpine/java-postgresql-jdbc(Alpine:v3.20) < 42.5.1-r0 42.5.1-r0
alpine/java-postgresql-jdbc(Alpine:v3.21) < 42.5.1-r0 42.5.1-r0
alpine/java-postgresql-jdbc(Alpine:v3.22) < 42.5.1-r0 42.5.1-r0
alpine/java-postgresql-jdbc(Alpine:v3.23) < 42.5.1-r0 42.5.1-r0
alpine/java-postgresql-jdbc(Alpine:v3.24) < 42.5.1-r0 42.5.1-r0

References