The vulnerability exists in Apache MINA's AbstractIoBuffer class, specifically within the getObject() method's handling of object deserialization. This method creates an anonymous ObjectInputStream subclass to read objects from the buffer. The vulnerability lies in two overridden methods of this anonymous class: resolveClass and readClassDescriptor.
In the vulnerable versions, the resolveClass method had a code path that would call Class.forName() with a class name from the stream without first validating it against the configured acceptMatchers allowlist. This occurred when desc.forClass() returned null.
Similarly, the readClassDescriptor method would read a class name and immediately attempt to load it using Class.forName(), again without any prior validation against the allowlist.
An attacker could exploit this by crafting a serialized object stream containing a malicious class name. When IoBuffer.getObject() is called on this stream, the vulnerable methods would load and potentially instantiate the malicious class, leading to arbitrary code execution.
The patch addresses this by moving the allowlist check to the beginning of both resolveClass and readClassDescriptor, ensuring that Class.forName() is never called with a class name that has not been explicitly allowed.