Repository navigation
Conversation
100.64.0.0/10 is not a public destination, but ipaddress.is_private is false for it, so the push URL screen accepted a webhook that resolved there. Judge an IPv4-mapped address as the IPv4 it carries.
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/utils/push_url_validator.py | 87.80% | 89.13% | 🟢 +1.33% |
| Total | 93.11% | 93.12% | ⚪️ 0.00% |
Generated by coverage-comment.yml
mykytanetipa
requested changes
Oct 12, 2026
mykytanetipa
left a comment
Collaborator
There was a problem hiding this comment.
Nice catch on 100.64.0.0/10!
IPv4Address.is_global already excludes that range (self not in _public_network and not self.is_private, where _public_network is 100.64.0.0/10), and is_private implies not is_global. So we can replace addr.is_private with not addr.is_global and drop _SHARED_ADDRESS_SPACE:
return (
not addr.is_global
or addr.is_loopback
or addr.is_link_local
or addr.is_multicast
or addr.is_reserved
or addr.is_unspecified
)is_global is already false for 100.64.0.0/10, so that range stays blocked. Multicast stays blocked too, because is_global can be true there.
Contributor
Author
|
Thanks, that catch is the whole point of the change. is_global is already false for 100.64.0.0/10, so the check is now not is_global, plus loopback, link-local, multicast, reserved, and unspecified. Mapped IPv6 is still judged as the IPv4 inside it. |
This branch has not been deployed
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
validate_push_notification_urlrejects a resolved address whenipaddressreports it as private, loopback, link-local, reserved, multicast, or unspecified. 100.64.0.0/10 (RFC 6598 shared address space) is not a public destination:is_globalis false.is_privateis also false for that range on Python 3.10 through 3.14, so a push URL that resolves to 100.64.0.1 was accepted and the server POSTed the task event there. The same hole exists for the IPv4-mapped form::ffff:100.64.0.1.The check now treats that range as blocked, and judges an IPv4-mapped address as the IPv4 address it carries. 100.63.255.255, just below the range, stays allowed.
Test plan
test_shared_address_space_blockedandtest_ipv4_mapped_shared_address_blockedfail becausepostis called.TestPushUrlValidationpasses (11 tests), including 100.63.255.255 still allowed.