Skip to content

The start-context cache replays renders made before the memory-injection guard existed #775

Closed

Description

@fdaviddpt

What

_remember_start_cache_context_load (scripts/lib-memory-context.sh:900-934) serves a cache hit by running cat "$_cache" directly, without calling _remember_may_inject. The cache manifest (:876-894) records only source mtimes — nothing about the plugin version, the render format, or the guard's decision. scripts/session-start-hook.sh:2131 serves whatever the loader returns.

The start-context cache (#668) predates the per-file injection guard added in 9322df5 (#754) in this same range.

Impact

Any store on v0.34.0 (no per-file guard) whose cached render already contains a planted file's bytes — a tracked now.md, or a symlink pointed at something like ~/.aws/credentials — has those bytes sitting in tmp/start-context.cache. Upgrading to this release does not change any manifest source mtime, so the first session start after the upgrade gets a cache hit and re-emits the same planted bytes, even though the new guard would refuse them on a fresh render. This repeats until something forces a cache miss (a save via save-session.sh or run-consolidation.sh, or a source mtime change) — I found nothing in bootstrap or session-start that forces a miss after a version upgrade; .install-marker is only ever written once.

A disclosure that this release's security fix (GHSA-6q55-m29c-3xgj) is meant to close can therefore continue to repeat on the patched version, for any store that was already exposed.

Fix

Add a version or format stamp to the cache manifest so an upgrade invalidates old caches; the loader at :923 already treats any unrecognized manifest line as a miss, so this is additive.

How to verify

Publish a start-context cache from v0.34.0 containing a planted symlinked now.md, check out this release's HEAD without touching any cached source's mtime, run one session start, and grep the emitted context for the symlink target's bytes.

Found by the release-auditor during the round-1 audit of v0.34.0..HEAD. Ranked discloses, blocking.

[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 a commit that references this issue on Sep 30, 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