Skip to content

Commit

Permalink
fix(security): Handle IPv6 zone IDs used in link-local addresses
Browse files Browse the repository at this point in the history
Signed-off-by: Josh <[email protected]>
  • Loading branch information
joshtrichards authored Oct 31, 2024
1 parent 4873dcb commit 077eea1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/private/Security/Ip/Range.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

use InvalidArgumentException;
use IPLib\Factory;
use IPLib\ParseStringFlag;
use IPLib\Range\RangeInterface;
use OCP\Security\Ip\IAddress;
use OCP\Security\Ip\IRange;
Expand All @@ -30,7 +31,7 @@ public static function isValid(string $range): bool {
}

public function contains(IAddress $address): bool {
return $this->range->contains(Factory::parseAddressString((string)$address));
return $this->range->contains(Factory::parseAddressString((string)$address, ParseStringFlag::MAY_INCLUDE_ZONEID));
}

public function __toString(): string {
Expand Down

0 comments on commit 077eea1

Please sign in to comment.