Skip to content

agy-stop-hook.sh does not sanitise conversationId before passing it as argv to save-session.sh (splices) #576

Closed

Description

@fdaviddpt

Filed from release-auditor round 1 on the v0.27.0..HEAD delta (2026-09-05).

Class: splices -- can ship behind a filed issue (non-blocking).

scripts/agy-stop-hook.sh:135 takes _CONVERSATION_ID straight from the payload and hands it to save-session.sh as argv[1] with no separator and no shape check. Three sibling hooks sanitise the identical value at entry with the same case arm -- session-end-hook.sh:131-133, post-tool-hook.sh:404-406, session-start-hook.sh:215 -- all spelled ''|.|..|*[!A-Za-z0-9._-]*, with session-end-hook.sh:128-130 explaining why: stdin is not more trustworthy than a basename, same validation as before it becomes a path component or an argument to another script. The new adapter, which fires on every turn, applies none of it.

save-session.sh:127-133 is a bare for arg in "$@"; case "$arg" in --dry|--force|*), so a conversationId of --force or --dry is consumed as a flag: SESSION_ID stays empty, the script auto-detects the newest transcript on the machine, and --force bypasses both the cooldown and the min-message threshold on every turn.

Audit note: the auditor observed the value arrives intact and unaltered when probed, but did not establish a route by which a non-host party sets conversationId -- the finding is the missing guard, not a demonstrated attack.

Fix: apply the same ''|.|..|*[!A-Za-z0-9._-]* guard used by the three sibling hooks to _CONVERSATION_ID in agy-stop-hook.sh before it is used as an argument.

[AI-generated]

Activity

  1. added
    bug
    priority:low
    filed-by-loop
    cohort-6
    on Sep 5, 2026
  2. self-assigned this
    on Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugcohort-6filed-by-looppriority:low

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions