CVE-2025-59328: Apache Fory Deserialization of Untrusted Data vulnerability
6.5
Basic Information
Technical Details
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
org.apache.fory:fory-core | maven | < 0.12.2 | 0.12.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability in Apache Fory (CVE-2025-59328) is a Denial of Service (DoS) caused by the insecure deserialization of untrusted data. An attacker can provide a specially crafted, deeply nested object graph. When the Fory library attempts to deserialize this data, it enters a deep recursion without any limits on the nesting depth. This leads to excessive CPU and memory consumption, ultimately causing the application to become unresponsive.
The security patch mitigates this by introducing a configurable maximum deserialization depth (maxDepth
), which defaults to 50. The core deserialization logic was updated to track the current depth and throw an InsecureException
if this limit is exceeded, thus preventing the DoS attack.
The identified vulnerable functions are the key methods involved in the recursive deserialization process for different data types (general objects, collections, maps). Before the patch, these functions lacked the necessary depth checks. The provided patch evidence clearly shows the addition of the incReadDepth()
call, which contains the new security check, directly within these functions or their closely-related helpers. Any deserialization operation that involves nested data structures would pass through these functions, making them the focal point of the vulnerability.
Vulnerable functions
org.apache.fory.Fory.readData
java/fory-core/src/main/java/org/apache/fory/Fory.java
org.apache.fory.serializer.collection.CollectionLikeSerializer.read
java/fory-core/src/main/java/org/apache/fory/serializer/collection/CollectionLikeSerializer.java
org.apache.fory.serializer.collection.MapLikeSerializer.read
java/fory-core/src/main/java/org/apache/fory/serializer/collection/MapLikeSerializer.java
org.apache.fory.serializer.AbstractObjectSerializer.read
java/fory-core/src/main/java/org/apache/fory/serializer/AbstractObjectSerializer.java
org.apache.fory.Fory.xreadNonRef
java/fory-core/src/main/java/org/apache/fory/Fory.java