Repository navigation
Conversation
The plugin previously checked only IPv4 addresses. A domain could therefore pass validation with a public IPv4 address while the HTTP client connected to a private IPv6 address. This PR: - Uses the system resolver to check both IPv4 and IPv6 addresses via `socket_addrinfo_lookup`, which requires the PHP `sockets` extension. Unlike `dns_get_record`, this also respects local hosts-file entries and the system's name resolution configuration. - Uses the system resolver to check both IPv4 and IPv6 addresses (using `socket_addrinfo_lookup`, that's why the PHP `sockets` extension is now required which is a better solution that using `dns_get_record`). - Rejects a domain if any resolved address is blocked. - Requires every resolved address to match the IP allowlist when one is configured. - Adds IPv6 address and CIDR support, including checks for private networks and IPv6 formats that can embed IPv4 addresses. - Adds repeatable tests without relying on public DNS. - Updates the documentation and CI configuration. It addresses the IPv4/IPv6 validation issue reported in [Snyk](https://security.snyk.io/vuln/SNYK-PHP-J0K3RHTTPLUGSSRFPLUGIN-8400871) and discussed in #8.
Owner
Author
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.
The plugin previously checked only IPv4 addresses. A domain could therefore pass validation with a public IPv4 address while the HTTP client connected to a private IPv6 address.
This PR:
socket_addrinfo_lookup, which requires the PHPsocketsextension. Unlikedns_get_record, this also respects local hosts-file entries and the system's name resolution configuration.socket_addrinfo_lookup, that's why the PHPsocketsextension is now required which is a better solution that usingdns_get_record).It addresses the IPv4/IPv6 validation issue reported in Snyk and discussed in #8.