Issue Bug Closed

#90047BUG with IP6 in IpLocker.php after protokoll switch ipv4 to ipv6

Timo Poppinga 01/02/20, 19:16 updated 02/27/20, 12:42

Description

IpLocker.php dose not work with

TYPO3\CMS\Core\Utility\MathUtility\IpLocker

wrong code

public function validateRemoteAddressAgainstSessionIpLock(string $ipAddress, string $sessionIpLock): bool
{
if ($sessionIpLock === static::DISABLED_LOCK_VALUE) {
return true;
}
    $ipToCompare = $this->isIpv6Address($sessionIpLock)
? $this->getIpLockPartForIpv6Address($ipAddress)
: $this->getIpLockPartForIpv4Address($ipAddress);
return $ipToCompare === $sessionIpLock;
}

Can only be commperd if same protokoll is used

to fix:

$ipToCompare = $this->isIpv6Address($ipAddress) !!!!!
? $this->getIpLockPartForIpv6Address($ipAddress)
: $this->getIpLockPartForIpv4Address($ipAddress);

But then user will be logged out at protocol switch

Reviews 2