Apache::Session::Generate::MD5 versions through 1.94 for Perl create insecure session id. Apache::Session::Generate::MD5 generates session ids insecurely. The default session id generator returns a MD5 hash seeded with the built-in rand() function, the epoch time, and the PID. The PID will come from a small set of numbers, and the epoch time may be guessed, if it is not leaked from the HTTP Date header. The built-in rand function is unsuitable for cryptographic usage. Predicable session ids could allow an attacker to gain access to systems. Note that the libapache-session-perl package in some Debian-based Linux distributions may be patched to use Crypt::URandom.
The module generates a session identifier as an MD5 hash computed from three predictable values: the result of the rand() function (unsuitable for cryptographic applications), epoch time, and the process identifier (PID). The PID comes from a limited range of numbers, the epoch time can be read from the HTTP Date header or guessed, and the built-in rand() function does not provide the required cryptographic randomness. The combination of these weaknesses (CWE-338: use of a cryptographically weak random number generator, CWE-340: generation of predictable numbers) makes the space of possible session identifiers sufficiently small to conduct a brute-force or analytical attack.
A remote unauthenticated attacker can predict the correct session identifier of another user and hijack their session, gaining unauthorized access to protected application resources. This results in a breach of data confidentiality and integrity.
Apply patches available from the vendor according to the references or switch to the Apache::Session::Generate::Random module indicated by the vendor as a secure alternative. Users of Debian-based distributions should verify that the installed libapache-session-perl package includes the patch with Crypt::URandom. It is also recommended to verify the application configuration for the session generator being used.
Apache::Session::Generate::MD5 in all versions up to and including 1.94 for Perl. Debian-based distributions (libapache-session-perl package) may have a patch using Crypt::URandom — the local version should be verified.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:NChorny Apache\
APPChorny\