From 07f9a7feb7d3f67b491ab406e575897a4e6496a5 Mon Sep 17 00:00:00 2001 From: bchanot Date: Sun, 15 Nov 2026 19:35:34 +0100 Subject: [PATCH] chore(audits): mark memory_index fail-open fixed, log its residuals --- .claude/audits/BUGS-FOUND.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.claude/audits/BUGS-FOUND.md b/.claude/audits/BUGS-FOUND.md index 56fb8e6..5c3c795 100644 --- a/.claude/audits/BUGS-FOUND.md +++ b/.claude/audits/BUGS-FOUND.md @@ -84,7 +84,11 @@ - lib/profile.sh:68-72,85 — a root ABOVE a symlinked $HOME is caught by a string compare only (is_home covers exactly $HOME). Severity: low. Discovered while: /bugfix H6a security gate. Not fixed. -- lib/memory.sh:594-603 `memory_index` — skips a blockers.md that is not a regular file (`[ -f ] || continue`) and does not propagate the awk rc, so `index blocker` exits 0 on a registry it could not read and the session digest prints `- open: none` (SD9b/SD9c pin it). Fix direction: non-regular registry or unparsable `| BLK-` row → non-zero rc, the digest prints `unknown`. Severity: low. Discovered while: /bugfix bugs-found-scripts gates 1+2. Not fixed. +- lib/memory.sh:594-603 `memory_index` — skips a blockers.md that is not a regular file (`[ -f ] || continue`) and does not propagate the awk rc, so `index blocker` exits 0 on a registry it could not read and the session digest prints `- open: none` (SD9b/SD9c pin it). Fix direction: non-regular registry or unparsable `| BLK-` row → non-zero rc, the digest prints `unknown`. Severity: low. Discovered while: /bugfix bugs-found-scripts gates 1+2. FIXED 87aecc1 (BDR-125 gap A3). + + +- lib/memory.sh `memory_index` and the digest — what still reads as not-open or absent: an empty or unknown status word on a BLK row counts as not open (game holds 14 such v1 rows, config 3, so flagging them would fire every session); an unclosed ``` fence hides every later entry with no banner line; `index` reads without the lock while `status`/`_mem_restore` truncate then write in place (memory.sh:262,319), so a racing digest can read an empty file; `[ -e ] || [ -L ] || return 0` (:609) reads a stat failure (I/O, LSM denial) as absent. Severity: low. Discovered while: /bugfix index-fail-closed plan challenge and security gate. Not fixed. +- hooks/session-start.sh:358-377 `_digest_todo` / `_digest_journal` run awk on TODO.md and journal.md with no regular-file check and no timeout: a FIFO there hangs session start. agents/handover-doc-writer.md:105 reports a non-regular blockers.md as `no-file`. `_memory_digest` (:420) prints no digest at all when `.claude/memory` is not a directory. Severity: low. Discovered while: /bugfix index-fail-closed security gate and verifier. Not fixed. - lib/profile-state.jq `clean` strips LF/CR only: ESC and other control chars pass (no terminal sink today); human mode (:67-75) prints values unsanitized (pre-existing). Severity: low. Discovered while: /bugfix bugs-found-scripts security gate. Not fixed. - lib/tests/profile.test.sh:195 T28-nl-id-no-bare-on cannot fail (pre-fix tail is `=off`); the `clean` on pack keys has no biting assertion; lib/tests/session-digest.test.sh:245 comment still says "no digest". Severity: low. Discovered while: /bugfix bugs-found-scripts verifier. Not fixed.