Denial of Service (DoS) Affecting org.codehaus.jettison:jettison package, versions [,1.5.4)
Snyk CVSS
Attack Complexity
Low
Availability
High
Threat Intelligence
Exploit Maturity
Proof of concept
EPSS
0.08% (32nd
percentile)
Do your applications use this vulnerable package?
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applications- Snyk ID SNYK-JAVA-ORGCODEHAUSJETTISON-3367610
- published 22 Mar 2023
- disclosed 22 Mar 2023
- credit JFrog Research Team
Introduced: 22 Mar 2023
CVE-2023-1436 Open this link in a new tabHow to fix?
Upgrade org.codehaus.jettison:jettison
to version 1.5.4 or higher.
Overview
Affected versions of this package are vulnerable to Denial of Service (DoS) due to infinite recursion, when constructing a JSONArray
from a Collection that contains a self-reference in one of its elements.
Exploiting this vulnerability results in a StackOverflowError
exception being thrown.
Mitigation
Wrap Jettison's JSONArray constructor with exception handling:
try {
JSONArray jsonArray = new JSONArray(list);
}
catch(StackOverflowError e) {
System.err.println("ERROR: Stack limit reached");
}
PoC
public class POC {
public static void main(String[] args) throws JSONException {
ArrayList<Object> list = new ArrayList<>();
list.add(list);
JSONArray jsonArray = new JSONArray(list);
}
}