CVE-2021-23900: Json sanitizer Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-8rf5-92jh-3vc9
CVSS 7.5
CWE-248
Published
Advisory Summary

CVE-2021-23900 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-248: Uncaught Exception) affecting Json sanitizer libraries in the Maven ecosystem. The issue involves uncaught exception leading to denial of service in json-sanitizer. Remediation is available by upgrading affected packages to version 1.2.2.

CVE-2021-23900 at a Glance

CVE Identifier CVE-2021-23900
GHSA Identifier GHSA-8rf5-92jh-3vc9
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-248: Uncaught Exception
Affected Product Json sanitizer
Package Ecosystem Maven
Published Date
Last Updated

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).

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

How to Fix CVE-2021-23900

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

com.mikesamuel:json-sanitizer fixed: 1.2.2
<dependency>
    <groupId>com.mikesamuel</groupId>
    <artifactId>json-sanitizer</artifactId>
    <version>1.2.2</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=com.mikesamuel

How to Check if You Are Affected

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

mvn dependency:tree -Dincludes=com.mikesamuel

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

Note: The mvn dependency:tree -Dincludes=com.mikesamuel 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-248: Uncaught Exception, where an exception is thrown from a function, but it is not caught. In Json sanitizer, 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

OWASP json-sanitizer before 1.2.2 can output invalid JSON or throw an undeclared exception for crafted input. This may lead to denial of service if the application is not prepared to handle these situations.

CVE-2021-23900 Affected Json sanitizer Versions

1 component(s)
Fixed Versions:
1.2.2
Product / Package Ecosystem Affected Versions Fixed Version
com.mikesamuel:json-sanitizer
Maven
< 1.2.2
1.2.2

References

Frequently Asked Questions

What is CVE-2021-23900?
CVE-2021-23900 is a security vulnerability in Json sanitizer involving Uncaught Exception leading to Denial of Service in json-sanitizer under CWE-248: Uncaught Exception.
Which Json sanitizer versions are affected?
Affected versions include releases prior to 1.2.2 across affected packages: com.mikesamuel:json-sanitizer.
What version fixes CVE-2021-23900?
Upgrading to 1.2.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is json-sanitizer affected?
Yes, com.mikesamuel:json-sanitizer is affected in releases prior to 1.2.2. Upgrade your dependency to 1.2.2 or later.
What is the CVSS score of CVE-2021-23900?
CVE-2021-23900 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2021-23900?
CVE-2021-23900 is classified under CWE-248: Uncaught Exception (An exception is thrown from a function, but it is not caught.).
How can I check Maven dependencies for CVE-2021-23900?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=com.mikesamuel'. 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-8rf5-92jh-3vc9",
  "modified" : "2021-04-06T21:46:21Z",
  "published" : "2021-05-13T22:31:32Z",
  "aliases" : [ "CVE-2021-23900" ],
  "summary" : "Uncaught Exception leading to Denial of Service in json-sanitizer",
  "details" : "OWASP json-sanitizer before 1.2.2 can output invalid JSON or throw an undeclared exception for crafted input. This may lead to denial of service if the application is not prepared to handle these situations.",
  "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" : "com.mikesamuel:json-sanitizer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.2.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-23900"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/OWASP/json-sanitizer/commit/a37f594f7378a1c76b3283e0dab9e1ab1dc0247e"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/OWASP/json-sanitizer/compare/v1.2.1...v1.2.2"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/g/json-sanitizer-support/c/dAW1AeNMoA0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-248" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-04-06T21:46:21Z",
    "nvd_published_at" : "2021-01-13T16:15:00Z"
  }
}