CVE-2022-31139: Unsafe accessor UnsafeAccessor 1.4.0 Until 1.7.0 Has Vulnerability

MODERATE
Advisory Identifier: GHSA-cr6p-23cf-w9g9
CVSS 5.9
CWE-200 CWE-863
Published
Advisory Summary

CVE-2022-31139 is a MODERATE (CVSS 5.9) unsafeaccessor 1.4.0 until 1.7.0 has vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Unsafe accessor libraries in the Maven ecosystem. The issue involves unsafeaccessor 1.4.0 until 1.7.0 has no security checking for unsafeaccess.getinstance(). Remediation is available by upgrading affected packages to version 1.7.0.

CVE-2022-31139 at a Glance

CVE Identifier CVE-2022-31139
GHSA Identifier GHSA-cr6p-23cf-w9g9
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product Unsafe accessor
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 5.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2022-31139

To remediate this vulnerability, upgrade all affected Unsafe accessor dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

io.github.karlatemp:unsafe-accessor fixed: 1.7.0
<dependency>
    <groupId>io.github.karlatemp</groupId>
    <artifactId>unsafe-accessor</artifactId>
    <version>1.7.0</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=io.github.karlatemp

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2022-31139, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=io.github.karlatemp

Analyze the terminal output to locate any version of Unsafe accessor in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.7.0), your application is affected.

Note: The mvn dependency:tree -Dincludes=io.github.karlatemp command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In Unsafe accessor, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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](https://github.com/Karlatemp/UnsafeAccessor/commit/4ef83000184e8f13239a1ea2847ee401d81585fd)

CVE-2022-31139 Affected Unsafe accessor Versions

1 component(s)
Fixed Versions:
1.7.0
Product / Package Ecosystem Affected Versions Fixed Version
io.github.karlatemp:unsafe-accessor
Maven
≥ 1.4.0
< 1.7.0
1.7.0

References

Frequently Asked Questions

What is CVE-2022-31139?
CVE-2022-31139 is a security vulnerability in Unsafe accessor involving UnsafeAccessor 1.4.0 until 1.7.0 has no security checking for UnsafeAccess.getInstance() under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which Unsafe accessor versions are affected?
Affected versions include releases prior to 1.7.0 across affected packages: io.github.karlatemp:unsafe-accessor.
What version fixes CVE-2022-31139?
Upgrading to 1.7.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is unsafe-accessor affected?
Yes, io.github.karlatemp:unsafe-accessor is affected in releases prior to 1.7.0. Upgrade your dependency to 1.7.0 or later.
What is the CVSS score of CVE-2022-31139?
CVE-2022-31139 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2022-31139?
CVE-2022-31139 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check Maven dependencies for CVE-2022-31139?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=io.github.karlatemp'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-cr6p-23cf-w9g9",
  "modified" : "2022-07-21T14:59:11Z",
  "published" : "2022-07-12T22:15:53Z",
  "aliases" : [ "CVE-2022-31139" ],
  "summary" : "UnsafeAccessor 1.4.0 until 1.7.0 has no security checking for UnsafeAccess.getInstance()",
  "details" : "### Overview\n\nAffected versions have no limit to using unsafe-accessor. Can be ignored if `SecurityCheck.AccessLimiter` not setup\n\n### Details\n\nIf 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.\nMain application can setup `SecurityCheck.AccessLimiter` for UA to limit accesses to UA.\nUntrusted code can access UA without lmitation in affected versions even UA was loaded as a named module.\n\n### References\n\n[The commit to fix](https://github.com/Karlatemp/UnsafeAccessor/commit/4ef83000184e8f13239a1ea2847ee401d81585fd)\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.github.karlatemp:unsafe-accessor"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.4.0"
      }, {
        "fixed" : "1.7.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Karlatemp/UnsafeAccessor/security/advisories/GHSA-cr6p-23cf-w9g9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-31139"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Karlatemp/UnsafeAccessor/commit/4ef83000184e8f13239a1ea2847ee401d81585fd"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Karlatemp/UnsafeAccessor"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Karlatemp/UnsafeAccessor/releases/tag/1.7.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-863" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-07-12T22:15:53Z",
    "nvd_published_at" : "2022-07-11T19:15:00Z"
  }
}