Skip to content

Merge review: refuse unresolved blocked loser before retiring a row #204

Closed

Description

@WhollyMindless

Proposed classification: bug, store-security, severity:medium. Labels require maintainer permissions; these are suggestions for your triage.

For maintainer triage and approval of scope. Reviewed main at bf9f4d2, still current when these proposals were prepared. Review probes use synthetic temporary stores; this is not a report of a production incident. No implementation or assignment is implied by this issue.

SEC-02: memory_merge_review skips loser authorization when the loser row is blocklisted, so a session can retire another repository's row

  • src/index.ts:1035 — loserRow resolved from loadAll(), which drops blocklisted rows (src/memory.ts:174-185)
  • src/index.ts:1043 — if (loserRow && !isVisibleTo(...)): an undefined loserRow skips the check
  • src/index.ts:1049 — markSuperseded(args.loser) then rewrites the raw line in any day file regardless of repo or blocklist

Reproduction: test/review-probes/probe-merge-blocked.probe.ts: seed a repo-B row and a repo-A row. addBlock(bRow). From a repo-A plugin session, call memory_merge_review({loser: bRow, survivor: aRow, reason}). Then removeBlock(bRow).

Observed: Reply: 'Resolved merge: is canonical; superseded ...'. B's on-disk row now carries superseded_by=, reason=cross-repo, symbol/from/to. After unblocking, B's row stays superseded, so it is withheld from B's recall/injection.

Effect: Cross-repository integrity violation of the documented #131 contract ('a row belonging to another repository is refused in either seat'; README: 'a row id it merely knows is not authority to retire another repo's memory'). Practical impact is limited: the row is already hidden while blocked, and supersession is recoverable (memory_undo, or viewer inspection). The effect appears when a human later unblocks the row, which then silently stays retired, pointing at a foreign survivor.

Preconditions: The attacker session must know the exact ts of a blocklisted foreign row. #212 (SEC-03) shows one way such ids reach other repositories (viewer evidence lines).

Limits: The same pattern (authorize only if found by loadAll) was not found in other tools: update, prune, and undo filter raw lines or visible rows directly.

Proposed scope / decision requested

Require an authorized, resolvable loser before mutation. Test an explicit repo-A tool call against a blocked repo-B loser, missing losers, and normal valid merges. This is the blocked-row residual of #131, not the stale-review decision in #126.

Please accept, narrow, defer, or decline this independently of the other review findings. We will wait for your direction before taking implementation. Happy to supply a checked-in regression reproducer with an accepted fix; the review report and probe artifacts are preserved locally.

Activity

  1. added
    bug
    store-security
    severity:medium
    on Nov 1, 2026
  2. WhollyMindless commented on Nov 2, 2026

    @WhollyMindless
    ContributorAuthor

    Claiming #204 per our coordination agreement. No agent:ready label or existing claim is present. I will reproduce the blocked-loser case on current main, keep the fix scoped to requiring a resolvable and authorized loser, and add regression coverage for blocked/missing losers and valid merges. I will leave automation labels alone and post a PR for your consideration; please feel free to defer or reject it.

  3. WhollyMindless commented on Nov 2, 2026

    @WhollyMindless
    ContributorAuthor

    Ready for consideration in #259. Confirmed on current main: blocked foreign/own/global losers all reach the raw mutation path. The PR requires a resolvable loser first, with explicit-session regression tests. Focused ownership tests: base 5 pass / 3 fail; fixed 8/8 on Windows and Linux. Full Windows gate: 862 pass / 26 skip unit tests and 30/30 E2E. Automation labels left unchanged; please feel free to defer or reject.

  4. abogartz-opencode-self-improvement commented on Nov 2, 2026

    @abogartz-opencode-self-improvement

    🎉 This issue has been resolved in version 0.15.10 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

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

    bugreleasedseverity:mediumstore-security

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions