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

- Priority: **Routine**
- Reason: Not severe (CVSS 4.7, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2022-11-23 · Modified: 2025-11-03
- Aliases: SUSE-SU-2023:0103-1, SUSE-SU-2023:0104-1, SUSE-SU-2023:0451-1, RHSA-2023:0759, RHSA-2023:1630, RHSA-2023:2378, RHSA-2023:2867, UBUNTU-CVE-2022-41946, DEBIAN-CVE-2022-41946, DLA-3218-1, GHSA-562r-vg33-8x8h, BIT-postgresql-jdbc-driver-2022-41946, ALPINE-CVE-2022-41946
- Record: https://cvemate.com/vulnerability/CVE-2022-41946 · JSON: https://cvemate.com/vulnerability/CVE-2022-41946/json

## Description

```text
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.
```

## Signals

- CVSS: 5.5 medium (v3.1, NVD) CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
- EPSS: 0.569%, percentile 48.584%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 1 (github)

## Affected (first 20 of 38)

- alpine java-postgresql-jdbc (Alpine Linux): \< 42.5.1-r0
- debian libpgjava (Debian): \< 42.2.5-2+deb10u3 \| \< 42.5.1-1
- ubuntu libpgjava (Ubuntu): All versions (No fix recorded)
- debian debian\_linux: 10.0
- org.postgresql postgresql (Maven): ≥ 42.2.0, \< 42.2.27 \| ≥ 42.3.0, \< 42.3.8 \| ≥ 42.4.0, \< 42.4.3 \| ≥ 42.5.0, \< 42.5.1
- pgjdbc pgjdbc: ≥ 42.2.0, \< 42.2.27 \| \> 42.3.0, \< 42.3.8 \| ≥ 42.4.0, \< 42.4.3 \| ≥ 42.5.0, \< 42.5.1
- postgresql postgresql\_jdbc\_driver: ≥ 42.2.0, \< 42.2.27 \| ≥ 42.3.0, \< 42.3.8 \| ≥ 42.4.0, \< 42.4.3 \| 42.5.0 \| 42.5.0:rc1
- opensuse postgresql-jdbc&distro=openSUSE Leap 15.4 (openSUSE): \< 42.2.25-150400.3.9.2
- redhat candlepin (Red Hat): \< 0:4.1.20-1.el8sat
- redhat candlepin-selinux (Red Hat): \< 0:4.1.20-1.el8sat
- redhat ovirt-ansible-collection (Red Hat): \< 0:2.4.2-1.el8ev
- redhat ovirt-engine (Red Hat): \< 0:4.5.3.7-1.el8ev
- redhat ovirt-engine-backend (Red Hat): \< 0:4.5.3.7-1.el8ev
- redhat ovirt-engine-dbscripts (Red Hat): \< 0:4.5.3.7-1.el8ev
- redhat ovirt-engine-health-check-bundler (Red Hat): \< 0:4.5.3.7-1.el8ev
- redhat ovirt-engine-restapi (Red Hat): \< 0:4.5.3.7-1.el8ev
- redhat ovirt-engine-setup (Red Hat): \< 0:4.5.3.7-1.el8ev
- redhat ovirt-engine-setup-base (Red Hat): \< 0:4.5.3.7-1.el8ev
- redhat ovirt-engine-setup-plugin-cinderlib (Red Hat): \< 0:4.5.3.7-1.el8ev
- redhat ovirt-engine-setup-plugin-imageio (Red Hat): \< 0:4.5.3.7-1.el8ev

## References (first 20 of 52)

- <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://www.suse.com/support/update/announcement/2023/suse-su-20230103-1/>
- <https://bugzilla.suse.com/1206921>
- <https://www.suse.com/security/cve/CVE-2022-41946>
- <https://www.suse.com/support/update/announcement/2023/suse-su-20230104-1/>
- <https://www.suse.com/support/update/announcement/2023/suse-su-20230451-1/>
- <https://access.redhat.com/errata/RHSA-2023:0759>
- <https://access.redhat.com/security/updates/classification/#moderate>
- <https://bugzilla.redhat.com/show_bug.cgi?id=2151549>
- <https://bugzilla.redhat.com/show_bug.cgi?id=2153399>
- <https://bugzilla.redhat.com/show_bug.cgi?id=2159768>
- <https://bugzilla.redhat.com/show_bug.cgi?id=2161703>
- <https://security.access.redhat.com/data/csaf/v2/advisories/2023/rhsa-2023_0759.json>
- <https://access.redhat.com/security/cve/CVE-2022-41946>
- <https://www.cve.org/CVERecord?id=CVE-2022-41946>

---

Data as of 2026-12-05T05:10:25.603Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
