Skip to content

a2a: reject non-discovery GET requests in REJECT mode - #46379

Open
yanavlasov wants to merge 1 commit into
envoyproxy:mainfrom
yanavlasov:fix-a2a
Open

a2a: reject non-discovery GET requests in REJECT mode#46379
yanavlasov wants to merge 1 commit into
envoyproxy:mainfrom
yanavlasov:fix-a2a

Conversation

@yanavlasov

Copy link
Copy Markdown
Contributor

Original author: @ekilmer


What changed:

GET requests are now treated as valid A2A discovery only when the path is /.well-known/agent-card.json after removing query/fragment. Other bodyless GET requests in traffic_mode: REJECT now receive the local 400 response instead of passing upstream.

I used the current A2A discovery docs as the path source: https://a2a-protocol.org/latest/topics/agent-discovery/

Validation

Passed:

  • git diff --check
  • bazel test --config=clang -c opt --test_output=errors //test/extensions/filters/http/a2a:a2a_filter_test
  • bazel test --config=clang -c opt --test_output=errors //test/extensions/filters/http/a2a:a2a_filter_integration_test --test_filter='RejectModeRejectsNonDiscoveryGetRequest:RejectModeAllowsWellKnownDiscoveryGetRequest'
  • bazel run //tools/code_format:check_format -- check changelogs/current.yaml source/extensions/filters/http/a2a/BUILD source/extensions/filters/http/a2a/a2a_filter.cc test/extensions/filters/http/a2a/a2a_filter_test.cc test/extensions/filters/http/a2a/a2a_filter_integration_test.cc

Remaining risk:

A2A is alpha/unknown posture. This fix intentionally recognizes only the standardized well-known discovery path; deployments using proprietary/private GET discovery paths with REJECT mode will now need routing/config changes or a future explicit allowlist option.

Patched by GPT-5.5
Token usage: total=284,607 input=269,602 (+ 3,513,728 cached) output=15,005 (reasoning 5,090)

Risk Level: low
Testing: unit tests
Docs Changes: no
Release Notes: no
Platform Specific Features: no
Fixes #46378

--------------------------

What changed:

GET requests are now treated as valid A2A discovery only when the path
is /.well-known/agent-card.json after removing query/fragment. Other
bodyless GET requests in traffic_mode: REJECT now receive the local 400
response instead of passing upstream.

I used the current A2A discovery docs as the path source:
https://a2a-protocol.org/latest/topics/agent-discovery/

Validation

Passed:

- git diff --check
- bazel test --config=clang -c opt --test_output=errors //test/extensions/filters/http/a2a:a2a_filter_test
- bazel test --config=clang -c opt --test_output=errors
  //test/extensions/filters/http/a2a:a2a_filter_integration_test
  --test_filter='*RejectModeRejectsNonDiscoveryGetRequest*:*RejectModeAllowsWellKnownDiscoveryGetRequest*'
- bazel run //tools/code_format:check_format -- check
  changelogs/current.yaml source/extensions/filters/http/a2a/BUILD
  source/extensions/filters/http/a2a/a2a_filter.cc
  test/extensions/filters/http/a2a/a2a_filter_test.cc
  test/extensions/filters/http/a2a/a2a_filter_integration_test.cc

Remaining risk:

A2A is alpha/unknown posture. This fix intentionally recognizes only the
standardized well-known discovery path; deployments using
proprietary/private GET discovery paths with REJECT mode will now need
routing/config changes or a future explicit allowlist option.

Patched by GPT-5.5
Token usage: total=284,607 input=269,602 (+ 3,513,728 cached) output=15,005 (reasoning 5,090)

Signed-off-by: Eric Kilmer <eric.kilmer@trailofbits.com>
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.

A2A: REJECT mode accepts arbitrary bodyless GET paths

3 participants