You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
agy-stop-hook.sh's newline-delimited stdout protocol has no escaping; an embedded newline shifts every later field (misreports) #578
bugSomething isn't workingcohort-6Open at the v0.28.0 tag; frozen, can only shrinkfiled-by-loopFiled by the maintainer loop, not by a human. Sets the author axis in dispatch_rank.priority:mediumRecurring cost; compounds if unfixed
Filed from release-auditor round 1 on the v0.27.0..HEAD delta (2026-09-05).
Class: misreports -- can ship behind a filed issue (non-blocking), with a stated escalation condition below.
scripts/agy-stop-hook.sh:96-125 marshals four payload fields through a newline-delimited stdout protocol (print() per field in the embedded python3 -c, then sed -n 1p...4p). The protocol has no escaping, so a newline inside any field shifts every later field by one line.
Observed on the auditor's machine, with a control that fired:
--- CONTROL (well-formed payload) ---
CONVERSATION_ID=[abc-123] TRANSCRIPT_PATH=[/tmp/t.jsonl] WORKSPACE_PATH=[/proj] PARSE_STATUS=[ok]
--- conversationId contains an embedded newline ---
CONVERSATION_ID=[abc] TRANSCRIPT_PATH=[EVIL] WORKSPACE_PATH=[/tmp/t.jsonl] PARSE_STATUS=[/proj]
Consequences, all certain from the code: REMEMBER_TRANSCRIPT_PATH is exported with a value from a field nobody named; CLAUDE_PROJECT_DIR (the root under which memory is written) is exported with a different wrong field; and _PARSE_STATUS != "ok", so the #568 warning arm fires and names the wrong reason.
The three sibling hooks reject exactly this at entry (session-end-hook.sh:156-159 and :177-181, both *$'\n'*|*$'\r'*), with the comment explaining that a path legitimately contains slashes and dots and cannot share STDIN_SESSION_ID's character allowlist. The new adapter carries neither arm.
Escalation condition (stated for the maintainer to decide, not ranked here): if a route exists by which a party other than agy itself sets conversationId, this becomes containment (write) -- a mutating route whose write root comes from an argument -- which blocks unconditionally under the ranking table. The auditor could not establish such a route within this audit, so it is not ranked there. The partial brake is scripts/resolve-paths.sh:326, [ ! -d "$PROJECT_DIR" ], which soft-fails when the shifted value is not an existing directory -- a brake, not a containment check.
Fix that removes the whole finding: reject \n/\r in these fields at entry (same as the sibling hooks), or emit the four fields as JSON instead of newline-delimited lines.
bugSomething isn't workingcohort-6Open at the v0.28.0 tag; frozen, can only shrinkfiled-by-loopFiled by the maintainer loop, not by a human. Sets the author axis in dispatch_rank.priority:mediumRecurring cost; compounds if unfixed
Activity
docs: triage tests/test_agy_stop_hook_576_578_579.py in windows-skip-…
fix: use Path.read_bytes().decode() instead of read_text(newline=...)…
Harden agy-stop-hook.sh against argv flag injection and field-shift/C…