CVE-2022-41946: TemporaryFolder on unix-like systems does not limit access to created files in pgjdbc
Vulnerability summary
CVE-2022-41946 is a medium (CVSS 5.5) vulnerability in debian debian_linux. EPSS estimates a 0.57% chance of exploitation in the next 30 days, higher than 48.5% of scored vulnerabilities. 1 public exploit is recorded.
Not severe (CVSS 4.7, local access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Advisory lineage
Upstream 0 · Downstream 2Timeline
- 23-11-2022PublishedVulnerability first disclosed.
- 03-11-2025Last modifiedVulnerability information updated.
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.
CVSS metrics
7 scores · 7 sources · 1 version- CVE.orgCNA4.7MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:NDiffers
- OSV · Red hatEcosystem advisory · calculated5.5MediumCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
- OSV · UbuntuEcosystem advisory · calculated5.5MediumCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
- OSV · DebianEcosystem advisory · calculated5.5MediumCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
- OSV · MavenEcosystem advisory · calculated4.7MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:NDiffers
- OSV · AlpineEcosystem advisory · calculated5.5MediumCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
EPSS trend
Probability
0.57%
Chance of exploitation in the next 30 days
Percentile
49%
Versus all other CVEs
30-day change
Increase +0.02 pp
From 0.55% on 04-11-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
1 foundPgjdbc
Maturity: poc
Weaknesses
CWE · root cause- CWE-200Exposure of Sensitive Information to an Unauthorized ActorThe product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
- CWE-377DEPRECATED: Insecure Temporary FileThis entry has been deprecated. It was focused only on the affected resource (temporary file) and not the behavior or mistake that produced the insecure temporary file, which caused confusion and incorrect mappings.
- CWE-668Exposure of Resource to Wrong SphereThe product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.
Affected systems
Known conditions: local access, low-privilege account, no user interaction (CVSS vector). Other conditions: not stated in public data.
Redhat25 products
- candlepin< 0:4.1.20-1.el8sat
- candlepin-selinux< 0:4.1.20-1.el8sat
- ovirt-ansible-collection< 0:2.4.2-1.el8ev
- ovirt-engine< 0:4.5.3.7-1.el8ev
- ovirt-engine-backend< 0:4.5.3.7-1.el8ev
Suse5 products
- postgresql-jdbc&distro=SUSE Linux Enterprise Module for Server Applications 15 SP4< 42.2.25-150400.3.9.2
- postgresql-jdbc&distro=SUSE Linux Enterprise Real Time 15 SP3< 42.2.25-150300.3.11.2
- postgresql-jdbc&distro=SUSE Linux Enterprise Server 12 SP5< 9.4-3.9.1
- postgresql-jdbc&distro=SUSE Linux Enterprise Server for SAP Applications 12 SP5< 9.4-3.9.1
- postgresql-jdbc&distro=SUSE Manager Server Module 4.2< 42.2.25-150300.3.11.2
Debian2 products
- libpgjava< 42.2.5-2+deb10u3 | < 42.5.1-1
- debian_linuxEOL10.0
Alpine1 product
- java-postgresql-jdbc< 42.5.1-r0
Opensuse1 product
- postgresql-jdbc&distro=openSUSE Leap 15.4< 42.2.25-150400.3.9.2
Org.postgresql1 product
- postgresql≥ 42.2.0, < 42.2.27 | ≥ 42.3.0, < 42.3.8 | ≥ 42.4.0, < 42.4.3 | ≥ 42.5.0, < 42.5.1
Pgjdbc1 product
- 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
Postgresql1 product
- 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
Ubuntu1 product
- libpgjavaAll versions (No fix recorded)
9 vendors · 38 products
References
52 links- github.com/pgjdbc/pgjdbc/security/advisories/GHSA-562r-vg33-8x8hREPORTWEBExploitPatchThird Party Advisory
- lists.fedoraproject.org/archives/…Vendor Advisory
Show all 52 references
- github.com/pgjdbc/pgjdbcPACKAGE