Deserialization is an input boundary
Deserializing untrusted bytes can execute dangerous gadget chains or consume excessive resources. Avoid native Java serialization for untrusted input and validate all external data.
ObjectInputFilter(Java 9+) can allowlist classes and limit depth, references and array sizes for native serialization. Corrections or other cases welcome below.Deserializing bytes from an untrusted source can trigger gadget chains and exhaust resources. Native Java serialization should not be used for untrusted input, and external data needs validation.
Untrusted object streams are an attack surface: they can run dangerous chains of classes or consume huge amounts of memory. Choose a data format that parses into plain values and validate what comes in.
Clear note on java / security. "Deserialization is an input boundary" is the kind of detail that is easy to overlook.
Clear note on java / security. "Deserialization is an input boundary" is the kind of detail that is easy to overlook.
Input bytes handed to ObjectInputStream count as a trust boundary, even for internal-looking traffic. Keep native serialization off that path and check all external payloads before use.
Good to see "Deserialization is an input boundary" written down. Handy reference for anyone working with java / security.
Specific and to the point: "Deserialization is an input boundary". Worth a look if you touch java / security.
Appreciate the write-up on "Deserialization is an input boundary". Useful for anyone using java / security.