-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] IPv4-mapped IPv6 addresses incorrectly rejected #48420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I broke this. Sorry. |
Same thing for us on the 6.0 branch, 6.0.16 broke things. Simple example: 6.0.16:
6.0.15:
|
@emielmolenaar Im sorry I broke it. Please test the PR from @bonroyage at #48421 |
@PhilETaylor No worries, these things happen 😃 Will look into the PR, thanks! |
fabpot
added a commit
that referenced
this issue
Dec 9, 2022
…jected (bonroyage) This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [HttpFoundation] IPv4-mapped IPv6 addresses incorrectly rejected | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix #48420 <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT I've based it on 4.4 because that's where #48050 was merged into, but I guess I'm 1 day too late with a fix for that version Commits ------- 2170d3c [HttpFoundation] IPv4-mapped IPv6 addresses incorrectly rejected
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Symfony version(s) affected
6.1.8
Description
IPv4 to IPv6 mapped addresses are incorrectly rejected by the checkIp6 function, because of the check for dots added in #48050. For example, Azure Frontdoor makes requests where the IP address is listed as
::ffff:147.243.231.120
. This broke my Laravel installation because suddenly these requests were blocked by the TrustProxies middlewareHow to reproduce
In 6.1.7:
In 6.1.8:
Possible Solution
Remove the check for dots, because pure IPv4 are rejected by the
filter_var
function when the IPv6 flag is addedWhile those in IPv6 notation are allowed
But to also check that the
$ip
is valid IPv6, check that it is valid with thefilter_var
functionAdditional Context
In RFC-4291, dots are allowed in IPv6 addresses
2.2. Text Representation of Addresses
2.5.5.2. IPv4-Mapped IPv6 Address
The text was updated successfully, but these errors were encountered: