test_a_filename_cannot_escape_the_payload¶
Tests › tests/test_hook.py
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)
assert result.returncode == 0, f"exit {result.returncode} on {attack!r}"assert out, "the probe never reached a speaking tier"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" )assert set(inner) == {"hookEventName", "additionalContext"}, (f"a filename added inner keys: {list(inner)}" )assert inner["hookEventName"] == "PostToolUse"
Where the product reaches it
Call flow
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)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-WIKI-054 | catalog | unknown |