Skip to content

save-session.sh, doctor.sh and a direct pipeline.extract call still trust an ambient REMEMBER_TRANSCRIPT_PATH #431

Closed

Description

@fdaviddpt

Found by lane 424's self-review and verified live in that worktree. It is the remainder of #424: PR #430 closes the two hooks, and these three entry points are not covered by that unset.

This keeps the containment (read) row open, so the 0.24.0 tag still waits. That row's fix is a path chokepoint; #430 closed two callers rather than the chokepoint, which is real progress and is not the whole row.

Symptom

An ambient REMEMBER_TRANSCRIPT_PATH still reaches find_session() unvalidated through paths #430 does not touch. Verified in the lane's worktree:

REMEMBER_TRANSCRIPT_PATH=/etc/hosts python3 -c "from pipeline import extract; print(extract.find_session('../../etc/passwd'))"
-> /etc/hosts

The traversal check in _validate_session_id() never runs, because find_session() returns the supplied path first.

Location

  • scripts/save-session.sh -- documented manual usage, so a user running it by hand in a directory whose .envrc sets the variable is the reachable case
  • scripts/doctor.sh
  • any direct pipeline.extract invocation

The chokepoint is pipeline/host.py:147-165, whose only gate is os.path.isfile(value).

Mechanism

#424 asked for one of two fixes and left the choice open: clear the variable in the hooks that have no payload of their own, or add containment inside host.transcript_path(). Lane 424 chose the first and said why -- a per-host expected-transcript-directory is not knowable across Claude Code, Codex and Gemini CLI, and pipeline/host.py's own docstring already declines to invent a host-specific seam. That reasoning is sound for the hooks and it does not extend to the callers above, which have no preamble to put an unset in.

So the open question is the one #424 deferred, now with the easy half already done: what does containment mean for a transcript path when the host will not tell you where transcripts live?

What would settle it

One of:

  • A containment rule that does not depend on host-specific knowledge -- for example, refusing a path that escapes the project directory, or one that is not under any known session store, and saying so loudly rather than falling back silently.
  • An explicit decision that a manual invocation inherits the caller's environment by design, with the variable documented as trusted input and the hooks remaining the hardened boundary. That is a legitimate answer, but it has to be written down rather than left as the absence of a check.

Either way the receipt belongs in pipeline/host.py's docstring and in the README section #430 just updated, so the next reader is not told the fallback callers are on equal footing.

Activity

  1. added
    priority:high
    on Aug 29, 2026
  2. self-assigned this
    on Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority:high

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions