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

Do not check the IP address with session protection disabled #1182

Conversation

ArthurHoaro
Copy link
Member

This allows the user to stay logged in if his IP changes.

Fixes #1106

Note: this setting labelled « Disabled protection » can obviously become a security issue.

This allows the user to stay logged in if his IP changes.

Fixes shaarli#1106
@ArthurHoaro ArthurHoaro added this to the 0.10.1 milestone Jul 17, 2018
@ArthurHoaro ArthurHoaro self-assigned this Jul 17, 2018
@ArthurHoaro ArthurHoaro modified the milestones: 0.10.1, 0.10.2 Jul 29, 2018
@ArthurHoaro ArthurHoaro modified the milestones: 0.10.2, 0.10.3 Aug 11, 2018
@virtualtam
Copy link
Member

As the PR addresses (pun intended :) ) IPv6 privacy extensions, I'd suggest we:

  • start reworking IP-related operations to distinguish IPv4 and IPV6 addresses
  • introduce IPv4- and IPv6-specific configuration options to avoid catch-all cases that will be hard to document and debug

Resources:

Related PHP libs:

@ArthurHoaro
Copy link
Member Author

I don't understand your point, from my understanding there is no difference between how we treat IPv4 and IPv6 addresses. We use them to:

  1. See if it has changed
  2. Generate a hash

@virtualtam
Copy link
Member

The point is that IPv6 behaves differently than IPv4, as local client address renewal is part of the protocol (vs. static local IPv4 addresses). I'm not sure how web frameworks handle this so it might be worth looking under the hood (and maybe switch to a well-maintained 3rd-party component to handle authentication?)

@nodiscc nodiscc added the ipv6 label Oct 11, 2018
@ArthurHoaro
Copy link
Member Author

Oh I didn't knew that. I'll look around for implementations, but I don't think we can find a third party lib which fits our needs and doesn't require a database.

@wcypierre
Copy link

wcypierre commented Dec 29, 2018

any update on this? as I am facing the same issue as well

@ArthurHoaro
Copy link
Member Author

So, I looked at Symfony implementation, and read a few SO thread.

Symfony includes two implementations, and none of them includes an IP check:

From my understanding, tying the IP to the authentication cookie is not such a good idea as it can change for valid reasons. And if the address changes with IPv6 protocol, then it can't work at all.

In any case, I'm going to merge this, as it does not lower the security for users who have the option enabled, and as it prevents valid users to use the feature properly.

A few threads:

@ArthurHoaro ArthurHoaro merged commit 905f867 into shaarli:master Feb 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants