CVE-2022-41946TemporaryFolder on unix-like systems does not limit access to created files in pgjdbc
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.
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
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.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | libpgjava | Fix pending | UBUNTU-CVE-2022-41946 | |
| Ubuntu 26.04 | libpgjava | Under investigation | UBUNTU-CVE-2022-41946 | |
| Ubuntu 25.10 | libpgjava | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2022-41946 | |
| Ubuntu 24.04 | libpgjava | Under investigation | UBUNTU-CVE-2022-41946 | |
| Ubuntu 22.04 | libpgjava | Under investigation | UBUNTU-CVE-2022-41946 | |
| Ubuntu 20.04 | libpgjava | Fix pending | UBUNTU-CVE-2022-41946 | |
| Ubuntu 18.04 | libpgjava | Fix pending | UBUNTU-CVE-2022-41946 | |
| Ubuntu 16.04 | libpgjava | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2022-41946 | |
| Ubuntu 14.04 | libpgjava | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2022-41946 | |
| Debian 14 | libpgjava | Fixed | 42.5.1-1 | DEBIAN-CVE-2022-41946 |
| Debian 13 | libpgjava | Fixed | 42.5.1-1 | DEBIAN-CVE-2022-41946 |
| Debian 12 | libpgjava | Fixed | 42.5.1-1 | DEBIAN-CVE-2022-41946 |
| Red Hat Enterprise Linux 9 | postgresql-jdbc | Fixed Affected | 0:42.2.27-1.el9 | RHSA-2023:2378 |
| Red Hat Enterprise Linux 8 | postgresql-jdbc | Fixed Will not fix | 0:42.2.14-2.el8 | RHSA-2023:2867 |
| Red Hat Enterprise Linux 8 | postgresql-jdbc-javadoc | Fixed Will not fix | 0:42.2.14-2.el8 | RHSA-2023:2867 |
| Red Hat Enterprise Linux 7 | postgresql-jdbc | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | postgresql-jdbc-javadoc | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | postgresql-jdbc | Will not fix Out of support scope | ||
| AlmaLinux 9 | postgresql-jdbc | Fixed | 42.2.27-1.el9 | ALSA-2023:2378 |
| AlmaLinux 8 | postgresql-jdbc | Fixed | 42.2.14-2.el8 | ALSA-2023:2867 |
| AlmaLinux 8 | postgresql-jdbc-javadoc | Fixed | 42.2.14-2.el8 | ALSA-2023:2867 |
| Alpine Linux 3.24 | java-postgresql-jdbc | Fixed | 42.5.1-r0 | ALPINE-CVE-2022-41946 |
| Alpine Linux 3.23 | java-postgresql-jdbc | Fixed | 42.5.1-r0 | ALPINE-CVE-2022-41946 |
| Alpine Linux 3.22 | java-postgresql-jdbc | Fixed | 42.5.1-r0 | ALPINE-CVE-2022-41946 |
| Alpine Linux 3.21 | java-postgresql-jdbc | Fixed | 42.5.1-r0 | ALPINE-CVE-2022-41946 |
| Alpine Linux 3.20 | java-postgresql-jdbc | Fixed | 42.5.1-r0 | ALPINE-CVE-2022-41946 |
| Alpine Linux 3.19 | java-postgresql-jdbc | Fixed | 42.5.1-r0 | ALPINE-CVE-2022-41946 |
| Alpine Linux 3.18 | java-postgresql-jdbc | Fixed | 42.5.1-r0 | ALPINE-CVE-2022-41946 |
| Alpine Linux 3.17 | java-postgresql-jdbc | Fixed | 42.5.1-r0 | ALPINE-CVE-2022-41946 |
| Maven library | org.postgresql:postgresql | Fixed | 42.2.27 | GHSA-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.
- pgjdbc: affected: >= 42.2.0, < 42.2.27, > 42.3.0, < 42.3.8, >= 42.4.0, < 42.4.3, >= 42.5.0, < 42.5.1
Vendor advisories:
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
References
- https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-562r-vg33-8x8h
- https://github.com/pgjdbc/pgjdbc/commit/9008dc9aade6dbfe4efafcd6872ebc55f4699cf5
- https://lists.debian.org/debian-lts-announce/2022/12/msg00003.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/25TY2L3RMVNOC7VAHJEAO7PTT6M6JJAD/
- https://security.netapp.com/advisory/ntap-20240329-0003/
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.