Skip to content

A repository can commit its own start-context cache and manifest, and the loader serves it without ever running the injection guard #781

Closed

Description

@fdaviddpt

What

_remember_start_cache_context_load (scripts/lib-memory-context.sh:959-1002) serves a cache hit verbatim once its manifest passes the -O/-L/-nt checks. A repository can commit .remember/tmp/start-context.cache together with a manifest containing only VERSION=<current> (no SRC= lines at all). Git checks the files out owned by the user (-O passes) and as regular files (-L passes); with no SRC= line, the -nt mtime check never runs against anything. The guard added in #764 is never consulted on this path at all.

Impact

On the very first session start in a freshly cloned repository carrying such a planted pair, the attacker's cached render — including any text they choose — is emitted into session context verbatim, with none of the per-file tracked/symlink checks the guard otherwise applies. This is the same delivery as #774/#780 (attacker-controlled repository content reaching session context) via a different route, so it is ranked in the same forges row rather than discloses (no local secret leaves the machine through this route).

The #775 fix (the VERSION= manifest stamp) does not close this: it only forces a miss for a cache that predates the stamp. A newly planted cache simply writes the current stamp itself.

The combination is new in this release: the cache mechanism predates it (#668), but the injection guard it needs to be checked against (#764) is in this delta.

Fix

Route the cache-hit path through the same tracked/symlink checks _remember_may_inject applies on a fresh render, or refuse to serve (and refuse to trust) a cache file or manifest that git itself tracks. Also refuse a manifest that lists zero SRC= lines, since a legitimate cache always has at least one source.

How to verify

Commit .remember/tmp/start-context.cache and a manifest with only VERSION=<current> into a scratch repo's git index, run session-start-hook.sh in a scratch HOME against it, and confirm the planted cache content is no longer emitted. Positive control: with the two cache files removed, the same run must fall through to the guard's normal tracked-file refusal.

Missing test: neither test_start_context_cache_668.py nor test_injection_guard_754_755_756.py has a case for a planted (git-tracked) cache.

Found by the release-auditor during round 2 of the release audit of v0.34.0..HEAD. Ranked forges, blocking — this release cannot tag until it is fixed.

[AI-generated]

Activity

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

Metadata

Metadata

Assignees

Labels

filed-by-looplane-capturepriority:high

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions