CVEfocus › CVE database › CVE-2022-41946

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

CVSS 4.7 MediumEPSS 0.4% (higher than 30% of CVEs)Published 2022-11-23Updated 2025-11-03Assigner: GitHub_M

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.

CWE-200CWE-377

What to do

Fixed builds are available from AlmaLinux, Alpine, Debian, Maven, Red Hat: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

18Fixed
3Fix pending
3Under investigation
6Will not fix

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.10libpgjavaFix pendingUBUNTU-CVE-2022-41946
Ubuntu 26.04libpgjavaUnder investigationUBUNTU-CVE-2022-41946
Ubuntu 25.10libpgjavaWill not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2022-41946
Ubuntu 24.04libpgjavaUnder investigationUBUNTU-CVE-2022-41946
Ubuntu 22.04libpgjavaUnder investigationUBUNTU-CVE-2022-41946
Ubuntu 20.04libpgjavaFix pendingUBUNTU-CVE-2022-41946
Ubuntu 18.04libpgjavaFix pendingUBUNTU-CVE-2022-41946
Ubuntu 16.04libpgjavaWill not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2022-41946
Ubuntu 14.04libpgjavaWill not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2022-41946
Debian 14libpgjavaFixed42.5.1-1DEBIAN-CVE-2022-41946
Debian 13libpgjavaFixed42.5.1-1DEBIAN-CVE-2022-41946
Debian 12libpgjavaFixed42.5.1-1DEBIAN-CVE-2022-41946
Red Hat Enterprise Linux 9postgresql-jdbcFixed
Affected
0:42.2.27-1.el9RHSA-2023:2378
Red Hat Enterprise Linux 8postgresql-jdbcFixed
Will not fix
0:42.2.14-2.el8RHSA-2023:2867
Red Hat Enterprise Linux 8postgresql-jdbc-javadocFixed
Will not fix
0:42.2.14-2.el8RHSA-2023:2867
Red Hat Enterprise Linux 7postgresql-jdbcWill not fix
Out of support scope
Red Hat Enterprise Linux 7postgresql-jdbc-javadocWill not fix
Out of support scope
Red Hat Enterprise Linux 6postgresql-jdbcWill not fix
Out of support scope
AlmaLinux 9postgresql-jdbcFixed42.2.27-1.el9ALSA-2023:2378
AlmaLinux 8postgresql-jdbcFixed42.2.14-2.el8ALSA-2023:2867
AlmaLinux 8postgresql-jdbc-javadocFixed42.2.14-2.el8ALSA-2023:2867
Alpine Linux 3.24java-postgresql-jdbcFixed42.5.1-r0ALPINE-CVE-2022-41946
Alpine Linux 3.23java-postgresql-jdbcFixed42.5.1-r0ALPINE-CVE-2022-41946
Alpine Linux 3.22java-postgresql-jdbcFixed42.5.1-r0ALPINE-CVE-2022-41946
Alpine Linux 3.21java-postgresql-jdbcFixed42.5.1-r0ALPINE-CVE-2022-41946
Alpine Linux 3.20java-postgresql-jdbcFixed42.5.1-r0ALPINE-CVE-2022-41946
Alpine Linux 3.19java-postgresql-jdbcFixed42.5.1-r0ALPINE-CVE-2022-41946
Alpine Linux 3.18java-postgresql-jdbcFixed42.5.1-r0ALPINE-CVE-2022-41946
Alpine Linux 3.17java-postgresql-jdbcFixed42.5.1-r0ALPINE-CVE-2022-41946
Maven libraryorg.postgresql:postgresqlFixed42.2.27GHSA-562r-vg33-8x8h

What the vendor says

As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Vendor advisories:

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.