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

fix(net/security): Handle IPv6 zone IDs in link-local addresses #49039

Merged
merged 5 commits into from
Nov 6, 2024

Conversation

joshtrichards
Copy link
Member

@joshtrichards joshtrichards commented Oct 31, 2024

Summary

Link-Local Addresses in IPv6 may contain Zone indexes/IDs (e.g. fe80::1fc4:15d8:78db:2319%enp4s0). Parsing was failing and throwing. This PR fixes that by enabling the handling in our existing IP handling library.

Docs for the library we use: https://github.com/mlocati/ip-lib?tab=readme-ov-file#accepting-ipv6-zone-ids

Wikipedia for the curious: https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses_(with_zone_index)

TODO

  • Add tests ideally

Checklist

Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards
Copy link
Member Author

/backport to stable30

@solracsf

This comment was marked as resolved.

@joshtrichards

This comment was marked as resolved.

@nickvergessen
Copy link
Member

Should add tests to all affected components:
https://github.com/nextcloud/server/blob/master/tests/lib/Security/Ip/RemoteAddressTest.php
https://github.com/nextcloud/server/blob/master/tests/lib/Net/IpAddressClassifierTest.php

@MartB
Copy link
Member

MartB commented Nov 3, 2024

Indeed, Im going to close my PR then :)

Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
@skjnldsv skjnldsv merged commit 3c42906 into master Nov 6, 2024
177 checks passed
@skjnldsv skjnldsv deleted the jtr/fix-ipv6-zone-ids-link-local branch November 6, 2024 08:17
@skjnldsv skjnldsv mentioned this pull request Jan 7, 2025
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 bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants