Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2022-41946

MEDIUM 4.7EPSS 30%

TemporaryFolder on unix-like systems does not limit access to created files in pgjdbc

Also known as BIT-postgresql-jdbc-driver-2022-41946, GHSA-562r-vg33-8x8h

Mitigation

  • Upgrade org.postgresql:postgresql to one of 42.2.27, 42.3.8, 42.4.3, 42.5.1 (or later in the same release line).

Who should check

  • Projects that depend on Maven package org.postgresql:postgresql (>= 42.2.0, < 42.2.27)
  • Anyone running 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

Vulnerability facts

Affected
org.postgresql:postgresql >= 42.2.0, < 42.2.27
Fixed in
42.2.27, 42.3.8, 42.4.3, 42.5.1
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Not remotely exploitable (local or adjacent access needed)
CVSS
4.7 (v3.1, CNA)CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:NOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Local
  • Attack complexity: High
  • Privileges required: Low
  • User interaction: None
  • Scope: Unchanged
  • Confidentiality impact: High
  • Integrity impact: None
  • Availability impact: None
EPSS
0.44% chance of exploitation in 30 days (percentile 30, 2026-11-26)
CWE
CWE-200, CWE-377
Published
Modified

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.

Affected and fixed versions

Package / productAffectedFixedSource
Maven org.postgresql:postgresql>= 42.2.0, < 42.2.2742.2.27, 42.3.8, 42.4.3, 42.5.1osv
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—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2022-41946. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-41946.md
Affected: org.postgresql:postgresql >= 42.2.0, < 42.2.27
Fixed in: 42.2.27, 42.3.8, 42.4.3, 42.5.1

Steps:
1. Search this machine and project for org.postgresql:postgresql (Maven), pgjdbc: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

References

FAQ

Is CVE-2022-41946 being exploited?

There is no confirmed exploitation: CVE-2022-41946 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.44% chance of exploitation in the next 30 days (as of 2026-11-26).

How serious is CVE-2022-41946?

Medium: CVSS 4.7 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.

Which versions are affected by CVE-2022-41946?

org.postgresql:postgresql >= 42.2.0, < 42.2.27.

Is there a fix for CVE-2022-41946?

Yes. Fixed in 42.2.27, 42.3.8, 42.4.3, 42.5.1. Upgrade org.postgresql:postgresql to one of 42.2.27, 42.3.8, 42.4.3, 42.5.1 (or later in the same release line).

How do I check if I'm affected by CVE-2022-41946?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors