#109756Replace unsafe rand() with random_int() in UserSessionManager
Description
This patch proactively improves the security posture of the session management system by eliminating an error-prone design pattern related to randomness.
In `UserSessionManager.php`, the garbage collection probability was calculated using `rand(0, 99)`. The standard `rand()` function is a weak pseudo-random number generator and is considered an unsafe library call in contexts like session management.
This patch replaces it with `random_int(0, 99)`, which generates cryptographically secure, unbiased random integers. While the patch is a simple one-liner, it systematically removes a native PHP function known to be insecure and replaces it with the modern, secure standard.
This issue was automatically created from https://github.com/TYPO3/typo3/pull/634
Reviews 1
History 12
-
Gerrit Code Review pushed patch set 1 for main to change 93946 status
NewUnder Review <span data-processor="relativetime" data-value="2026-05-04T15:56:45+00:00" > 05/04/26, 15:56 </span> -
Garvin Hicking commented and changed status
Under ReviewRejected <span data-processor="relativetime" data-value="2026-08-06T15:59:56+00:00" > 08/06/26, 15:59 </span>
See review notes