CVE-2023-2798: Htmlunit Unrestricted Recursion Vulnerability
HIGHCVE-2023-2798 is a HIGH (CVSS 7.5) unrestricted recursion vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Htmlunit libraries in the Maven ecosystem. The issue involves unrestricted recursion in htmlunit. Remediation is available by upgrading affected packages to version 2.70.0.
CVE-2023-2798 at a Glance
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).
How to Fix CVE-2023-2798
To remediate this vulnerability, upgrade all affected Htmlunit dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>org.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
<version>2.70.0</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.htmlunit
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2023-2798, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.htmlunit
Analyze the terminal output to locate any version of Htmlunit in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.70.0), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.htmlunit 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Htmlunit, 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
CVE-2023-2798 Affected Htmlunit Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.htmlunit:htmlunit
|
Maven |
< 2.70.0
|
2.70.0
|
References
Frequently Asked Questions
What is CVE-2023-2798?
Which Htmlunit versions are affected?
What version fixes CVE-2023-2798?
Is htmlunit affected?
What is the CVSS score of CVE-2023-2798?
What CWE is associated with CVE-2023-2798?
How can I check Maven dependencies for CVE-2023-2798?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-rc44-5cmh-879m",
"modified" : "2023-05-25T17:02:56Z",
"published" : "2023-05-25T15:30:17Z",
"aliases" : [ "CVE-2023-2798" ],
"summary" : "Unrestricted recursion in htmlunit",
"details" : "Those using HtmlUnit to browse untrusted webpages may be vulnerable to Denial of service attacks (DoS). If HtmlUnit is running on user supplied web pages, an attacker may supply content that causes HtmlUnit to crash by a stack overflow. This effect may support a denial of service attack. This issue affects HtmlUnit before 2.70.0.\n\n",
"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" : "org.htmlunit:htmlunit"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.70.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-2798"
}, {
"type" : "WEB",
"url" : "https://github.com/HtmlUnit/htmlunit/commit/940dc7fd"
}, {
"type" : "WEB",
"url" : "https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54613"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/HtmlUnit/htmlunit"
}, {
"type" : "WEB",
"url" : "https://github.com/HtmlUnit/htmlunit/releases/tag/2.70.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400", "CWE-787" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-05-25T17:02:56Z",
"nvd_published_at" : "2023-05-25T14:15:10Z"
}
}