Skip to content

fix(a2a): validate agent card URL and verify card signature - #9679

Open
Vidit Ostwal (Vidit-Ostwal) wants to merge 3 commits into
mainfrom
viditostwal/oss-261-medium-a2a-delegation-trusts-the-agent
Open

Vidit Ostwal (Vidit-Ostwal) wants to merge 3 commits into
mainfrom
viditostwal/oss-261-medium-a2a-delegation-trusts-the-agent

Conversation

@Vidit-Ostwal

Copy link
Copy Markdown
Member

Summary

  • Reject AgentCard interface URLs that leave the configured endpoint's origin before any client or credentials are created.
  • Add a small SSRF guard in crewai (a2a/utils/url_safety.py): when the endpoint is public, a card URL resolving to a private/loopback/link-local address is rejected.
  • Add optional card_public_key / card_signature_algorithms to A2AClientConfig and A2AConfig. When set, the card must carry a valid JWS signature (verify_agent_card_signature is now called).
  • Docs: new options documented in en; ar updated, ko and pt-BR pages added (condensed, like ar).

Fixes OSS-261 (GHSA-pmx7-m69g-hxc6, SECT-646).

Test plan

  • tests/a2a (129 passed), including new test_card_trust.py
  • ruff, mypy clean

🤖 Generated with Claude Code

@mintlify

mintlify Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
crewai 🟢 Ready View Preview Nov 23, 2026, 2:22 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@strix-security

strix-security Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Strix Security Review

Warning

This pull request has 5 commits after the last Strix review (b56218d). Strix has not reviewed these changes.
Automatic review on push is off for this repository. To review the latest changes, tag @strix-security in a comment, or turn on re-review on push.

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 summary

Reviewed 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 additional_interfaces, so a card served at the configured endpoint can still send the client's auth headers to an attacker host. "DNS rebinding bypasses the new SSRF guard in SeleniumScrapingTool, returning internal pages to the model" shows the pre-navigation and post-load checks are Python-side DNS lookups that Chrome does not honour, so a rebinding host passes both and its internal content is returned. Other suspicions, including the unreachable internal-address branch in the new URL guard, URL-parsing tricks, prompt text from a peer card, and gaps in gRPC transport containment, were examined and rejected.

Ruled out (6)
  • Can a card URL that resolves to an internal address be rejected while the configured endpoint is public?
    The internal-address branch runs only after the same-origin check has already forced an identical hostname, so it can never fire on a real call path; it is redundant dead code rather than a bypass, because the origin check itself keeps the URL on the operator-configured host.
  • Can the new origin check be fooled into accepting a different host through URL parsing tricks (trailing dot, IPv6 forms, IDN, userinfo, percent-encoding, backs…
    Every such spelling yields a hostname string that differs from the configured endpoint host (or normalises to the legitimate one), and the host comparison rejects the mismatch, so no different-host URL passes.
  • Can a hostile page drive the scraped browser to internal hosts through sub-resources, redirect hops or delayed script navigations that never pass the new check?
    The browser's ability to emit such requests is a pre-existing property of this scraper (it previously navigated without any validation), and after the change no document whose final URL fails validation is ever returned, so no new attacker-controlled exposure is introduced.
  • Does remote peer card text and reply text reaching the orchestrator prompt constitute a new vulnerability?
    Those prompt-building lines are unchanged by this PR and the configured peer supplying its card and replies is the intended delegation contract, so no new caller or input path is introduced.
  • Can a configured card public key be silently ignored on some A2A delegation path?
    Every call site of the delegation entry points passes the new key and algorithm settings through, including both sync and async paths and the deprecated config class.
  • Can a non-HTTP (gRPC-style) interface target let the validated URL leave the configured endpoint host?
    The host-only comparison for non-HTTP targets never admits a different hostname, and the tolerated plaintext gRPC target on the same host is deliberate, pre-existing behaviour.

Fixed the findings? re-run the review, or tag @strix-security in a PR comment to run a fresh review.

Review 1 on this PR · b56218d · requested Nov 23 09:36 UTC when the PR was opened


Reviewed by Strix
Re-run review · Configure security review settings · Try a deeper review with @strix-security /deep

@linear

linear Bot commented Nov 23, 2026

Copy link
Copy Markdown

OSS-261

@strix-security strix-security Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strix flagged 2 new security findings below. See the pinned summary comment for the full PR status.

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>
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":

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 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.

This branch was successfully deployed

1 active deployment
staging - docs — 04bf9869 Deployed Nov 23, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant