Repository navigation
fix(a2a): validate agent card URL and verify card signature - #9679
Vidit Ostwal (Vidit-Ostwal) wants to merge 3 commits into
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
Strix Security ReviewWarning This pull request has 5 commits after the last Strix review ( To fix before merging (2)
PR summary: This PR adds trust checks for A2A delegation: a card-advertised interface URL must stay on the configured endpoint's origin (with an internal-address resolution check when the endpoint is public), and an optional `card_public_key`/`card_signature_algorithms` setting makes the remote AgentCard's JWS signature mandatory. It also adds URL validation, a post-redirect re-check and cookie-domain scoping to `SeleniumScrapingTool`, plus docs and tests. Review summaryReviewed the new A2A agent-card trust controls (origin check, internal-address resolution check, optional JWS card verification and its config plumbing) and the new Selenium scraping navigation/cookie guards. Two issues were confirmed. "A2A card-URL origin check can be bypassed via a card's additional_interfaces, sending task credentials to a foreign URL" shows the guard only inspects the negotiated URL, while the SDK rebuilds the transport target from the card's Ruled out (6)
Fixed the findings? re-run the review, or tag Review 1 on this PR · Reviewed by Strix |
b56218d to
644a555
Compare
Delegation sent credentials to whatever URL the fetched AgentCard named. Reject card URLs outside the configured endpoint's origin, block internal resolution when the endpoint is public, and add optional card_public_key / card_signature_algorithms to verify the card's JWS signature. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
644a555 to
4028aad
Compare
Address review feedback on the card URL check: - Drop additional_interfaces entries that fail the origin check before the card reaches ClientFactory, which otherwise lets them override the validated URL for the same transport. - Parse the real gRPC dial target (grpc(s)://, dns:///, host:port), reject userinfo, dns authorities and unknown schemes, and require a TLS scheme when the endpoint is HTTPS. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
After the origin check the card host always equals the configured endpoint host, so the internal-address comparison tested one name against itself and could never fire, and its lookup failed open on resolver errors. Remove it and the docs claim that depended on it. Pinning the connection to the validated IP is tracked separately. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
| if not sep: | ||
| scheme, rest = "", url | ||
| scheme = scheme.lower() | ||
| if scheme == "dns": |
There was a problem hiding this comment.
🔒 Agentic Security Review
Severity: CRITICAL
Description: The new AgentCard origin check treats the authority of a dns://authority/host[:port] gRPC target as the dial host. gRPC dials the path host instead, and for any non-HTTPS configured endpoint is_same_origin returns true after that mismatched host compare. The gRPC channel factory then passes the raw dns:// string to grpc.aio.insecure_channel and attaches bearer, basic, API-key, or OAuth metadata.
Impact: A remote AgentCard, or anyone who can modify its HTTP response, can move an opted-in gRPC delegation off the configured origin. Default C-core DNS resolution ignores the dns:// authority and connects to the path host, so credentials and the delegated task are sent to an attacker-chosen or internal address. HTTPS endpoints reject this form, and the default client transport list is JSONRPC only; the bypass applies when the configured endpoint is not HTTPS and transport.supported or preferred includes GRPC, which lets the card select that interface.
Remediation: Parse dns:// targets the way the channel is dialed: for dns:[//authority/]host[:port], compare host, not the authority, and reject any authority other than empty unless that authority is also constrained. Fail closed unless the dial host matches the configured endpoint and the TLS mode matches (grpcs or an explicit secure channel when the endpoint is HTTPS). Do not call insecure_channel on an unrecognized target.
Summary
crewai(a2a/utils/url_safety.py): when the endpoint is public, a card URL resolving to a private/loopback/link-local address is rejected.card_public_key/card_signature_algorithmstoA2AClientConfigandA2AConfig. When set, the card must carry a valid JWS signature (verify_agent_card_signatureis now called).en;arupdated,koandpt-BRpages added (condensed, likear).Fixes OSS-261 (GHSA-pmx7-m69g-hxc6, SECT-646).
Test plan
tests/a2a(129 passed), including newtest_card_trust.py🤖 Generated with Claude Code