The Ravens report importer deserializes an object, builds the class its __type field names, and triggers its behaviour. The Report type is harmless, but the Command type is a gadget that performs a server action on deserialize, leaking server data. This simulates code execution via insecure deserialization.
An import page that builds an object from data you send. The default object is a harmless report.
The gadget ran and leaked the server secret.
Why the solution worked
Deserialization built a user-chosen class and ran its behaviour; this is the heart of insecure deserialization, which in real languages leads to code execution. The fix is never deserializing untrusted data into behavioural types, and using pure data formats like schema-validated JSON.
The root cause
Deserialization picks the class from user data and runs its behaviour. The root is deserializing untrusted input into behavioural types.
How the code is fixed
Do not deserialize untrusted input into behavioural types; use schema-validated JSON.
Vulnerable code
const obj = deserialize(body); // builds the class named by __type
obj.run && obj.run(); // and triggers its behaviour
Safe code
// Parse as plain data against a schema; never instantiate user-named types.
const data = schema.parse(JSON.parse(body));
const report = { title: data.title };
Impact in the real world
Insecure deserialization has led to remote code execution in major systems through ready-made gadget chains.
How defenders detect it
Defenders avoid binary deserialization from users, use schema-validated JSON, and alert on type fields in inputs.
Your workspace now has a Server logs tab: your own attack, as the defender saw it, with the alerting lines marked.
Solved with the walkthrough. Put it aside and solve again to earn the feather.