Repository navigation
Fix #9803: pin socket connections to validated DNS addresses - #9913
Open
boredskull wants to merge 1 commit into
Open
boredskull wants to merge 1 commit into
boredskull wants to merge 1 commit into
Conversation
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.
Description
Addresses #9803 by improving how SMF 3.0 establishes socket connections to external services when DNS responses change between lookups.
This is an alternative implementation to #9861, building upon the same general approach while addressing additional edge cases and improving connection reliability without weakening the existing SSRF protections.
Improvements over #9861
IPclass.fsockopen(), which could reintroduce the original DNS mismatch.SocketFetcher.php, without requiring changes toIP.phporUrl.php.Security considerations
The existing
isFetchSafe()validation remains in place, and connections are established using addresses returned by SMF's validated DNS cache.The existing peer IP address and port verification checks are retained.
This approach does not disable SSRF protection, bypass certificate verification or require an additional administrator setting.
Compatibility
Testing
Initial isolated regression testing covered:
Live DNS, TLS negotiation and full SMF integration testing are still required.
Summary
The intention is not to replace the underlying approach proposed in #9861, but to build upon it with more robust connection handling, fewer code changes and a fail-closed approach that avoids reintroducing the original issue.
Feedback and further testing are welcome.
Fixes #9803.
Related to #9861.