CVE-2022-41946
CVE-2022-41946 · TemporaryFolder on unix-like systems does not limit access to created files in pgjdbc
CVSS 4.7 · Medium · EPSS 0.6% · Fix available
Compare with your installed version
Affected products and known fixed versions are public information. Compare them with your installed version.
- pgjdbcNo fix published
- java-postgresql-jdbc Alpine 3.17Update to 42.5.1-r0
- java-postgresql-jdbc Alpine 3.18Update to 42.5.1-r0
- java-postgresql-jdbc Alpine 3.19Update to 42.5.1-r0
- and 17 more
Check the installed version:
apk list -I -o java-postgresql-jdbcAssess your server’s risks
The free check gives you a rating and a risk summary by technology stack, without signing up. It does not answer whether this particular vulnerability affects you.
Monitoring matches public information against your servers’ software. Detailed findings for your servers include the order of updates.
curl -fsSL https://patchfirst.dev/check.sh | shChannels carry general technology news; monitoring reports new findings on your servers in your dashboard, through browser notifications, in Telegram or via a webhook.
This page contains facts from public vulnerability sources. Check the original advisory before updating.
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.
- Published
- Updated
Fixes in distributions
- DLA-3995-1 · Debian 11 ·
- RHSA-2023:2097 · Red Hat satellite 6.13 el8, Red Hat satellite capsule 6.13 el8, Red Hat satellite maintenance 6.13 el8, Red Hat satellite utils 6.13 el8 ·
- RHSA-2023:2867 · Red Hat Enterprise Linux 8 appstream ·
- RHSA-2023:2378 · Red Hat Enterprise Linux 9 appstream ·
- RHSA-2023:1630 · Red Hat satellite 6.12 el8 ·
- RHSA-2023:0759 · Red Hat rhev hypervisor 4.4 el8, Red Hat rhev manager 4.4 el8 ·
- ALSA-2023:2867 · AlmaLinux 8 ·
- ALSA-2023:2378 · AlmaLinux 9 ·
- SUSE-SU-2023:0451-1 · SUSE Linux Enterprise Real Time 15 SP3, SUSE Manager Server Module 4.2 ·
- SUSE-SU-2023:0104-1 · SUSE Linux Enterprise Server 12 SP5, SUSE Linux Enterprise Server for SAP Applications 12 SP5 ·
- SUSE-SU-2023:0103-1 · openSUSE Leap 15.4, SUSE Linux Enterprise Module for Server Applications 15 SP4 ·
- DLA-3218-1 · Debian 10 ·
Stack: system
Affected products and versions
pgjdbc
- Versions
- >= 42.2.0, < 42.2.27: Affected
- > 42.3.0, < 42.3.8: Affected
- >= 42.4.0, < 42.4.3: Affected
- >= 42.5.0, < 42.5.1: Affected
No fix published
java-postgresql-jdbc Alpine 3.17
- Affected ranges
- ECOSYSTEM: < 42.5.1-r0
Update to 42.5.1-r0
java-postgresql-jdbc Alpine 3.18
- Affected ranges
- ECOSYSTEM: < 42.5.1-r0
Update to 42.5.1-r0
java-postgresql-jdbc Alpine 3.19
- Affected ranges
- ECOSYSTEM: < 42.5.1-r0
Update to 42.5.1-r0
java-postgresql-jdbc Alpine 3.20
- Affected ranges
- ECOSYSTEM: < 42.5.1-r0
Update to 42.5.1-r0
java-postgresql-jdbc Alpine 3.21
- Affected ranges
- ECOSYSTEM: < 42.5.1-r0
Update to 42.5.1-r0
java-postgresql-jdbc Alpine 3.22
- Affected ranges
- ECOSYSTEM: < 42.5.1-r0
Update to 42.5.1-r0
java-postgresql-jdbc Alpine 3.23
- Affected ranges
- ECOSYSTEM: < 42.5.1-r0
Update to 42.5.1-r0
java-postgresql-jdbc Alpine 3.24
- Affected ranges
- ECOSYSTEM: < 42.5.1-r0
Update to 42.5.1-r0
libpgjava Debian 12
- Affected ranges
- ECOSYSTEM: < 42.5.1-1
Update to 42.5.1-1
libpgjava Debian 13
- Affected ranges
- ECOSYSTEM: < 42.5.1-1
Update to 42.5.1-1
libpgjava Debian 14
- Affected ranges
- ECOSYSTEM: < 42.5.1-1
Update to 42.5.1-1
libpgjava Ubuntu 14.04 LTS
- Versions
- 9.2-1002-1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
libpgjava Ubuntu 16.04 LTS
- Versions
- 9.2-1002-1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
libpgjava Ubuntu Pro 18.04 LTS
- Versions
- 9.4.1212-1
- 9.4.1212-1ubuntu0.1~esm1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
libpgjava Ubuntu Pro 20.04 LTS
- Versions
- 42.2.6-1
- 42.2.8-1
- 42.2.9-1
- 42.2.10-1
- 42.2.10-1ubuntu0.1~esm1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
libpgjava Ubuntu 22.04 LTS
- Versions
- 42.2.23-1
- 42.2.24-1
- 42.3.1-1
- 42.3.2-1
- 42.3.3-1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
libpgjava Ubuntu 24.04 LTS
- Versions
- 42.5.4-1
- 42.6.0-2
- 42.7.0-1
- 42.7.1-1
- 42.7.2-1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
libpgjava Ubuntu 25.10
- Versions
- 42.7.5-1
- 42.7.5-2
- 42.7.7-1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
libpgjava Ubuntu 26.10
- Versions
- 42.7.10-1
- 42.7.11-1
- 42.7.12-1
- 42.7.13-1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
libpgjava Ubuntu 26.04 LTS
- Versions
- 42.7.7-1
- 42.7.8-1
- 42.7.8-2
- 42.7.9-1
- 42.7.10-1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
Original sources
- 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/
- https://lists.debian.org/debian-lts-announce/2024/12/msg00017.html
- https://nvd.nist.gov/vuln/detail/CVE-2022-41946