From: Tim Düsterhus Date: Wed, 18 Aug 2021 07:43:22 +0000 (+0200) Subject: Add safety check for unpacked session cookie data X-Git-Tag: 5.4.5_RC_1~38^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2b7fc4780887271a162d57ae2efe8915706262f7;p=GitHub%2FWoltLab%2FWCF.git Add safety check for unpacked session cookie data --- diff --git a/wcfsetup/install/files/lib/system/session/SessionHandler.class.php b/wcfsetup/install/files/lib/system/session/SessionHandler.class.php index 0cdeb4e337..d51d8229b3 100644 --- a/wcfsetup/install/files/lib/system/session/SessionHandler.class.php +++ b/wcfsetup/install/files/lib/system/session/SessionHandler.class.php @@ -242,6 +242,8 @@ final class SessionHandler extends SingletonFactory )); } $data = \unpack('Cversion/a20sessionId/Ctimestep', $value); + \assert($data['version'] === 1); + \assert(\strlen($data['sessionId']) === 20); $data['sessionId'] = Hex::encode($data['sessionId']); return $data;