CVE-2023-1370
json-smart Uncontrolled Recursion vulnerability
Description
Impact
Affected versions of net.minidev:json-smart are vulnerable to Denial of Service (DoS) due to a StackOverflowError when parsing a deeply nested JSON array or object.
When reaching a ‘[‘ or ‘{‘ character in the JSON input, the code parses an array or an object respectively. It was discovered that the 3PP does not have any limit to the nesting of such arrays or objects. Since the parsing of nested arrays and objects is done recursively, nesting too many of them can cause stack exhaustion (stack overflow) and crash the software.
Patches
This vulnerability was fixed in json-smart version 2.4.9, but the maintainer recommends upgrading to 2.4.10, due to a remaining bug.
Workarounds
N/A
References
- https://www.cve.org/CVERecord?id=CVE-2023-1370
- https://nvd.nist.gov/vuln/detail/CVE-2023-1370
- https://security.snyk.io/vuln/SNYK-JAVA-NETMINIDEV-3369748
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| net.minidev » json-smart | < 2.4.9 | 2.4.9 |
Blast radius
54% of the dependent artifacts (11,380) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 41,781 |
| 2 hops | 300,434 |
| 3 hops | 566,245 |
| 4 hops | 475,280 |
| 5 hops | 318,673 |
| 6 hops | 160,028 |
Most used dependents
- org.springframework.boot » spring-boot-starter-test20,993 usages
- org.apache.hadoop » hadoop-common3,482 usages
- org.apache.spark » spark-sql3,174 usages
- org.apache.spark » spark-core2,899 usages
- com.jayway.jsonpath » json-path2,686 usages
- com.github.tomakehurst » wiremock1,838 usages
- com.nimbusds » nimbus-jose-jwt1,826 usages
- org.apache.hadoop » hadoop-client1,796 usages
- org.springframework.boot » spring-boot-test1,728 usages
- org.apache.kafka » kafka1,450 usages
- org.springframework.cloud » spring-cloud-starter-openfeign1,389 usages
- org.apache.hadoop » hadoop-mapreduce-client-core1,366 usages
- com.microsoft.sqlserver » mssql-jdbc1,206 usages
- org.springframework.cloud » spring-cloud-commons1,205 usages
- com.github.tomakehurst » wiremock-jre81,180 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
References
- Advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2023-1370
- Webhttps://github.com/netplex/json-smart-v2/issues/137
- Webhttps://github.com/netplex/json-smart-v2/commit/5b3205d051952d3100aa0db1535f6ba6226bd87a
- Webhttps://github.com/netplex/json-smart-v2/commit/e2791ae506a57491bc856b439d706c81e45adcf8
- Packagehttps://github.com/oswaldobapvicjr/jsonmerge
- Webhttps://research.jfrog.com/vulnerabilities/stack-exhaustion-in-json-smart-leads-to-denial-of-service-when-parsing-malformed-json-xray-427633
- Webhttps://security.netapp.com/advisory/ntap-20240621-0006
- Webhttps://security.snyk.io/vuln/SNYK-JAVA-NETMINIDEV-3369748
- Webhttps://www.cve.org/CVERecord?id=CVE-2023-1370
