Lesson 6 of 11 · 6 min read
Insecure Deserialization
Deserialization turns bytes back into objects. Formats that can describe arbitrary objects, such as Python pickle, Java native serialization and unsafe YAML loaders, can be made to call functions during loading, so untrusted input becomes code execution. The fix is to never deserialize untrusted data with such formats: use data-only formats like JSON, safe loaders, schemas, and for machine learning, safetensors instead of pickle-based checkpoints. Signing proves origin, not safety.
free sign-in, no card required
Practise it as an interviewer asks it
What do SQL injection, command injection and template injection have in common, and why does parameterisation fix SQL injection?How does code signing work, what does it guarantee, and what happens when a signing key is stolen?How is securing an LLM application different from ordinary application security, and what stays exactly the same?Explain XSS and how contextual output encoding and CSP prevent it.Why are pickle-based model files dangerous, and what does safetensors fix and not fix?What is SSRF, and why do LLM tools that fetch URLs bring it back?