Skip to main content

Practice ยท 1 of 3

Defuse Deserialization

Implement load_payload(data: bytes) that safely decodes untrusted payloads: try JSON (utf-8) and return the object; on any failure raise ValueError('unsafe payload'). The docstring must promise never to use pickle (graders check json is used and pickle is NOT).

Difficulty: intermediate

Back to lesson: Practice: Security Audit Drills