Conversation
This was
linked to
issues
Mar 31, 2026
1af6da5 to
df7b0c8
Compare
…, list locking, env isolation, intent-anchor wrapper, IBCT (#2496, #2497, #2504) Phase 1 (no new deps): - Cross-server sanitized_id collision detection in McpManager: warnings on connect and add_server, first-registered tool wins dispatch (MF-1, SF-6) - Tool-list snapshot locking (lock_tool_list config): tools/list_changed rejected for connected servers; lock set atomically before connect_entry to eliminate TOCTOU race (MF-2) - Per-server Stdio environment isolation (env_isolation config): spawned processes receive only BASE_ENV_VARS + server env; XDG dirs included for Linux (SF-3) - Intent-anchor wrapper for MCP tool output: per-invocation UUID nonce boundary prevents delimiter injection; [TOOL_OUTPUT:: escaped in content (MF-5) Phase 2 (hmac 0.13 + sha2 0.11): - IBCT module (crates/zeph-a2a/src/ibct.rs): HMAC-SHA256, key_id field for rotation, Vec<IbctKey> for graceful key rollover, base64-JSON X-Zeph-IBCT header, vault_ref config field for secure key storage (MF-3, MF-4) - ibct feature gate in zeph-a2a; enabled via a2a workspace feature
RC-1: replace hex string comparison in ibct.rs with constant-time
verify_signature() using Mac::verify_slice() to eliminate the
timing side-channel in HMAC verification.
RC-2: remove hardcoded trust=untrusted field from intent-anchor wrapper
format; the trust annotation was redundant and potentially misleading
since callers already control context.
RC-3: replace all .expect("connected_server_ids lock poisoned") with
.unwrap_or_else(PoisonError::into_inner) to avoid cascade panics
on RwLock poison in manager.rs.
REC-1: add tool_list_locked.remove() in add_server() error branches
for list_tools and run_probe failures, ensuring the lock is always
cleaned up on early return.
6a7e5de to
09a63d2
Compare
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
Implements security hardening for
zeph-mcpandzeph-a2aacross three research issues.#2496 — MCP/A2A threat modeling mitigations
McpManager: duplicatesanitized_idacross servers with different trust levels logs a warning; first-registered wins deterministicallyadd_server()re-runs collision detection on dynamic server additions#2497 — SMCP lifecycle hardening
intent_anchor_wrap) applied to all MCP tool output before insertion into LLM context; nonce-based per-invocation boundary ([TOOL_OUTPUT::{uuid}::BEGIN]) prevents injection via fixed delimiters; embedded[TOOL_OUTPUT::sequences in content are escapedenv_isolation = falseby default): child processes receive onlyBASE_ENV_VARS+ declared serverenvslice; XDG dirs includedlock_tool_list = falseby default): set atomically at connect time, blocksToolRefreshEventmid-session; cleaned up on all error paths inadd_server()#2504 — AIP Invocation-Bound Capability Tokens
ibct.rsmodule inzeph-a2a(feature-gatedibct): HMAC-SHA256 signed tokens withkey_id,task_id,endpoint,expires_atverify_signature()usesMac::verify_slice()for constant-time comparisonVec<IbctKey>config supports key rotation;ibct_signing_key_vault_reffor vault-resolved secretsMcpManagerand A2A client/server wired for token attachment and verificationTest plan
--features full,a2a)cargo +nightly fmt --check✅,cargo clippy --workspace --features full,a2a -- -D warnings✅ (0 warnings)Closes
Closes #2496, #2497, #2504