a2a: reject non-discovery GET requests in REJECT mode - #46379
Open
yanavlasov wants to merge 1 commit into
Open
Conversation
-------------------------- 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>
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.
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:
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