The vulnerability is a deserialization issue in Logback's receiver component that can lead to Denial-of-Service. The analysis of the provided commit patches reveals two main areas of weakness that were addressed:
- Specific Deserialization Flaw in
LoggingEventVO: The readObject method in ch.qos.logback.classic.spi.LoggingEventVO did not validate the length of an array (argumentArray) it was deserializing. Attackers could provide an extremely large or negative length, causing excessive memory allocation or errors. The patch added explicit checks for this array length.
- Lack of General Hardening in
HardenedObjectInputStream: The constructors of ch.qos.logback.core.net.HardenedObjectInputStream did not, by default, apply any global filters to the ObjectInputStream to restrict properties like maximum array elements or maximum object graph depth during deserialization. This meant that even if class whitelisting was used, the structure of the serialized data itself could be exploited for DoS. The patches address this by adding a call to initObjectFilter within the constructors, which sets up an ObjectInputFilter with predefined limits.
Therefore, the vulnerable functions are identified as the readObject method of LoggingEventVO due to its missing validation, and the constructors of HardenedObjectInputStream because they previously failed to establish a sufficiently secure deserialization stream by default.