{"id":"CVE-2022-41946","published":"2022-11-23T00:00:00Z","modified":"2025-11-03T21:46:35Z","title":"TemporaryFolder on unix-like systems does not limit access to created files in pgjdbc","vendor":"pgjdbc","product":"pgjdbc","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":4.7,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00569,"percentile":0.48049,"provenance":"source"},"cwes":[{"id":"CWE-200","name":"Exposure of Sensitive Information to an Unauthorized Actor"},{"id":"CWE-377","name":"Insecure Temporary File"}],"references":[{"url":"https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-562r-vg33-8x8h","tags":[]},{"url":"https://github.com/pgjdbc/pgjdbc/commit/9008dc9aade6dbfe4efafcd6872ebc55f4699cf5","tags":[]},{"url":"https://lists.debian.org/debian-lts-announce/2022/12/msg00003.html","tags":["mailing-list"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/25TY2L3RMVNOC7VAHJEAO7PTT6M6JJAD/","tags":["vendor-advisory"]},{"url":"https://security.netapp.com/advisory/ntap-20240329-0003/","tags":[]},{"url":"https://lists.debian.org/debian-lts-announce/2024/12/msg00017.html","tags":[]}],"priority":{"score":12.9,"factors":[{"name":"EPSS percentile","points":9.61},{"name":"CVSS severity","points":3.29}]},"vendorSlug":"pgjdbc","affectedVersions":[{"vendor":"pgjdbc","product":"pgjdbc","versions":[">= 42.2.0, < 42.2.27","> 42.3.0, < 42.3.8",">= 42.4.0, < 42.4.3",">= 42.5.0, < 42.5.1"]}],"affected":[{"ecosystem":"Maven","package":"org.postgresql:postgresql","vulnerableRanges":[">=42.2.0, <42.2.27",">=42.3.0, <42.3.8",">=42.4.0, <42.4.3",">=42.5.0, <42.5.1"],"patched":["42.2.27","42.3.8","42.4.3","42.5.1"],"from":["GHSA-562r-vg33-8x8h"],"provenance":"source"}],"summary":{"text":"The pgjdbc PostgreSQL JDBC driver creates temporary files when a prepared statement is given an InputStream larger than 2 KB via setText or setBytea, and on Unix-like systems (not macOS) those files land in the shared system temporary directory where they are readable by other local users. An attacker with local, low-privilege access on the same system can read that data, but only while the driver is writing it there and only if the temporary directory has not been redirected, with no ability to modify it and no user interaction required.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:52:44Z"},"euvd":{"id":"EUVD-2022-7235","exploited":false,"provenance":"source"},"lineage":{"children":[{"from":"CVE-2022-41946","to":"CVE-2023-33251","relation":"related","confidence":"low","kind":"lineage","evidence":[{"kind":"text","provenance":"source","relation":"related","quote":"…Akka HTTP before 10.5.2 accepts file uploads via the FileUploadDirectives.fileUploadAll directive, the temporary file it creates has too weak permissions: it is readable by other users on Linux or UNIX, a similar issue to CVE-2022-41946.","from":"CVE.org","in":"CVE-2023-33251"}]}],"packageHistory":[{"cve":"CVE-2022-21724","published":"2022-02-02","fixed":"42.3.2","kev":false},{"cve":"CVE-2022-26520","published":"2022-03-07","fixed":"42.3.3","kev":false},{"cve":"CVE-2022-31197","published":"2022-08-03","fixed":"42.4.1","kev":false,"link":{"from":"CVE-2022-31197","to":"CVE-2022-41946","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Maven:org.postgresql:postgresql","fromFixed":"42.2.26","toFixed":"42.2.27","daysApart":112}]}},{"cve":"CVE-2022-41946","published":"2022-11-23","fixed":"42.5.1","kev":false},{"cve":"CVE-2024-1597","published":"2024-02-19","fixed":"42.7.2","kev":false,"link":{"from":"CVE-2022-41946","to":"CVE-2024-1597","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Maven:org.postgresql:postgresql","fromFixed":"42.2.27","toFixed":"42.2.28","daysApart":453}]}},{"cve":"CVE-2025-49146","published":"2025-06-11","fixed":"42.7.7","kev":false},{"cve":"CVE-2026-42198","published":"2026-04-29","fixed":"42.7.11","kev":false}],"package":"Maven:org.postgresql:postgresql"}}