Skip to content

post-tool-hook.sh basename-derived SESSION_ID still reaches argv unguarded (leading-dash gap closed on two of three routes) #620

Closed

Description

@fdaviddpt

Filed by the release-3 audit for v0.29.0..HEAD (round 1, dispatch token gate3-682bbe1d0550).

This delta closed the leading-dash gap twice -- post-tool-hook.sh:422 (#610) and session-end-hook.sh:141 (#600) -- both on the stdin session id. The basename route in the same file is untouched:

SESSION_ID="${TRANSCRIPT##*/}"; SESSION_ID="${SESSION_ID%.jsonl}"   # post-tool-hook.sh:604-605, from LATEST_JSONL at :554

and that value reaches argv unguarded at :910: nohup "$SAVE_SCRIPT" "$SESSION_ID". The two case arms at :646 and :700 that still lack a -* pattern only skip the sidecar/marker paths; they never clear SESSION_ID. save-session.sh:141-147 recognises exactly --dry and --force and treats everything else as positional, so the reachable values are narrow: a transcript file literally named --dry.jsonl or --force.jsonl in the session dir turns a delta-triggered save into a silent dry-run.

Note: the comment added at :404-417 asserts the stdin id now "faces the same guard the basename-derived id has always faced" -- after this change the stdin id faces a stronger guard, so the comment describes a symmetry that no longer holds.

This condition predates this delta (present at HEAD~10); reported now because the delta closed two of three sites and the third is the one the new comment claims parity with.

Fix: apply the same -*/-- guard to the basename-derived SESSION_ID at post-tool-hook.sh:604-605 before it reaches :910, and correct the comment's parity claim.

Row: splices (can ship behind a filed issue, not blocking). Whether the transcript directory is attacker-writable in practice is unresolved; if not, this is hygiene rather than exposure.

[AI-generated]

Activity

  1. added
    priority:low
    filed-by-loop
    lane-capture
    cohort-8
    on Sep 7, 2026
  2. self-assigned this
    on Sep 7, 2026
  3. added 2 commits that reference this issue on Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

cohort-8filed-by-looplane-capturepriority:low

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions