CVE-2022-31139
JSON

5.9medium

No security checking for UnsafeAccess.getInstance() in UnsafeAccessor

Severity
5.9medium CVSS:3.1 by GitHub_M
Exploit likelihood
1.22% (higher than 69% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-cr6p-23cf-w9g9

Description

UnsafeAccessor (UA) is a bridge to access jdk.internal.misc.Unsafe & sun.misc.Unsafe. Normally, if UA is loaded as a named module, the internal data of UA is protected by JVM and others can only access UA via UA's standard API. The main application can set up `SecurityCheck.AccessLimiter` for UA to limit access to UA. Starting with version 1.4.0 and prior to version 1.7.0, when `SecurityCheck.AccessLimiter` is set up, untrusted code can access UA without limitation, even when UA is loaded as a named module. This issue does not affect those for whom `SecurityCheck.AccessLimiter` is not set up. Version 1.7.0 contains a patch.

Affected

Product or packageVersionsReported by
Karlatemp UnsafeAccessor>= 1.4.0, < 1.7.0CVE List
io.github.karlatemp:unsafe-accessor (Maven)from 1.4.0 before 1.7.0GitHub Advisory Database
unsafe_accessor_project unsafe_accessorfrom 1.4.0 before 1.7.0NVD

All scores

GitHub_M5.9medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
GitHub5.9medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
NVD4.3medium CVSS:2.0AV:N/AC:M/Au:N/C:P/I:N/A:N

Classification

CWE-200CWE-863

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

UnsafeAccessor (UA) is a bridge to access jdk.internal.misc.Unsafe & sun.misc.Unsafe. Normally, if UA is loaded as a named module, the internal data of UA is protected by JVM and others can only access UA via UA's standard API. The main application can set up `SecurityCheck.AccessLimiter` for UA to limit access to UA. Starting with version 1.4.0 and prior to version 1.7.0, when `SecurityCheck.AccessLimiter` is set up, untrusted code can access UA without limitation, even when UA is loaded as a named module. This issue does not affect those for whom `SecurityCheck.AccessLimiter` is not set up. Version 1.7.0 contains a patch.

GitHub Advisory Database
Overview

Affected versions have no limit to using unsafe-accessor. Can be ignored if SecurityCheck.AccessLimiter not setup

Details

If UA was loaded as a named module, the internal data of UA will be protected by JVM and others can only access UA via UA's standard api. Main application can setup SecurityCheck.AccessLimiter for UA to limit accesses to UA. Untrusted code can access UA without lmitation in affected versions even UA was loaded as a named module.

References

The commit to fix

NVD (es)

UnsafeAccessor (UA) es un puente para acceder a jdk.internal.misc.Unsafe y sun.misc.Unsafe. Normalmente, si UA es cargado como un módulo con nombre, los datos internos de UA están protegidos por la JVM y otros sólo pueden acceder a UA por medio de la API estándar de UA. La aplicación principal puede configurar "SecurityCheck.AccessLimiter" para UA para limitar el acceso a UA. A partir de la versión 1.4.0 y versiones anteriores a 1.7.0, cuando es configurado "SecurityCheck.AccessLimiter", el código que no es confiable puede acceder a la UA sin limitaciones, incluso cuando la UA es cargado como un módulo con nombre. Este problema no afecta a aquellos para los que no ha sido configurado "SecurityCheck.AccessLimiter". La versión 1.7.0 contiene un parche

References

Sources

SourceRecordLicence
CVE ListCVE-2022-31139 changed 2025-04-23CVE Terms of Use
GitHub Advisory DatabaseGHSA-cr6p-23cf-w9g9 changed 2024-02-16CC-BY-4.0
NVDCVE-2022-31139 changed 2026-06-17Public domain