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

Exp

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: 2022-11-23 Last update: 2025-11-03 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2022-41946 is rated Exploit Available (50/100): CVSS Medium severity, with low exploitation likelihood (EPSS 0.10%). Core evidence: 1 public exploit reference(s) are indexed (Exploit-DB). Mandatory action: Public exploits are available—assess exposure, apply mitigations, and prioritize patching.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Public exploit references (Exploit-DB) for CVE-2022-41946

EDB-ID Source Kind Published Link
nvd_ref exploit_tag Exploit-DB ↗

Exploit prediction scoring system (EPSS) score for CVE-2022-41946

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-01-04 0.04% 0.10% +0.06%
2 2026-01-01 0.08% 0.04% -0.05%
3 2025-12-04 0.08%

Full EPSS history (20 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2022-41946

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
4.7 3.1 MEDIUM
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N Click to expand
Attack vector (AV:L)
They already need access on the box, or another person has to do something wrong; it’s not a remote drive-by.
Attack complexity (AC:H)
Even with access, the exploit needs extra luck, timing, or a fussy environment to actually work.
Privileges required (PR:L)
A normal user session is enough; they don’t have to be admin.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:N)
Data isn’t meaningfully altered or forged.
Availability (A:N)
Service keeps running; no real outage angle.
1.0 3.6 [email protected]
5.5 3.1 MEDIUM
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N Click to expand
Attack vector (AV:L)
They already need access on the box, or another person has to do something wrong; it’s not a remote drive-by.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:L)
A normal user session is enough; they don’t have to be admin.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:N)
Data isn’t meaningfully altered or forged.
Availability (A:N)
Service keeps running; no real outage angle.
1.8 3.6 [email protected]

Weakness enumeration for CVE-2022-41946

GitHub Security Advisory for CVE-2022-41946

GHSA-562r-vg33-8x8h · Severity: medium · Ecosystem: maven — TemporaryFolder on unix-like systems does not limit access to created files

OS Trackers for CVE-2022-41946

vendor priority summary link
alpine CVE-2022-41946: 1 source package rows (java-postgresql-jdbc); 7 state rows across 7 repos (3.17-community, 3.18-community, 3.19-community, 3.20-community, 3.21-community, 3.22-community, edge-community); fixed 7, open 0. https://security.alpinelinux.org/vuln/CVE-2022-41946
debian not yet assigned CVE-2022-41946 not yet assigned priority: Debian including 1 source packages (libpgjava), 5 status rows across 5 suites (bookworm, bullseye, forky, sid, trixie): resolved 5. https://security-tracker.debian.org/tracker/CVE-2022-41946
redhat medium https://access.redhat.com/security/cve/CVE-2022-41946
suse medium https://www.suse.com/security/cve/CVE-2022-41946/
ubuntu low CVE-2022-41946 low priority: Ubuntu including 1 source packages (libpgjava), 13 status rows across 13 suites (bionic, focal, jammy, kinetic, lunar, mantic, noble, oracular, plucky, questing, trusty, upstream, xenial): needs-triage 8, ignored 5. https://ubuntu.com/security/CVE-2022-41946

Affected software / configurations for CVE-2022-41946

Vendor Product Version Raw CPE
postgresql postgresql_jdbc_driver >= 42.2.0, < 42.2.27 cpe:2.3:a:postgresql:postgresql_jdbc_driver:*:*:*:*:*:*:*:*
postgresql postgresql_jdbc_driver >= 42.3.0, < 42.3.8 cpe:2.3:a:postgresql:postgresql_jdbc_driver:*:*:*:*:*:*:*:*
postgresql postgresql_jdbc_driver >= 42.4.0, < 42.4.3 cpe:2.3:a:postgresql:postgresql_jdbc_driver:*:*:*:*:*:*:*:*
postgresql postgresql_jdbc_driver 42.5.0 cpe:2.3:a:postgresql:postgresql_jdbc_driver:42.5.0:-:*:*:*:*:*:*
postgresql postgresql_jdbc_driver 42.5.0 cpe:2.3:a:postgresql:postgresql_jdbc_driver:42.5.0:rc1:*:*:*:*:*:*
debian debian_linux 10.0 cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*

References for CVE-2022-41946

cvelogic Threat Intelligence