Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[HttpFoundation] FixedIpUtils::anonymize exception when using IPv6 link-local addresses with RFC4007 scoping#59055

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

jbtronics
Copy link
Contributor

QA
Branch?6.4
Bug fix?yes
New feature?no
Deprecations?no
IssuesSee below
LicenseMIT

When accessing a web server via an IPv6 link-local address, it is possible to get aREMOTE_ADDR likefe80::1fc4:15d8:78db:2319%enp4s0, which is then subsequently also returned by Request::getClientIp().
This% suffix is IPv6 scoping according toRFC4007, as the link-local addresses are network interface dependent, and are important to uniquely identify a device in the network.

PHP and Symfony Request consider this format valid (or at least do not touch it). However, IPUtils::anonymize break when getting such a (valid) IP and throws an exception as theinet_ntop function cannot handle that format and returns false.

This PR fixes that by just stripping away the scoping suffix, before passing the IP to that function. I think the interface information is not important on the anonymized IP (as we want to lose the uniqueness anyway) and it might contain the interface name, which one could consider as somewhat sensitive information, that should not be leaked to end users.

@carsonbotcarsonbot added this to the6.4 milestoneDec 1, 2024
@carsonbotcarsonbot changed the titleFixed IPUtils::anonymize exception when using IPv6 link-local addresses with RFC4007 scoping[HttpFoundation] Fixed IPUtils::anonymize exception when using IPv6 link-local addresses with RFC4007 scopingDec 2, 2024
@OskarStarkOskarStark changed the title[HttpFoundation] Fixed IPUtils::anonymize exception when using IPv6 link-local addresses with RFC4007 scoping[HttpFoundation] FixedIpUtils::anonymize exception when using IPv6 link-local addresses with RFC4007 scopingDec 2, 2024
@jbtronicsjbtronicsforce-pushed therfc4007_ip_anonymize_fix branch from64d99aa to558b4f8CompareDecember 2, 2024 13:16
@nicolas-grekas
Copy link
Member

Thank you@jbtronics.

@nicolas-grekasnicolas-grekas merged commit86b9250 intosymfony:6.4Jan 7, 2025
1 check passed
This was referencedJan 29, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@OskarStarkOskarStarkOskarStark left review comments

Assignees
No one assigned
Projects
None yet
Milestone
6.4
Development

Successfully merging this pull request may close these issues.

4 participants
@jbtronics@nicolas-grekas@OskarStark@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp