Skip to content

fix(redact): catch URL-embedded credentials and sk-svcacct/admin keys - #77

Closed
sandstream wants to merge 1 commit into
mainfrom
fix/redaction-false-negatives
Closed

sandstream wants to merge 1 commit into
mainfrom
fix/redaction-false-negatives

Conversation

@sandstream

@sandstream sandstream commented Jun 23, 2026 •

Copy link
Copy Markdown
Owner

Two redaction false-negatives (security audit):

  • Connection-string passwords (postgres://user:pw@host, redis://:pw@host) passed through — kv-secret stops at :/@. Added a url-credentials pattern that redacts only the password and keeps scheme/user/host (via a new optional per-pattern replacement).
  • Modern OpenAI sk-svcacct-… / sk-admin-… keys missed (internal hyphen breaks the bare sk-[alnum]{40,} run). Broadened the prefix list.

Tests: DB-URL redaction (host kept), userless redis URL, plain ported URL untouched (no false positive), service-account key. ReDoS-safe.

@github-actions

Copy link
Copy Markdown

✅ Docker image built successfully

  • CLI image: docker.io/sandstream/kit:test

Two redaction false-negatives found during a security review:

- Connection-string passwords (`postgres://user:pw@host`, `redis://:pw@host`,
  `mongodb+srv://…`) passed through unredacted: the `kv-secret` class stops at
  the `:`/`@`. Added a `url-credentials` pattern that redacts ONLY the password
  and keeps scheme/user/host as diagnostic context (via a per-pattern
  `replacement` — new optional field on RedactPattern).
- Modern OpenAI `sk-svcacct-…` / `sk-admin-…` keys missed: their internal hyphen
  breaks the bare `sk-[alnum]{40,}` run. Broadened the `ai-api-key` prefix list.

Tests cover the DB-URL redaction (password gone, host kept), a userless redis
URL, a plain ported URL staying untouched (no false positive), and the
service-account key. ReDoS-safe (no nested quantifiers).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
@sandstream
sandstream force-pushed the fix/redaction-false-negatives branch from a66f1be to da228e2 Compare June 23, 2026 19:46
@github-actions

Copy link
Copy Markdown

✅ Docker image built successfully

  • CLI image: docker.io/sandstream/kit:test

@sandstream sandstream closed this Jun 23, 2026
@sandstream
sandstream deleted the fix/redaction-false-negatives branch June 24, 2026 04:16
sandstream added a commit that referenced this pull request Jul 6, 2026
…rification (R4/#77) (#245)

* feat(check): gate on memory-hooks liveness (self-playing loop, R5)

The self-playing loop (memory capture + statusline) depends on hooks in
~/.claude/settings.json. If they were installed here (durable marker present)
but have since vanished, capture is silently OFF — the store looks installed
but records nothing (a false green). `kit doctor` already flagged this and
`kit memory uninstall` already emits an audit event; this folds the same
liveness into the `kit check` security gate.

New checkMemoryHooksLiveness(): skips when never installed (CI / fresh machine)
and after a clean uninstall (which clears the marker), so it FAILS only on
genuine silent degradation (marker present + a hook gone). Env-injected tests
cover skip/pass/fail.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2

* feat(memory): verify shared-tier signatures on the recall inject path (#77)

recentDecisions (SessionStart recovery / touched-decisions notice) replayed
curated shared entries into every session as trusted "Curated team decisions"
without checking their Ed25519 signature — so a tampered or forged team entry
rode in as trusted (holistic-review #77). The sign/verify machinery existed
(shareEntry signs, kit memory verify verifies) but nothing verified on the
inject path.

New recallSafeShared(root, entries): drops a bad-sig entry ALWAYS (tamper must
never be replayed), and under a committed .kit-policy.signers anchor injects
ONLY org-trusted entries; with no anchor everything but tamper is kept so the
common team-without-anchor case isn't broken. Wired into recentDecisions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants