2 ms·
> The bug is that doing deserialization safely is difficult in the presence of inheritance, since it's an open-world type system. Well, yes and no. Java's open
by pron 11y ago
> The bug is that doing deserialization safely is difficult in the presence of inheritance, since it's an open-world type system.
Well, yes and no. Java's open-world type system is one of its greatest features. To counteract any security holes this may cause, Java has a very strong security model, where each piece of executable code is associated with a security context based on its origin, and what it is allowed to do is restricted by a security policy based on the code's domain. In this case, however, no foreign code was directly introduced. It was found to be possible to exploit code already found within the application's safe domain (a third-party library).
The Java solution is simple: during deserialization of external data, treat execute custom deserialization code as if it was foreign, and execute it within a foreign security context. It's best if this was done directly in the JDK code, and I assume a patch will adress this.