CVE-2021-31684: Json smart Out Of Bounds Read Vulnerability
HIGHCVE-2021-31684 is a HIGH (CVSS 7.5) out of bounds read vulnerability (CWE-125: Out-of-bounds Read) affecting Json smart libraries in the Maven ecosystem. The issue involves out of bounds read in json-smart. Remediation is available by upgrading affected packages to version 1.3.3, 2.4.4.
CVE-2021-31684 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2021-31684
To remediate this vulnerability, upgrade all affected Json smart 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>net.minidev</groupId>
<artifactId>json-smart</artifactId>
<version>1.3.3</version>
</dependency>
<dependency>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
<version>2.4.4</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=net.minidev
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2021-31684, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=net.minidev
Analyze the terminal output to locate any version of Json smart in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.3), your application is affected.
Note: The mvn dependency:tree -Dincludes=net.minidev 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-125: Out-of-bounds Read, where the product reads data past the end, or before the beginning, of the intended buffer. In Json smart, 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-2021-31684 Affected Json smart Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
net.minidev:json-smart
|
Maven |
≥ 1.3.0
< 1.3.3
|
1.3.3
|
|
net.minidev:json-smart
|
Maven |
≥ 2.4.0
< 2.4.4
|
2.4.4
|
References
Frequently Asked Questions
What is CVE-2021-31684?
Which Json smart versions are affected?
What version fixes CVE-2021-31684?
Is json-smart affected?
What is the CVSS score of CVE-2021-31684?
What CWE is associated with CVE-2021-31684?
How can I check Maven dependencies for CVE-2021-31684?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-fg2v-w576-w4v3",
"modified" : "2024-06-21T21:33:50Z",
"published" : "2022-02-10T22:46:22Z",
"aliases" : [ "CVE-2021-31684" ],
"summary" : "Out of bounds read in json-smart",
"details" : "A vulnerability was discovered in the indexOf function of JSONParserByteArray in JSON Smart versions prior to 1.3.3 and 2.4.5 which causes a denial of service (DOS) via a crafted web request.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "net.minidev:json-smart"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.3.0"
}, {
"fixed" : "1.3.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "net.minidev:json-smart"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.4.0"
}, {
"fixed" : "2.4.4"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-31684"
}, {
"type" : "WEB",
"url" : "https://github.com/netplex/json-smart-v1/issues/10"
}, {
"type" : "WEB",
"url" : "https://github.com/netplex/json-smart-v2/issues/67"
}, {
"type" : "WEB",
"url" : "https://github.com/netplex/json-smart-v1/pull/11"
}, {
"type" : "WEB",
"url" : "https://github.com/netplex/json-smart-v2/pull/68"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/netplex/json-smart-v1"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2023/03/msg00030.html"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20240621-0006"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpujan2022.html"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpujul2022.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-125", "CWE-787" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-06-02T20:27:42Z",
"nvd_published_at" : "2021-06-01T20:15:00Z"
}
}