CVE-2022-41946: TemporaryFolder on unix-like systems does not limit access to created files in pgjdbc
Noroxi assessment
Priority: Monitor (action score 22/100)
- The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
- Probability of exploitation in the next 30 days: 0.54% (FIRST EPSS).
- Someone with local access to the system can trigger it. A low-privileged account is enough. No user action is required. No special conditions are required; it is repeatable.
- Fixed version: pgjdbc pgjdbc 4.5.0.
Low priority for now. Upgrade to pgjdbc pgjdbc 4.5.0 or later.
Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it
Primary sources: NVD · CVE.org · FIRST EPSS
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
- Nov 23, 2022
- Updated
- Jun 17, 2026
- EPSS
- 0.5% · 45th percentile
- CWE
- CWE-200
Report tools
Action score
22
Monitor
Low priority for now.
- CVSS
- 22 / 40 · 5.5 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 0 / 30 · 0.5%
CNA vs NVD score
- NVD
- 5.5
- CNA · GitHub_M
- 4.7
- 0.8 point gap
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N
The score given by the assigning authority versus NVD’s independent score. A gap means the severity is contested.
Get told when this record changes
- Not in KEV: no record of exploitation in the wild
- No public exploit code on record
- A fix has been released
If any of these changes, we'll tell you in the daily email digest.
Running WordPress? Scan your site free with WP Lens
Noroxi analysis
What does it mean in your environment?
The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.
We use this product, ask for helpAffected systems
Is your version affected?
Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.
| Vendor | Product | CPE |
|---|---|---|
| postgresql | postgresql jdbc driver | cpe:2.3:a:postgresql:postgresql_jdbc_driver |
| debian | debian linux | cpe:2.3:o:debian:debian_linux |
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- debian debian linux10.0
- postgresql postgresql jdbc driver42.2.0 and later · before 42.2.27
- postgresql postgresql jdbc driver42.3.0 and later · before 42.3.8
- postgresql postgresql jdbc driver42.4.0 and later · before 42.4.3
- postgresql postgresql jdbc driver42.5.0
Versions reported by the vendor
Affected version ranges reported by the assigning authority (GitHub_M). Independent of NVD's CPE analysis and usually ahead of it.
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.1affected
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| AlmaLinux:8 | postgresql-jdbc | before 42.2.14-2.el8 | 42.2.14-2.el8 |
| AlmaLinux:8 | postgresql-jdbc-javadoc | before 42.2.14-2.el8 | 42.2.14-2.el8 |
| AlmaLinux:9 | postgresql-jdbc | before 42.2.27-1.el9 | 42.2.27-1.el9 |
| Debian:10 | libpgjava | before 42.2.5-2+deb10u3 | 42.2.5-2+deb10u3 |
| Debian:11 | libpgjava | before 42.2.15-1+deb11u2 | 42.2.15-1+deb11u2 |
| Debian:12 | libpgjava | before 42.5.1-1 | 42.5.1-1 |
| Maven | org.postgresql:postgresql | from 42.2.0 · before 42.2.27 | 42.2.27 |
| Maven | org.postgresql:postgresql | from 42.3.0 · before 42.3.8 | 42.3.8 |
| Maven | org.postgresql:postgresql | from 42.4.0 · before 42.4.3 | 42.4.3 |
| Maven | org.postgresql:postgresql | from 42.5.0 · before 42.5.1 | 42.5.1 |
| openSUSE:Leap 15.4 | postgresql-jdbc | before 42.2.25-150400.3.9.2 | 42.2.25-150400.3.9.2 |
| Red Hat:enterprise_linux:8::appstream | postgresql-jdbc | before 0:42.2.14-2.el8 | 0:42.2.14-2.el8 |
| Red Hat:enterprise_linux:8::appstream | postgresql-jdbc-javadoc | before 0:42.2.14-2.el8 | 0:42.2.14-2.el8 |
| Red Hat:enterprise_linux:9::appstream | postgresql-jdbc | before 0:42.2.27-1.el9 | 0:42.2.27-1.el9 |
| Red Hat:rhev_hypervisor:4.4::el8 | ovirt-ansible-collection | before 0:2.4.2-1.el8ev | 0:2.4.2-1.el8ev |
| Red Hat:rhev_manager:4.4:el8 | ovirt-engine | before 0:4.5.3.7-1.el8ev | 0:4.5.3.7-1.el8ev |
| Red Hat:rhev_manager:4.4:el8 | ovirt-engine-backend | before 0:4.5.3.7-1.el8ev | 0:4.5.3.7-1.el8ev |
| Red Hat:rhev_manager:4.4:el8 | ovirt-engine-dbscripts | before 0:4.5.3.7-1.el8ev | 0:4.5.3.7-1.el8ev |
| Red Hat:rhev_manager:4.4:el8 | ovirt-engine-health-check-bundler | before 0:4.5.3.7-1.el8ev | 0:4.5.3.7-1.el8ev |
| Red Hat:rhev_manager:4.4:el8 | ovirt-engine-restapi | before 0:4.5.3.7-1.el8ev | 0:4.5.3.7-1.el8ev |
| Red Hat:rhev_manager:4.4:el8 | ovirt-engine-setup | before 0:4.5.3.7-1.el8ev | 0:4.5.3.7-1.el8ev |
| Red Hat:rhev_manager:4.4:el8 | ovirt-engine-setup-base | before 0:4.5.3.7-1.el8ev | 0:4.5.3.7-1.el8ev |
| Red Hat:rhev_manager:4.4:el8 | ovirt-engine-setup-plugin-cinderlib | before 0:4.5.3.7-1.el8ev | 0:4.5.3.7-1.el8ev |
| Red Hat:rhev_manager:4.4:el8 | ovirt-engine-setup-plugin-imageio | before 0:4.5.3.7-1.el8ev | 0:4.5.3.7-1.el8ev |
+18
Same product
postgresql: all recordsOther highest-scoring records for the same primary product.
- CVE-2024-1597pgjdbc SQL Injection via line comment generation40Plan
- CVE-2022-26520In pgjdbc before 42.3.3, an attacker (who controls the jdbc URL or properties) can call java.util.logging.FileHandler to write to arbitrary 40Plan
- CVE-2022-21724Unchecked Class Instantiation when providing Plugin Classes40Plan
Published before and after this one in the same product
- ← EarlierCVE-2020-13692Jun 4, 2020 · PostgreSQL JDBC Driver (aka PgJDBC) before 42.2.13 allows XXE.31Monitor
- ← EarlierCVE-2022-31197Aug 3, 2022 · SQL Injection in ResultSet.refreshRow() with malicious column names in pgjdbc33Monitor
- Later →CVE-2025-49146Jun 11, 2025 · pgjdbc Client Allows Fallback to Insecure Authentication Despite channelBinding=require Configuration23Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| pgjdbc pgjdbc | 4.5.0 · description | Vendor (CNA) |
| almalinux:postgresql-jdbc | 42.2.27-1.el9 · AlmaLinux:9 | Package registry (OSV) |
| almalinux:postgresql-jdbc-javadoc | 42.2.14-2.el8 · AlmaLinux:8 | Package registry (OSV) |
| debian:libpgjava | 42.5.1-1 · Debian:12 | Package registry (OSV) |
| Maven:org.postgresql:postgresql | 42.2.27 | Package registry (OSV) |
| Maven:org.postgresql:postgresql | 42.3.8 | Package registry (OSV) |
| Maven:org.postgresql:postgresql | 42.4.3 | Package registry (OSV) |
| Maven:org.postgresql:postgresql | 42.5.1 | Package registry (OSV) |
| opensuse:postgresql-jdbc | 42.2.25-150400.3.9.2 · openSUSE:Leap 15.4 | Package registry (OSV) |
| red hat:ovirt-ansible-collection | 0:2.4.2-1.el8ev · Red Hat:rhev_hypervisor:4.4::el8 | Package registry (OSV) |
| red hat:ovirt-engine | 0:4.5.3.7-1.el8ev · Red Hat:rhev_manager:4.4:el8 | Package registry (OSV) |
| red hat:ovirt-engine-backend | 0:4.5.3.7-1.el8ev · Red Hat:rhev_manager:4.4:el8 | Package registry (OSV) |
| red hat:ovirt-engine-dbscripts | 0:4.5.3.7-1.el8ev · Red Hat:rhev_manager:4.4:el8 | Package registry (OSV) |
| red hat:ovirt-engine-health-check-bundler | 0:4.5.3.7-1.el8ev · Red Hat:rhev_manager:4.4:el8 | Package registry (OSV) |
| red hat:ovirt-engine-restapi | 0:4.5.3.7-1.el8ev · Red Hat:rhev_manager:4.4:el8 | Package registry (OSV) |
| red hat:ovirt-engine-setup | 0:4.5.3.7-1.el8ev · Red Hat:rhev_manager:4.4:el8 | Package registry (OSV) |
| red hat:ovirt-engine-setup-base | 0:4.5.3.7-1.el8ev · Red Hat:rhev_manager:4.4:el8 | Package registry (OSV) |
| red hat:ovirt-engine-setup-plugin-cinderlib | 0:4.5.3.7-1.el8ev · Red Hat:rhev_manager:4.4:el8 | Package registry (OSV) |
| red hat:ovirt-engine-setup-plugin-imageio | 0:4.5.3.7-1.el8ev · Red Hat:rhev_manager:4.4:el8 | Package registry (OSV) |
| red hat:ovirt-engine-setup-plugin-ovirt-engine | 0:4.5.3.7-1.el8ev · Red Hat:rhev_manager:4.4:el8 | Package registry (OSV) |
| red hat:ovirt-engine-setup-plugin-ovirt-engine-common | 0:4.5.3.7-1.el8ev · Red Hat:rhev_manager:4.4:el8 | Package registry (OSV) |
| suse:postgresql-jdbc | 42.2.25-150400.3.9.2 · SUSE:Linux Enterprise Module for Server Applications 15 SP4 | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
FIRST EPSS daily score; only changes of 0.01 or more are recorded (step chart).
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
Credits
All researchersFinders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.
No credits in the CNA record.
Variant candidates
Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.
No nightly-computed relations.
Chain candidates
An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.
—
Bug bounty scope
No known public program.
Source: bounty-targets-data (public HackerOne, Bugcrowd, Intigriti, YesWeHack listings).
Technical details
Attack conditions
- Someone with local access to the system can trigger it.
- A low-privileged account is enough.
- No user action is required.
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- high · data can be read
- Integrity
- none
- Availability
- none
- Attack vector
- Local
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality impact
- High
- Integrity impact
- None
- Availability impact
- None
Weakness class (CWE)
CWE-200 · Exposure of Sensitive Information to an Unauthorized ActorCVSS vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
nvd-primary
Root cause
The extension requests broader permissions than its function needs and sends the data it collects out for purposes beyond its stated function.
The bug in code
The whole CWE-200 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
{
"permissions": ["tabs", "<all_urls>"],
"background": { "service_worker": "analytics.js" }
}Fixed
{
"permissions": ["activeTab"],
"host_permissions": ["https://yildiz.example/*"]
}Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Attack patterns (CAPEC)
- ExcavationCAPEC-116likelihood: High · Medium
- Subverting Environment Variable ValuesCAPEC-13likelihood: High · Very High
- FootprintingCAPEC-169likelihood: High · Very Low
- Exploiting Trust in ClientCAPEC-22likelihood: High · High
- FingerprintingCAPEC-224likelihood: High · Very Low
- ICMP Echo Request PingCAPEC-285likelihood: Medium · Low
- TCP SYN ScanCAPEC-287Low
- Enumerate Mail Exchange (MX) RecordsCAPEC-290Low
ATT&CK techniques
- System Service DiscoveryT1007
- System Network Configuration DiscoveryT1016
- Remote System DiscoveryT1018
- System Owner/User DiscoveryT1033
- Masquerading: Match Legitimate Name or LocationT1036.005
- Network Service ScanningT1046
- System Network Connections DiscoveryT1049
- Process DiscoveryT1057
- Permission Groups DiscoveryT1069
- System Information DiscoveryT1082
- File and Directory DiscoveryT1083
- Account DiscoveryT1087
- Multi-Factor Authentication InterceptionT1111
- Peripheral Device DiscoveryT1120
- System Time DiscoveryT1124
- Access Token Manipulation:Token Impersonation/TheftT1134.001
Change log
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
Show all references (4 more)Show less
Vendor advisories and official records. Exploit/PoC links are deliberately left out.