CVE-2022-41946
published medium CVSS 3.1 · 4.7TemporaryFolder on unix-like systems does not limit access to created files in pgjdbc
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| 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 | Affected | Not stated | GitHub_M |
| AlmaLinux | 8 | postgresql-jdbc | Advisory build | 42.2.14-2.el8 | ALSA-2023:2867 |
| Alpine Linux | edge | java-postgresql-jdbc | Fixed | 42.5.1-r0 | Package fix record |
| Debian | bullseye | libpgjava | Advisory build | 42.2.15-1+deb11u2 | DLA-3995-1 |
| Oracle Linux | 8 | postgresql-jdbcaarch64 | Advisory build | 0:42.2.14-2.el8 | ELSA-2023-2867 |
| Red Hat Enterprise Linux | RHEL-8 | postgresql-jdbcnoarch | Advisory build | 42.2.14-2.el8 | RHSA-2023:2867 |
| SUSE / openSUSE | SLE-12-SP5 | postgresql-jdbcnoarch | Advisory build | 9.4-3.9.1 | SUSE-SU-2023:0104-1 |
| Rocky Linux | 8 | libdb-cxxx86_64 | Listed in advisory | Not stated | RLSA-2023:2097 |
Show 38 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| AlmaLinux | 8 | postgresql-jdbc-javadoc | Advisory build | 42.2.14-2.el8 | ALSA-2023:2867 |
| AlmaLinux | 9 | postgresql-jdbc | Advisory build | 42.2.27-1.el9 | ALSA-2023:2378 |
| Alpine Linux | v3.17 | java-postgresql-jdbc | Fixed | 42.5.1-r0 | Package fix record |
| Alpine Linux | v3.18 | java-postgresql-jdbc | Fixed | 42.5.1-r0 | Package fix record |
| Alpine Linux | v3.19 | java-postgresql-jdbc | Fixed | 42.5.1-r0 | Package fix record |
| Alpine Linux | v3.20 | java-postgresql-jdbc | Fixed | 42.5.1-r0 | Package fix record |
| Alpine Linux | v3.21 | java-postgresql-jdbc | Fixed | 42.5.1-r0 | Package fix record |
| Alpine Linux | v3.22 | java-postgresql-jdbc | Fixed | 42.5.1-r0 | Package fix record |
| Alpine Linux | v3.23 | java-postgresql-jdbc | Fixed | 42.5.1-r0 | Package fix record |
| Alpine Linux | v3.24 | java-postgresql-jdbc | Fixed | 42.5.1-r0 | Package fix record |
| Debian | buster | libpgjava | Advisory build | 42.2.5-2+deb10u3 | DLA-3218-1 |
| Oracle Linux | 8 | postgresql-jdbcx86_64 | Advisory build | 0:42.2.14-2.el8 | ELSA-2023-2867 |
| Oracle Linux | 8 | postgresql-jdbc-javadocaarch64 | Advisory build | 0:42.2.14-2.el8 | ELSA-2023-2867 |
| Oracle Linux | 8 | postgresql-jdbc-javadocx86_64 | Advisory build | 0:42.2.14-2.el8 | ELSA-2023-2867 |
| Oracle Linux | 9 | postgresql-jdbcaarch64 | Advisory build | 0:42.2.27-1.el9 | ELSA-2023-2378 |
| Oracle Linux | 9 | postgresql-jdbcx86_64 | Advisory build | 0:42.2.27-1.el9 | ELSA-2023-2378 |
| Red Hat Enterprise Linux | RHEL-8 | postgresql-jdbcsrc | Advisory build | 42.2.14-2.el8 | RHSA-2023:2867 |
| Red Hat Enterprise Linux | RHEL-8 | postgresql-jdbc-javadocnoarch | Advisory build | 42.2.14-2.el8 | RHSA-2023:2867 |
| Red Hat Enterprise Linux | RHEL-9 | postgresql-jdbcnoarch | Advisory build | 42.2.27-1.el9 | RHSA-2023:2378 |
| Red Hat Enterprise Linux | RHEL-9 | postgresql-jdbcsrc | Advisory build | 42.2.27-1.el9 | RHSA-2023:2378 |
| SUSE / openSUSE | SLE-15-SP3 | postgresql-jdbcnoarch | Advisory build | 42.2.25-150300.3.11.2 | SUSE-SU-2023:0451-1 |
| SUSE / openSUSE | SLE-15-SP4 | postgresql-jdbcnoarch | Advisory build | 42.2.25-150400.3.9.2 | SUSE-SU-2023:0103-1 |
| SUSE / openSUSE | openSUSE-Leap-15.4 | postgresql-jdbcnoarch | Advisory build | 42.2.25-150400.3.9.2 | SUSE-SU-2023:0103-1 |
| SUSE / openSUSE | openSUSE-Leap-15.4 | postgresql-jdbc-javadocnoarch | Advisory build | 42.2.25-150400.3.9.2 | SUSE-SU-2023:0103-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | postgresql-jdbcaarch64 | Advisory build | 42.2.25-4.1 | OPENSUSE-SU-2024:12606-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | postgresql-jdbcppc64le | Advisory build | 42.2.25-4.1 | OPENSUSE-SU-2024:12606-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | postgresql-jdbcs390x | Advisory build | 42.2.25-4.1 | OPENSUSE-SU-2024:12606-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | postgresql-jdbcx86_64 | Advisory build | 42.2.25-4.1 | OPENSUSE-SU-2024:12606-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | postgresql-jdbc-javadocaarch64 | Advisory build | 42.2.25-4.1 | OPENSUSE-SU-2024:12606-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | postgresql-jdbc-javadocppc64le | Advisory build | 42.2.25-4.1 | OPENSUSE-SU-2024:12606-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | postgresql-jdbc-javadocs390x | Advisory build | 42.2.25-4.1 | OPENSUSE-SU-2024:12606-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | postgresql-jdbc-javadocx86_64 | Advisory build | 42.2.25-4.1 | OPENSUSE-SU-2024:12606-1 |
| Rocky Linux | 8 | libdb-cxx-debuginfox86_64 | Listed in advisory | Not stated | RLSA-2023:2097 |
| Rocky Linux | 8 | libdb-debuginfox86_64 | Listed in advisory | Not stated | RLSA-2023:2097 |
| Rocky Linux | 8 | libdb-debugsourcex86_64 | Listed in advisory | Not stated | RLSA-2023:2097 |
| Rocky Linux | 8 | libdb-sql-debuginfox86_64 | Listed in advisory | Not stated | RLSA-2023:2097 |
| Rocky Linux | 8 | libdb-sql-devel-debuginfox86_64 | Listed in advisory | Not stated | RLSA-2023:2097 |
| Rocky Linux | 8 | libdb-utils-debuginfox86_64 | Listed in advisory | Not stated | RLSA-2023:2097 |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 4.7 / 10
- Severity
- medium
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| pgjdbc | pgjdbc | >= 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) | GitHub_M · cna |
Weaknesses
2- CWE-200 CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
- CWE-377 CWE-377: Insecure Temporary File
References
6- https://github.com/pgjdbc/pgjdbc/commit/9008dc9aade6dbfe4efafcd6872ebc55f4699cf5
- https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-562r-vg33-8x8h
- [debian-lts-announce] 20221202 [SECURITY] [DLA 3218-1] libpgjava security update https://lists.debian.org/debian-lts-announce/2022/12/msg00003.html
- https://lists.debian.org/debian-lts-announce/2024/12/msg00017.html
- FEDORA-2023-42d6ba9bd6 https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/25TY2L3RMVNOC7VAHJEAO7PTT6M6JJAD/
- https://security.netapp.com/advisory/ntap-20240329-0003/
Provider assertions
2GitHub_M · cna
TemporaryFolder on unix-like systems does not limit access to created files in pgjdbc
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 687c02592c8683423d1aa820bba5653a1274d108ed1afdb74bb40ed28cf6e615
- Ingested
- 23 Sep 2026, 08:02:45 UTC
- Source record
- Official CVE record