server icon indicating copy to clipboard operation
server copied to clipboard

Detect weird local ips

Open come-nc opened this issue 3 years ago • 9 comments

Use new dependency to detect weird syntaxes

  • [x] https://github.com/nextcloud/3rdparty/pull/1173
  • [x] rebase

come-nc avatar Sep 20 '22 10:09 come-nc

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 https://github.com/nextcloud/server/issues/33567

kesselb avatar Sep 20 '22 11:09 kesselb

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.

come-nc avatar Sep 20 '22 14:09 come-nc

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 :+1:

kesselb avatar Sep 20 '22 14:09 kesselb

@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.

come-nc avatar Sep 20 '22 14:09 come-nc

3rdparty merged

nickvergessen avatar Sep 20 '22 14:09 nickvergessen

@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.

kesselb avatar Sep 20 '22 15:09 kesselb

/backport to stable24

come-nc avatar Sep 20 '22 15:09 come-nc

/backport to stable23

come-nc avatar Sep 20 '22 15:09 come-nc

/backport to stable22

nickvergessen avatar Sep 21 '22 04:09 nickvergessen

/backport to stable25

PVince81 avatar Sep 22 '22 09:09 PVince81

/backport to stable25

blizzz avatar Sep 22 '22 10:09 blizzz