cve.bz

CVE-2022-41946 Exposure of Resource to Wrong Sphere

5.5 mediumExploit referenceEPSS 0.6%Fix available

Medium (5.5). EPSS 0.6% estimated probability of exploitation activity in the next 30 days. Fixed in org.postgresql:postgresql 42.2.27, 42.3.8, 42.4.3.

On this page
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.

Severity

CVSS 3.1

5.5 medium
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
EPSS
0.6% (unchanged from 0.6% a week ago; 0.5% 30 days ago) estimated probability of exploitation activity in the next 30 days; 48th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWEs
CWE-668 Exposure of Resource to Wrong Sphere
CWE-200 Exposure of Sensitive Information to an Unauthorized Actor
CWE-377 Insecure Temporary File deprecated by MITRE
OWASP Top 10
A01:2025 Broken Access Control
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2022-41946 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2022-41946?via=ask-ai-copy and https://cve.bz/cve/CVE-2022-41946?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2022-41946 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
postgresql:postgresql_jdbc_driverfrom 42.2.0 before 42.2.27
postgresql:postgresql_jdbc_driverfrom 42.3.0 before 42.3.8
postgresql:postgresql_jdbc_driverfrom 42.4.0 before 42.4.3
postgresql:postgresql_jdbc_driver42.5.0
postgresql:postgresql_jdbc_driver42.5.0:rc1
debian:debian_linux10.0

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-562r-vg33-8x8hMavenorg.postgresql:postgresql>=42.2.0 <42.2.2742.2.27
GHSA-562r-vg33-8x8hMavenorg.postgresql:postgresql>=42.3.0 <42.3.842.3.8
GHSA-562r-vg33-8x8hMavenorg.postgresql:postgresql>=42.4.0 <42.4.342.4.3
GHSA-562r-vg33-8x8hMavenorg.postgresql:postgresql>=42.5.0 <42.5.142.5.1

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian10libpgjava42.2.5-2+deb10u3DLA-3218-1
Debian11libpgjava42.2.15-1+deb11u2DLA-3995-1
Debian12, 13, 14libpgjava42.5.1-1DEBIAN-CVE-2022-41946
Ubuntu14.04:LTS, 16.04:LTS, 22.04:LTS and 6 morelibpgjavano fix listedUBUNTU-CVE-2022-41946
Red Hatenterprise_linux:8::appstreampostgresql-jdbc, postgresql-jdbc-javadoc0:42.2.14-2.el8RHSA-2023:2867
Red Hatenterprise_linux:9::appstreampostgresql-jdbc0:42.2.27-1.el9RHSA-2023:2378
Red Hatrhev_hypervisor:4.4::el8, rhev_manager:4.4:el8ovirt-ansible-collection0:2.4.2-1.el8evRHSA-2023:0759
Red Hatrhev_manager:4.4:el8postgresql-jdbc, postgresql-jdbc-javadoc0:42.2.14-2.el8evRHSA-2023:0759
Red Hatrhev_manager:4.4:el8rhvm, ovirt-engine, ovirt-engine-setup and 17 more0:4.5.3.7-1.el8evRHSA-2023:0759
Red Hatsatellite:6.12::el8candlepin, candlepin-selinux0:4.1.20-1.el8satRHSA-2023:1630
Red Hatsatellite:6.13::el8foreman-obsolete-packages0:1.1-1.el8satRHSA-2023:2097
Red Hatsatellite:6.13::el8postgresql-evr0:0.0.2-1.el8satRHSA-2023:2097
Red Hatsatellite:6.13::el8python-websockify, python3-websockify0:0.10.0-3.el8satRHSA-2023:2097
Red Hatsatellite:6.13::el8qpid-dispatch, qpid-dispatch-tools, qpid-dispatch-router and 2 more0:1.14.0-6.el8RHSA-2023:2097
Red Hatsatellite:6.13::el8qpid-proton, qpid-proton-c, python3-qpid-proton and 5 more0:0.33.0-4.el8RHSA-2023:2097
Red Hatsatellite:6.13::el8rubygem-acts_as_list0:1.0.3-2.el8satRHSA-2023:2097
194 more for Red Hat in the JSON and on Red Hat's page.
SUSELinux Enterprise Module for Server Applications 15 SP4postgresql-jdbc42.2.25-150400.3.9.2SUSE-SU-2023:0103-1
SUSELinux Enterprise Real Time 15 SP3, Manager Server Module 4.2postgresql-jdbc42.2.25-150300.3.11.2SUSE-SU-2023:0451-1
SUSELinux Enterprise Server 12 SP5, Linux Enterprise Server for SAP Applications 12 SP5postgresql-jdbc9.4-3.9.1SUSE-SU-2023:0104-1
openSUSELeap 15.4postgresql-jdbc42.2.25-150400.3.9.2SUSE-SU-2023:0103-1
AlmaLinux8postgresql-jdbc, postgresql-jdbc-javadoc42.2.14-2.el8ALSA-2023:2867
AlmaLinux9postgresql-jdbc42.2.27-1.el9ALSA-2023:2378
Alpinev3.17, v3.18, v3.19 and 5 morejava-postgresql-jdbc42.5.1-r0ALPINE-CVE-2022-41946

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

Red Hat Satellite ships a PostgreSQL JDBC Driver for Hibernate ORM framework, which is embeds into Candlepin. Although Candlepin itself doesn't make direct use of the PreparedStatement methods from the PostgreSQL JDBC Driver, Hibernate ORM does utilize these methods, potentially making framework affected. Satellite server operating in an environment with untrusted users while the driver is running are vulnerable to the flaw, however, deployments without untrusted users are considered safe. A future Satellite update should address this issue.

ProductPackageStateAdvisory
CEQ 2.13.2-1Fixed 2023-02-21RHSA-2023:0888
Red Hat build of QuarkusFixed 2023-02-14RHSA-2023:0758
Red Hat build of Quarkus 2.7.7jdbc-postgresqlFixed 2023-03-08RHSA-2023:1006
Red Hat Enterprise Linux 8postgresql-jdbc-0:42.2.14-2.el8Fixed 2023-05-16RHSA-2023:2867
Red Hat Enterprise Linux 9postgresql-jdbc-0:42.2.27-1.el9Fixed 2023-05-09RHSA-2023:2378
Red Hat Fuse 7.12jdbc-postgresqlFixed 2023-06-29RHSA-2023:3954
Red Hat Satellite 6.12 for RHEL 8candlepin-0:4.1.20-1.el8satFixed 2023-04-04RHSA-2023:1630
Red Hat Satellite 6.13 for RHEL 8candlepin-0:4.2.13-1.el8satFixed 2023-05-03RHSA-2023:2097
RHINT Camel-K-1.10.1jdbc-postgresqlFixed 2023-06-28RHSA-2023:3906
RHINT Camel-Q 2.7-1jdbc-postgresqlFixed 2023-03-09RHSA-2023:1177
RHINT Debezium 2.1.4postgresql-jdbcFixed 2023-04-17RHSA-2023:1815
Red Hat build of Apicurio Registry 2jdbc-postgresqlNot affected
Red Hat Enterprise Linux 6postgresql-jdbcOut of support scope
Red Hat Enterprise Linux 7postgresql-jdbcOut of support scope
Red Hat Enterprise Linux 8libreoffice:flatpak/postgresql-jdbcWill not fix
Red Hat Enterprise Linux 9libreoffice:flatpak/postgresql-jdbcAffected
Red Hat Process Automation 7jdbc-postgresqlOut of support scope
Red Hat Virtualization 4postgresql-jdbcFix deferred

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2022-41946.

Attack patterns (CAPEC)

  • CAPEC-149 Explore for Predictable Temporary File Names Severity: Medium
  • CAPEC-155 Screen Temporary Files for Sensitive Information Likelihood: Medium · Severity: Medium

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits. More on the page of CWE-200 (59).

References

Check your stackJSON