test_a_filename_cannot_escape_the_payload

Tests › tests/test_hook.py

passed Passed in the packaged run.

What this test is for

Why it exists

A hostile filename cannot escape the JSON payload or set a sibling field.

Verifies REQ-DDB-WIKI-054

tests/test_hook.py:879 · its file's page

What it checks (5)

  1. assert result.returncode == 0, f"exit {result.returncode} on {attack!r}"
  2. assert out, "the probe never reached a speaking tier"
  3. assert list(doc) == ["hookSpecificOutput"], (f"a filename added top-level keys {list(doc)} — the payload's structure is " f"attacker-controlled, which is protocol injection rather than content injection" )
  4. assert set(inner) == {"hookEventName", "additionalContext"}, (f"a filename added inner keys: {list(inner)}" )
  5. assert inner["hookEventName"] == "PostToolUse"

Where the product reaches it

  • main → _run (flow)
  • dossier → subject_payload → _flatten_subject → list (flow)

Call flow

test_a_filename_cannot_escape_the_payload→_run→list

What it reaches

Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-WIKI-054catalogunknown