Skip to content

Interview question · Application & API Security

Why can deserialising untrusted data execute code?

The format is the bug. JSON cannot call functions; pickle is designed to. The AI version is the model checkpoint you just downloaded.

mediumEssentialNewPreparation tags: Microsoft, Amazon, GoogleUpdated Nov 2026

The format is the bug. JSON cannot call functions; pickle is designed to. The AI version is the model checkpoint you just downloaded.

Make your first attempt

What would you say before reading the answer?

  1. 01 State the assumptions your answer depends on.
  2. 02 Explain the mechanism and choose a control.
  3. 03 Name a condition that would change your decision.

The worked answer includes an approach, scoring criteria and follow-up questions. Compare the reasoning with your own.

signing in unlocks more free answers per topic

What if · the follow-ups in this answer

The answer works through 6 follow-ups like an interviewer would

A Python service accepts a pickled object from a cookie to restore the user's preferences between visits.

  1. Why is this dangerous?
  2. Does signing the cookie fix it?
  3. What should replace pickle?
  4. Which other formats have the same problem?
  5. How would you find other instances?
  6. How would you fix the service?

Each rung has a nudge, a model answer, the principle that carries over and the weak answer to avoid. Sign in free to open it.

UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

No comments yet. Share a correction or a different way to answer it.