CVE-2021-28168
JSON

6.2medium

Local information disclosure via system temporary directory

Severity
6.2medium CVSS:3.1 by eclipse
Exploit likelihood
0.85% (higher than 59% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
eclipse
Also known as
GHSA-c43q-5hpj-4crv

Description

Eclipse Jersey 2.28 to 2.33 and Eclipse Jersey 3.0.0 to 3.0.1 contains a local information disclosure vulnerability. This is due to the use of the File.createTempFile which creates a file inside of the system temporary directory with the permissions: -rw-r--r--. Thus the contents of this file are viewable by all other users locally on the system. As such, if the contents written is security sensitive, it can be disclosed to other local users.

Affected

Product or packageVersionsReported by
The Eclipse Foundation Eclipse Jerseyfrom 2.28 before unspecified, from unspecified up to 2.33, from 3.0.0 before unspecified, from unspecified up to 3.0.1CVE List
org.glassfish.jersey.core:jersey-common (Maven)from 2.28 before 2.34, from 3.0.0 before 3.0.2GitHub Advisory Database
eclipse jerseyfrom 2.28 before 2.34, from 3.0.0 before 3.0.2NVD
oracle communications_cloud_native_core_policy1.15.0NVD
oracle communications_cloud_native_core_unified_data_repository1.15.0NVD

All scores

eclipse6.2medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
GitHub6.2medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
NVD5.5medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
NVD2.1low CVSS:2.0AV:L/AC:L/Au:N/C:P/I:N/A:N

Classification

What each source says

CVE List

Eclipse Jersey 2.28 to 2.33 and Eclipse Jersey 3.0.0 to 3.0.1 contains a local information disclosure vulnerability. This is due to the use of the File.createTempFile which creates a file inside of the system temporary directory with the permissions: -rw-r--r--. Thus the contents of this file are viewable by all other users locally on the system. As such, if the contents written is security sensitive, it can be disclosed to other local users.

GitHub Advisory Database

Impact

Eclipse Jersey 2.28 - 2.33 and Eclipse Jersey 3.0.0 - 3.0.1 contains a local information disclosure vulnerability. This is due to the use of the File.createTempFile which creates a file inside of the system temporary directory with the permissions: -rw-r--r--. Thus the contents of this file are viewable by all other users locally on the system. As such, if the contents written is security sensitive, it can be disclosed to other local users.

Workaround

This issue can be mitigated by manually setting the java.io.tmpdir system property when launching the JVM.

Patches

Jersey 2.34 and 3.0.2 forward sets the correct permissions on the temporary file created by Jersey.

References

Similar Vulnerabilities

Similar, but not the same:


Original Disclosure:

Hello Jersey Security Team,

Utilizing a custom CodeQL query written as a part of the GitHub Security Lab Bug Bounty program, I've unearthed a local temporary file information disclosure vulnerability.

You can see the custom CodeQL query utilized here: https://lgtm.com/query/8831016213790320486/

This particular vulnerability exists because on unix-like systems (not including modern versions of MacOS) the system temporary directory is shared between all users. As such, failure to correctly set file permissions and/or verify exclusive creation of directories can lead to either local information disclosure, or local file hijacking by another user.

This vulnerability impacts the following locations in this project's source:

This vulnerability exists because of the vulnerability in the Utils.createTempFile:

https://github.com/eclipse-ee4j/jersey/blob/01c6a32a2064aeff2caa8133472e33affeb8a29a/core-common/src/main/java/org/glassfish/jersey/message/internal/Utils.java#L42-L53

This is because File.createTempFile creates a file inside of the system temporary directory with the permissions: -rw-r--r--. Thus the contents of this file are viewable by all other users locally on the system.

If there is sensitive information written to these files, it is disclosed to other local users on this system.

The fix for this vulnerability is to use the Files API (instead of the File API) to create temporary files/directories as this new API correctly sets the posix file permissions.

NVD (es)

Eclipse Jersey versiones 2.28 hasta 2.33 y Eclipse Jersey versiones 3.0.0 hasta 3.0.1, contienen una vulnerabilidad de divulgación de información local. Esto es debido al uso de la función File.createTempFile que crea un archivo dentro del directorio temporal del sistema con los permisos:-rw-r--r--. Por lo tanto, el contenido de este archivo es visible para todos los demás usuarios localmente en el sistema. Como tal, si el contenido escrito es sensible a la seguridad, puede ser revelado a otros usuarios locales

References

https://github.com/eclipse-ee4j/jersey/security/advisories/GHSA-c43q-5hpj-4crvthird-party-advisory, web
https://github.com/eclipse-ee4j/jersey/pull/4712patch, third-party-advisory, web
https://lists.apache.org/thread.html/rd54b42edccc1b993853a9c4943a9b16db763f5e2febf6e64b7d0fe3c%40%3Cjira.kafka.apache.org%3Emailing-list
https://lists.apache.org/thread.html/rc6221670de35b819fe191e7d8f2d17bc000549bd554020cec644b71e%40%3Cjira.kafka.apache.org%3Emailing-list
https://lists.apache.org/thread.html/ra3d7cd37fc794981a885332af2f8df0d873753380ea19935d6d847fc%40%3Cdev.kafka.apache.org%3Emailing-list
https://lists.apache.org/thread.html/rc288874c330b3af9e29a1a114c5e0d24fff7a79eaa341f551535c8c0%40%3Cjira.kafka.apache.org%3Emailing-list
https://lists.apache.org/thread.html/r4066176a7352e021d7a81af460044bde8d57f40e98f8e4a31923af3a%40%3Cjira.kafka.apache.org%3Emailing-list
https://lists.apache.org/thread.html/r42fef440487a04cf5e487a9707ef5119d2dd5b809919f25ef4296fc4%40%3Cjira.kafka.apache.org%3Emailing-list
https://lists.apache.org/thread.html/rafc3c4cee534f478cbf8acf91e48373e291a21151f030e8132662a7b%40%3Cjira.kafka.apache.org%3Emailing-list
https://lists.apache.org/thread.html/r454f38e85db149869c5a92c993c402260a4f8599bf283f6cfaada972%40%3Cjira.kafka.apache.org%3Emailing-list
https://lists.apache.org/thread.html/r96658b899fcdbf04947257d201dc5a0abdbb5fb0a8f4ec0a6c15e70f%40%3Cjira.kafka.apache.org%3Emailing-list
https://lists.apache.org/thread.html/r6dadc8fe82071aba841d673ffadf34728bff4357796b1990a66e3af1%40%3Ccommits.kafka.apache.org%3Emailing-list

Sources

SourceRecordLicence
CVE ListCVE-2021-28168 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-c43q-5hpj-4crv changed 2026-09-10CC-BY-4.0
NVDCVE-2021-28168 changed 2026-06-17Public domain