CVE-2023-39685: hjson-java Denial of Service Vulnerability

org.hjson:hjson Updated 02 Oct 2025

Summary

01/09/2023
Yes i
High
7.5

CVE-2023-39685: hson-java vulnerable to denial of service. Affects org.hjson:hjson versions < 3.0.1. Fixed in 3.0.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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

hjson-java is a Java library that provides a fast and convenient way to parse and generate JSON data. It is commonly used in Java applications to handle JSON data structures. However, versions up to 3.0.0 of hjson-java are vulnerable to a Denial of Service (DoS) attack. This vulnerability can be exploited by supplying a crafted JSON string, leading to a StringIndexOutOfBoundsException and causing the application to crash or become unresponsive.

Vulnerability Detail

The vulnerability in hjson-java arises from a lack of proper input validation when parsing JSON strings. By providing a specially crafted JSON string, an attacker can trigger a StringIndexOutOfBoundsException, leading to a DoS condition. This can result in the application crashing or becoming unresponsive, potentially impacting the availability of the affected system. The vulnerability has been assigned the identifier CVE-2023-39685.

How To Fix

Minimum fixed version

3.0.1

This is the first release that contains the fix.

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

Workaround

As a temporary workaround, developers can implement input validation checks on JSON strings before passing them to the hjson-java library. By ensuring that the JSON strings are properly formatted and within expected bounds, the risk of triggering the vulnerability can be reduced. Here is an example of how to perform input validation in Java:

String jsonString = ...; // JSON string input

if (jsonString.length() > MAX_JSON_LENGTH) {
    // Handle or reject the JSON string
}

// Pass the validated JSON string to hjson-java

Conclusion

The hjson-java library up to version 3.0.0 is vulnerable to a Denial of Service (DoS) attack due to improper input validation. To mitigate this vulnerability, it is recommended to upgrade to version 3.0.1 or later of hjson-java and perform input validation on JSON strings. Vulert's playground can be used to check if your application is affected by this vulnerability. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for org.hjson:hjson →

Share this vulnerability

FAQ

hjson-java is a Java library that provides JSON parsing and generation capabilities. It is commonly used in Java applications to handle JSON data structures.

A Denial of Service (DoS) attack is a malicious attempt to disrupt the normal functioning of a system or network by overwhelming it with a flood of illegitimate requests or data. In the case of this vulnerability, a DoS attack can be triggered by supplying a crafted JSON string to hjson-java, causing the application to crash or become unresponsive.

A StringIndexOutOfBoundsException is a runtime exception in Java that occurs when an attempt is made to access a character at an invalid index within a string. In the context of this vulnerability, a crafted JSON string can trigger this exception, leading to a DoS condition.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities, using just the pom.xml file to provide vulnerability information without requiring access to the code or installation.

To fix the vulnerability, you should upgrade to version 3.0.1 or later of hjson-java. Update your Maven dependencies to include the latest version of hjson-java and ensure that your application uses the updated library. Performing input validation on JSON strings before passing them to hjson-java can also help mitigate the risk.

Related vulnerabilities

Recent vulnerabilities recorded for org.hjson:hjson.

How To Fix

Minimum fixed version

3.0.1

This is the first release that contains the fix.

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