fix(security): sanitize date param and strip URL query strings in get_status#4
Merged
Conversation
…erify_chain
- append_event: threading.Lock + prev_hash SHA-256 chaining on every write
- log_event: ed25519 signature verification against agent-keys.json registry;
AGENT_BUS_VERIFY_SIGNATURES env var controls "warn" (default) or "enforce" mode
- verify_chain tool: walks a JSONL log file, validates hash chain + signatures,
returns per-file summary (total, verified, chain_breaks, sig_failures, unsigned)
- get_status: includes signing.registered_agents + verify_mode fields
- requirements.txt: add cryptography>=41.0
Key registry location: COMMS_DIR/agent-keys.json
{"research": {"pubkey": "<b64>", "fingerprint": "abc12345", "added": "..."}}
Unsigned events from unknown sources are accepted (backwards compatible).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…s URLs (L2, L3)
L2: validate date against \d{4}-\d{2}-\d{2} in verify_chain() before
using it in a filename — prevents path traversal via ../sequences.
L3: strip query strings from integration URLs in get_status() via
_strip_qs() — prevents embedded auth tokens from leaking to callers.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dateparam inverify_chain()against\d{4}-\d{2}-\d{2}before using it in a filename — prevents../path traversalget_status()via_strip_qs()— prevents embedded auth tokens (e.g.?auth=TOKEN) from leaking to callersFixes L2 and L3 from security audit scoped-mcp-phase7.
Test plan
verify_chain(date="2026-05-26")works;verify_chain(date="../etc")raises ValueErrorget_status()returns URLs without query strings🤖 Generated with Claude Code