Critical Vulnerability in libjson-java: Unbalanced Comment String Handling

libjson-java Updated 02 Oct 2025

Summary

04/10/2024
N/A
Yes i
Unrated
Not published

DEBIAN-CVE-2024-47855: util/JSONTokener.java in JSON-lib before 3.1.0 mishandles an unbalanced comment string. Affects libjson-java versions < 3.1.0+dfsg-1. Fixed in 3.1.0+dfsg-1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

libjson-java is a Java library that provides functionality for parsing and generating JSON data. It is widely used in applications that require data interchange in a lightweight format. The library is designed to facilitate easy manipulation of JSON objects and arrays. However, a vulnerability has been identified in versions prior to 3.1.0, where the handling of unbalanced comment strings can lead to unexpected behavior and potential security risks.

Vulnerability Detail

The vulnerability exists in the util/JSONTokener.java file of JSON-lib versions before 3.1.0. It mishandles unbalanced comment strings, which can lead to parsing errors and potentially allow attackers to exploit the application using this library. This could result in denial of service or other unexpected behaviors in applications relying on this library for JSON processing.

How To Fix

Minimum fixed version

3.1.0+dfsg-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade libjson-java

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, ensure that any JSON input processed by the library is sanitized and does not contain unbalanced comment strings. This can help mitigate the risk until the library is updated.

Conclusion

The libjson-java library has a critical vulnerability related to the handling of unbalanced comment strings, which can lead to significant security risks. It is crucial for users of this library to update to the patched version to mitigate these risks. Additionally, utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.

See every vulnerability recorded for libjson-java →

Share this vulnerability

FAQ

The vulnerability involves mishandling unbalanced comment strings in JSON data, which can lead to parsing errors and potential exploitation.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The consequences may include denial of service or unexpected behavior in applications that rely on libjson-java for JSON processing.

Yes, the vulnerability has been patched in version 3.1.0+dfsg-1 of the libjson-java package.

If an immediate update is not possible, ensure that JSON inputs are sanitized to avoid unbalanced comment strings as a temporary measure.

Related vulnerabilities

Recent vulnerabilities recorded for libjson-java.

How To Fix

Minimum fixed version

3.1.0+dfsg-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade libjson-java

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback