Project

General

Profile

Actions

Bug #90047

closed

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

Added by Timo Poppinga over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-01-02
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

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


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #89869: IP Lock feature broken by modern IPv6 - Should be disabled by default or refactoredClosed2019-12-06

Actions
Actions

Also available in: Atom PDF