CVE-2022-31139: Unsafe accessor UnsafeAccessor 1.4.0 Until 1.7.0 Has Vulnerability
MODERATECVE-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
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).
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.
<dependency>
<groupId>io.github.karlatemp</groupId>
<artifactId>unsafe-accessor</artifactId>
<version>1.7.0</version>
</dependency>
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
CVE-2022-31139 Affected Unsafe accessor Versions
1 component(s)| 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?
Which Unsafe accessor versions are affected?
What version fixes CVE-2022-31139?
Is unsafe-accessor affected?
What is the CVSS score of CVE-2022-31139?
What CWE is associated with CVE-2022-31139?
How can I check Maven dependencies for CVE-2022-31139?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}