CVE-2024-47855: Json lib core JSON-lib Mishandles An Unbalanced Comment Vulnerability

MODERATE
Advisory Identifier: GHSA-wwcp-26wc-3fxm
CVSS 5.3
Published
Advisory Summary

CVE-2024-47855 is a MODERATE (CVSS 5.3) json-lib mishandles an unbalanced comment vulnerability (General Security Weakness) affecting Json lib core libraries in the Maven ecosystem. The issue involves json-lib mishandles an unbalanced comment string. Remediation is available by upgrading affected packages to version 3.1.0.

CVE-2024-47855 at a Glance

CVE Identifier CVE-2024-47855
GHSA Identifier GHSA-wwcp-26wc-3fxm
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification General Security Weakness
Affected Product Json lib core
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 5.3

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

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 Low (A:L)

How to Fix CVE-2024-47855

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

org.kordamp.json:json-lib-core fixed: 3.1.0
<dependency>
    <groupId>org.kordamp.json</groupId>
    <artifactId>json-lib-core</artifactId>
    <version>3.1.0</version>
</dependency>
net.sf.json-lib:json-lib fixed: Latest secure release
<dependency>
    <groupId>net.sf.json-lib</groupId>
    <artifactId>json-lib</artifactId>
    <version>Latest secure release</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=org.kordamp.json

How to Check if You Are Affected

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

mvn dependency:tree -Dincludes=org.kordamp.json

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

Note: The mvn dependency:tree -Dincludes=org.kordamp.json 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 Json lib core, 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

util/JSONTokener.java in JSON-lib before 3.1.0 mishandles an unbalanced comment string.

CVE-2024-47855 Affected Json lib core Versions

2 component(s)
Fixed Versions:
3.1.0
Product / Package Ecosystem Affected Versions Fixed Version
org.kordamp.json:json-lib-core
Maven
< 3.1.0
3.1.0
net.sf.json-lib:json-lib
Maven
≤ 2.4

References

Frequently Asked Questions

What is CVE-2024-47855?
CVE-2024-47855 is a security vulnerability in Json lib core involving JSON-lib mishandles an unbalanced comment string under General Security Weakness.
Which Json lib core versions are affected?
Affected versions include releases prior to 3.1.0 across affected packages: org.kordamp.json:json-lib-core, net.sf.json-lib:json-lib.
What version fixes CVE-2024-47855?
Upgrading to 3.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is json-lib-core affected?
Yes, org.kordamp.json:json-lib-core is affected in releases prior to 3.1.0. Upgrade your dependency to 3.1.0 or later.
Is json-lib affected?
Yes, net.sf.json-lib:json-lib is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2024-47855?
CVE-2024-47855 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2024-47855?
CVE-2024-47855 is classified under General Security Weakness.
How can I check Maven dependencies for CVE-2024-47855?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.kordamp.json'. 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-wwcp-26wc-3fxm",
  "modified" : "2026-04-16T18:11:17Z",
  "published" : "2024-10-04T06:30:45Z",
  "aliases" : [ "CVE-2024-47855" ],
  "summary" : "JSON-lib mishandles an unbalanced comment string",
  "details" : "util/JSONTokener.java in JSON-lib before 3.1.0 mishandles an unbalanced comment string.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.kordamp.json:json-lib-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.1.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "net.sf.json-lib:json-lib"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "2.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-47855"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kordamp/json-lib/commit/a0c4a0eae277130e22979cf307c95dec4005a78e"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/kordamp/json-lib"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kordamp/json-lib/blob/35a1f2aa22bac260438c0cf2399549311b5a21aa/pom.xml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kordamp/json-lib/compare/v3.0.3...v3.1.0"
  }, {
    "type" : "WEB",
    "url" : "https://sourceforge.net/projects/json-lib"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-10-04T18:51:45Z",
    "nvd_published_at" : "2024-10-04T06:15:04Z"
  }
}