CVE-2022-45690: Hutool json Hutool-json Stack Overflow Vulnerability Vulnerability

MODERATE
Advisory Identifier: GHSA-whgh-g24c-3j5q
Published
Advisory Summary

CVE-2022-45690 is a MODERATE hutool-json stack overflow vulnerability vulnerability (General Security Weakness) affecting Hutool json libraries in the Maven ecosystem. The issue involves hutool-json stack overflow vulnerability. Remediation is available by upgrading affected packages to version 5.8.11.

CVE-2022-45690 at a Glance

CVE Identifier CVE-2022-45690
GHSA Identifier GHSA-whgh-g24c-3j5q
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Hutool json
Package Ecosystem Maven
Published Date
Last Updated

How to Fix CVE-2022-45690

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

cn.hutool:hutool-json fixed: 5.8.11
<dependency>
    <groupId>cn.hutool</groupId>
    <artifactId>hutool-json</artifactId>
    <version>5.8.11</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=cn.hutool

How to Check if You Are Affected

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

mvn dependency:tree -Dincludes=cn.hutool

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

Note: The mvn dependency:tree -Dincludes=cn.hutool 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 General Security Weakness. In Hutool json, 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

A stack overflow in the org.json.JSONTokener.nextValue::JSONTokener.java component of hutool-json v5.8.10 allows attackers to cause a Denial of Service (DoS) via crafted JSON or XML data.

CVE-2022-45690 Affected Hutool json Versions

1 component(s)
Fixed Versions:
5.8.11
Product / Package Ecosystem Affected Versions Fixed Version
cn.hutool:hutool-json
Maven
< 5.8.11
5.8.11

References

Frequently Asked Questions

What is CVE-2022-45690?
CVE-2022-45690 is a security vulnerability in Hutool json involving hutool-json stack overflow vulnerability under General Security Weakness.
Which Hutool json versions are affected?
Affected versions include releases prior to 5.8.11 across affected packages: cn.hutool:hutool-json.
What version fixes CVE-2022-45690?
Upgrading to 5.8.11 (or the latest patched release for your respective branch) resolves the vulnerability.
Is hutool-json affected?
Yes, cn.hutool:hutool-json is affected in releases prior to 5.8.11. Upgrade your dependency to 5.8.11 or later.
What CWE is associated with CVE-2022-45690?
CVE-2022-45690 is classified under General Security Weakness.
How can I check Maven dependencies for CVE-2022-45690?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=cn.hutool'. 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-whgh-g24c-3j5q",
  "modified" : "2022-12-13T19:23:13Z",
  "published" : "2022-12-13T15:30:26Z",
  "aliases" : [ "CVE-2022-45690" ],
  "summary" : "hutool-json stack overflow vulnerability",
  "details" : "A stack overflow in the org.json.JSONTokener.nextValue::JSONTokener.java component of hutool-json v5.8.10 allows attackers to cause a Denial of Service (DoS) via crafted JSON or XML data.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "cn.hutool:hutool-json"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.8.11"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.8.10"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-45690"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dromara/hutool/issues/2746"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/stleary/JSON-java/issues/654"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/stleary/JSON-java/commit/7a124d857dc8da1165c87fa788e53359a317d0f7"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/dromara/hutool"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-12-13T19:23:13Z",
    "nvd_published_at" : "2022-12-13T15:15:00Z"
  }
}