Skip to content

#774's unquote fix does not handle a tracked path with a literal double quote, still bypassing the injection guard #780

Closed

Description

@fdaviddpt

What

The fix for #774 added _remember_git_unquote_into (scripts/lib-memory-context.sh:288-300), used at :563-564, to unescape git ls-files' C-quoted output before comparing it to a raw relative path. printf '%b' does not unescape \" (a literal double quote git emits as \" inside its quoted form). A tracked file under a directory containing a literal " byte, e.g. a"b/.remember/now.md, unquotes to a\"b/..., which never equals the real relative path. The guard answers not-tracked and injects the file.

Impact

Same class and same consequence as #774: a repository whose path contains a double quote delivers attacker-controlled text into session context as if it were the user's own memory, on Linux and macOS (Windows filenames cannot contain "). #774's own commit message and changelog.d/774.security.md claim double quotes are handled; they are not.

Fix

Add \" → " to the unquote (or, simpler and more robust: read git ls-files -z and drop unquoting/comparison-by-string entirely, since -z output is never C-quoted). Extend TestQuotedSpecialCharacterTrackedPathBypassesGuard (currently backslash-only) with a double-quote case. Once fixed, bump _REMEMBER_CACHE_FORMAT_VERSION to invalidate any cache rendered through this hole.

How to verify

Build a scratch repo with a tracked a"b/.remember/now.md, call _remember_file_tracked_state_into (or run session-start from that directory) under bash, and confirm it is now reported tracked / refused rather than injected. Positive control: plain, back\slash, café and similar directory names must still report tracked.

Found by the release-auditor during round 2 of the release audit of v0.34.0..HEAD (immediately after #774's own fix merged). 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 a commit that references 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