Skip to content
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

Detect weird local ips #34160

Merged
merged 7 commits into from
Sep 22, 2022
Merged

Detect weird local ips #34160

merged 7 commits into from
Sep 22, 2022

Conversation

come-nc
Copy link
Contributor

@come-nc come-nc commented Sep 20, 2022

Use new dependency to detect weird syntaxes

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
The call to idn_to_utf8 call is actually to apply normalization

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc come-nc added the 3. to review Waiting for reviews label Sep 20, 2022
@come-nc come-nc added this to the Nextcloud 25 milestone Sep 20, 2022
@come-nc come-nc self-assigned this Sep 20, 2022
@come-nc come-nc requested review from ChristophWurst, a team, icewind1991, blizzz, skjnldsv and nickvergessen and removed request for a team September 20, 2022 10:48
@kesselb
Copy link
Contributor

kesselb commented Sep 20, 2022

Thanks for taking care 👍

In theory we can drop the iputils (symfony http-foundation) again and only use the ip-lib package: https://github.com/mlocati/ip-lib#check-if-an-address-is-contained-in-a-range

This could also help with #33567

@blizzz blizzz mentioned this pull request Sep 20, 2022
@come-nc
Copy link
Contributor Author

come-nc commented Sep 20, 2022

Thanks for taking care +1

In theory we can drop the iputils (symfony http-foundation) again and only use the ip-lib package: https://github.com/mlocati/ip-lib#check-if-an-address-is-contained-in-a-range

This could also help with #33567

Hum but I trust the range detection in symfony more, especially it correctly tests ipv6 in ipv4 ranges, which ip-lib does not.
But as our code translates the IP to v4 if it maps, maybe it is not a problem.

@kesselb
Copy link
Contributor

kesselb commented Sep 20, 2022

Thanks for taking care +1
In theory we can drop the iputils (symfony http-foundation) again and only use the ip-lib package: https://github.com/mlocati/ip-lib#check-if-an-address-is-contained-in-a-range
This could also help with #33567

Hum but I trust the range detection in symfony more, especially it correctly tests ipv6 in ipv4 ranges, which ip-lib does not. But as our code translates the IP to v4 if it maps, maybe it is not a problem.

Good point 👍

@come-nc
Copy link
Contributor Author

come-nc commented Sep 20, 2022

@kesselb I can make a PR to use ip-lib instead of iputils but I’d like to do so in a separate PR once this one is merged.

@nickvergessen
Copy link
Member

3rdparty merged

@kesselb
Copy link
Contributor

kesselb commented Sep 20, 2022

@kesselb I can make a PR to use ip-lib instead of iputils but I’d like to do so in a separate PR once this one is merged.

Sorry I was just thinking loud. The current way is fine and we can combine both libraries.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc
Copy link
Contributor Author

come-nc commented Sep 20, 2022

/backport to stable24

@come-nc
Copy link
Contributor Author

come-nc commented Sep 20, 2022

/backport to stable23

@nickvergessen
Copy link
Member

/backport to stable22

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@blizzz blizzz mentioned this pull request Sep 22, 2022
2 tasks
@PVince81
Copy link
Member

/backport to stable25

Copy link
Member

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@PVince81 PVince81 merged commit 2f15e83 into master Sep 22, 2022
@PVince81 PVince81 deleted the fix/detect-weird-local-ips branch September 22, 2022 09:38
@blizzz blizzz modified the milestones: Nextcloud 25, Nextcloud 26 Sep 22, 2022
@blizzz
Copy link
Member

blizzz commented Sep 22, 2022

/backport to stable25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants