CVE-2025-40931 Details
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.
A vulnerability exists in Apache::Session::Generate::MD5 versions through 1.94 for Perl, where session IDs are generated insecurely. The default method creates an ID by hashing with MD5, using a seed from the unreliable rand() function, the current epoch time, and the process ID. This approach can lead to predictable session IDs, allowing attackers to potentially hijack sessions and gain unauthorized access to systems.
Users are advised to update to a version of Apache::Session::Generate::MD5 that is not affected by this vulnerability. When generating session IDs, use a secure random number generator instead of the built-in rand() function. Several Perl modules, such as Crypt::URandom, Crypt::SysRandom, and Session::Token, can be used to generate secure random data for session ID creation.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Mar 5, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=930659 | CPANSec | |
| https://github.com/chorny/Apache-Session/issues/4 | CPANSec | Issue Tracking |
| https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/work_items/1633 | CPANSec | |
| https://metacpan.org/dist/Apache-Session/source/lib/Apache/Session/Generate/MD5.pm#L27 | CPANSec | Product |
| https://metacpan.org/pod/Apache::Session::Generate::Random | CPANSec | |
| https://rt.cpan.org/Ticket/Display.html?id=173631 | CPANSec | Third Party Advisory |
| https://salsa.debian.org/perl-team/modules/packages/libapache-session-perl/-/commit/bdabd71c2f91b18526e31a9dc52b4c17b3d246b7#898a4b8b00022df1b8689910b67707f3e738d180 | CPANSec | |
| https://security.metacpan.org/docs/guides/random-data-for-security.html | CPANSec | Mailing ListThird Party Advisory |
| https://www.openwall.com/lists/oss-security/2019/06/15/1 | CPANSec | |
| http://www.openwall.com/lists/oss-security/2026/03/05/3 | CVE | Mailing ListThird Party Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-338 | Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) | CPANSec |
| CWE-340 | Generation of Predictable Numbers or Identifiers | CPANSec |
Affected Products
| Product | Versions |
|---|---|
| chorny apache::session::generate::md5 | <= 1.94 |
CPE
Remediation
| |
Change History
8 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | CPANSec |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Apr 12, 2026 | CVE Modified | CPANSec |
| Mar 9, 2026 | Initial Analysis | [email protected] |
| Mar 6, 2026 | CVE Modified | CPANSec |
| Mar 5, 2026 | CVE Modified | CISA-ADP |
| Mar 5, 2026 | CVE Modified | CVE |
| Mar 5, 2026 | New CVE Received | CPANSec |