Skip to content

fix(security): sanitize date param and strip URL query strings in get_status#4

Merged
TadMSTR merged 2 commits into
mainfrom
fix/security-triage-L2-L3
May 26, 2026
Merged

fix(security): sanitize date param and strip URL query strings in get_status#4
TadMSTR merged 2 commits into
mainfrom
fix/security-triage-L2-L3

Conversation

@TadMSTR

@TadMSTR TadMSTR commented May 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • L2: Validate date param in verify_chain() against \d{4}-\d{2}-\d{2} before using it in a filename — prevents ../ path traversal
  • L3: Strip query strings from integration URLs in get_status() via _strip_qs() — prevents embedded auth tokens (e.g. ?auth=TOKEN) from leaking to callers

Fixes L2 and L3 from security audit scoped-mcp-phase7.

Test plan

  • Verify server starts cleanly
  • verify_chain(date="2026-05-26") works; verify_chain(date="../etc") raises ValueError
  • get_status() returns URLs without query strings

🤖 Generated with Claude Code

TadMSTR and others added 2 commits May 26, 2026 12:59
…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>
@TadMSTR TadMSTR merged commit 0af545f into main May 26, 2026
4 checks passed
@TadMSTR TadMSTR deleted the fix/security-triage-L2-L3 branch May 26, 2026 17:22
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.

1 participant