In this lecture we examine the risks of binary serialization in Java: why deserialization from untrusted sources is dangerous (“gadget chains”, RCE), what threats special methods like
readObject and
readResolve pose, and how to defend yourself (whitelisting, opting for
JSON/
XML, safe libraries such as
Jackson). We will look in detail at class version compatibility and the role of the
serialVersionUID field, behavior on
InvalidClassException, the constraints of
transient/
static, performance, as well as best practices and common mistakes.