Repository navigation
Add ConnectPolicy to check addresses before DnsConnector connects - #123
Open
nicolas-grekas wants to merge 5 commits into
Open
nicolas-grekas wants to merge 5 commits into
nicolas-grekas wants to merge 5 commits into
Conversation
Contributor
Author
|
@kelunik it'd be great if my PRs here and on http-cllient could be merged quickly - I'd rebuild Symfony HttpClient SSRF's protection on it. |
Member
|
@nicolas-grekas I don't think this is the right approach. The callback would have to be supported by all existing connectors to be reliable, which would be a BC break if we make this a requirement. I'd rather inject a policy object into What do you think about that? |
ConnectContext::withConnectCallback() to check addresses before connectingConnectPolicy to check addresses before DnsConnector connects
Contributor
Author
|
PR updated, #122 too. |
kelunik
reviewed
Nov 5, 2026
nicolas-grekas
force-pushed
the
connect-callback-1.x
branch
from
November 5, 2026 09:57
34db8e2 to
f6b49d4
Compare
kelunik
reviewed
Nov 5, 2026
kelunik
reviewed
Nov 5, 2026
kelunik
reviewed
Nov 5, 2026
kelunik
reviewed
Nov 5, 2026
Contributor
Author
|
PR updated, #122 too. |
kelunik
reviewed
Nov 22, 2026
| /** | ||
| * A denied address is skipped. The connection fails when no address is left. | ||
| */ | ||
| public function isAllowed(SocketAddress $address): bool; |
Member
There was a problem hiding this comment.
SocketAddress works differently for 1.x. Do you need 1.x support for Symfony?
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.
This PR adds a
ConnectPolicyargument toDnsConnector, to check the address of each connection attempt before connecting.Denied addresses are skipped, and the connection fails when all of them are denied.
SSRF filters need this to reject internal addresses after DNS resolution, IP literals included.
It mirrors #122 for 2.x.