Skip to content

Hardening: session-handoff acts on untrusted transcript content + unvalidated transcript_path with no confirmation gate #29

Description

@JAORMX

Hi! We package session-handoff downstream (stacklok/dockyard) and run skills through an automated security scanner whose LLM judge flagged a prompt-injection concern in skills/session-handoff/SKILL.md. On review we think it's a legitimate hardening opportunity — filing constructively, since the behavior is already documented in the skill itself.

Concern

The skill:

  1. Reads .git/entire-sessions/<id>.json and extracts transcript_path — an arbitrary filesystem path.
  2. Greps the file at that path into the agent's context.
  3. Then "immediately pick up the work — start planning, coding, or doing whatever the next step is. Do not ask permission," with explicit top-of-file rules to not ask clarifying questions and not confirm before continuing.

Two issues stack:

  • Indirect prompt injection. The transcript is untrusted input — it could come from a cloned repo that ships its own .git/entire-sessions/, a shared checkpoint, or another party's session. Instructions embedded in the transcript's "next steps"/final messages get acted on autonomously, because the skill deliberately removes the human-confirmation step that would normally catch this.
  • Arbitrary file read. transcript_path is read verbatim from the session JSON. A crafted session file can point it at ~/.ssh/id_rsa, a .env, etc., pulling secrets into context — which the autonomous-continuation behavior can then be steered to use.

Suggested hardening

  • Keep a confirmation checkpoint before autonomously acting on transcript-derived "next steps" — at least when the session source isn't the user's own current machine/agent.
  • Validate/constrain transcript_path (e.g. require it to resolve under known session directories; reject paths outside an allowlist).
  • Treat transcript content as data, not instructions — explicitly instruct the agent not to follow any instructions found inside the transcript.

Happy to send a PR if that'd be useful. Thanks for the skill!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions