Skip to content

External storage: first-session migration makes a repo-tracked .remember/config.json haiku block trusted #757

Closed

Description

@fdaviddpt

Found by the v0.34.0 release audit (round 2, finding N2). Its severity is not established yet; see "Open question".

In external-storage mode, the first session migrates an in-project .remember/, including config.json, into the external store (scripts/bootstrap-dirs.sh :82-84). After migration, scripts/lib-memory-dir.sh (:293-298) and pipeline/haiku.py (~:598-600) treat the store's config as trusted. So the haiku block that #726/#740 strip from an untrusted project layer survives, if the repository committed it. A cloned repository can then choose the nested summarizer's credential and whether the user's ANTHROPIC_API_KEY is stripped.

Open question (decides severity)

Can the haiku block change WHERE the summarizer sends transcripts (base URL, provider, command), or only which credential it uses?

  • If it can change the destination, this discloses the user's session transcripts to the repository author. Treat it as a security issue and move it to a private advisory.
  • If it only chooses the credential, it is a trust-boundary bug: summaries get billed to, and possibly logged under, the repository author's key.

Answer that first, then fix: strip or refuse the haiku block when migrating a git-tracked config, and/or mark the migrated config as untrusted. Test-first.

[AI-generated]

Activity

  1. added
    filed-by-loop
    cohort-13
    on Sep 25, 2026
  2. fdaviddpt commented on Sep 25, 2026

    @fdaviddpt
    ContributorAuthor

    Answered the open question from code (read, not exercised):

    • The config cannot change where transcripts go. No config key sets the API base URL, provider, binary path, proxy or child environment. REMEMBER_CLAUDE_BIN, REMEMBER_CODEX_BIN and REMEMBER_SUMMARIZER are env-only (pipeline/haiku.py:112, :126, :200). The claude -p child inherits the host env minus a deny-list (:309-356) and runs with --setting-sources "" in an empty temp cwd (:1068-1070, :1366-1379). The Codex child uses an env allow-list and fixed argv (:1102-1162).
    • It can choose the account. Once migrated and trusted, haiku.oauth_token becomes the child's CLAUDE_CODE_OAUTH_TOKEN when the host has none (:817-828, :1342). Under the default auto it also strips the operator's ANTHROPIC_API_KEY (:752, :771-773). The summarizer then runs under the repository author's account: billing and attribution, plus whatever that account can see of the call on Anthropic's side. That last part is not verifiable from this codebase.
    • It can't run commands. Every spawn is an argv list with no shell. The one residual risk is reject_pattern, an attacker-chosen regex run over model output: CPU denial of service at worst.

    So this stays a public trust-boundary bug, not an advisory.

    Related, and in scope for the same fix: the untrusted-layer strip (#726/#740) removes only haiku. A repo-committed legacy config still sets model, reject_pattern (including none, which turns the refusal gate off), thresholds.*_max_bytes and features.*. None of them is a destination, but model and reject_pattern are worth stripping from an untrusted layer too.

    Fix direction: when bootstrap-dirs.sh migrates a legacy .remember/ into external storage, do not carry a git-tracked config.json across as trusted. Either strip it the same way as the untrusted layer, or leave it behind and log that it was not migrated.

    [AI-generated]

  3. added 3 commits that reference this issue on Sep 25, 2026
  4. added 4 commits that reference this issue on Sep 25, 2026
  5. added 3 commits that reference this issue on Oct 4, 2026
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

    cohort-13filed-by-loop

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions