CVE-2025-40931

Apache::Session::Generate::MD5 versions through 1.94 for Perl create insecure session id

Published Mar 5, 2026 CVSS 3.1 · 9.1 Critical EPSS < 1% KEV · Not listed
Description
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.

Remediation

Vendor Solution

Consider alternate solutions like https://metacpan.org/pod/Apache::Session::Generate::Random


Vendor Workaround

Apply the patch from the Debian Perl Group that uses Crypt::URandom.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Description 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. 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.
References
Type Values Removed Values Added
First Time appeared Chorny apache\
CPEs cpe:2.3:a:chorny:apache\:\:session\:\:generate\:\:md5:*:*:*:*:*:perl:*:*
Vendors & Products Chorny apache\
Type Values Removed Values Added
First Time appeared Chorny
Chorny apache::session::generate::md5
Vendors & Products Chorny
Chorny apache::session::generate::md5
Type Values Removed Values Added
Metrics cvssV3_1

{'score': 9.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N'}

ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description 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.
Title Apache::Session::Generate::MD5 versions through 1.94 for Perl create insecure session id
Weaknesses CWE-338
CWE-340
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
CPANSec
Published
Updated
Apr 21, 2026, 2:42 AM
Reserved
Apr 16, 2025, 9:05 AM
Status
Modified
Published
Mar 5, 2026, 2:16 AM
Modified
Jun 17, 2026, 9:22 AM