{"id":"CVE-2025-40931","state":"PUBLISHED","title":"Apache::Session::Generate::MD5 versions through 1.94 for Perl create insecure session id","description":"Apache::Session::Generate::MD5 versions through 1.94 for Perl create insecure session id.\n\nApache::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.\n\nNote that the libapache-session-perl package in some Debian-based Linux distributions may be patched to use Crypt::URandom.","publishedAt":"2026-03-05T01:41:09.588Z","updatedAt":"2026-04-21T02:42:43.047Z","severity":{"score":9.1,"label":"Critical","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","source":"CISA-ADP"},"assigner":"CPANSec","products":["CHORNY Apache::Session::Generate::MD5"],"affected":[{"vendor":"CHORNY","product":"Apache::Session::Generate::MD5","packageName":"Apache-Session","defaultStatus":"unaffected","versions":[{"version":"0","status":"affected","lessThanOrEqual":"1.94","versionType":"custom"}],"collectionURL":"https://cpan.org/modules","programFiles":["lib/Session/Generate/MD5.pm"],"repo":"https://github.com/chorny/Apache-Session"}],"references":["https://metacpan.org/dist/Apache-Session/source/lib/Apache/Session/Generate/MD5.pm#L27","https://security.metacpan.org/docs/guides/random-data-for-security.html","https://github.com/chorny/Apache-Session/issues/4","https://rt.cpan.org/Ticket/Display.html?id=173631","https://www.openwall.com/lists/oss-security/2019/06/15/1","https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=930659","https://salsa.debian.org/perl-team/modules/packages/libapache-session-perl/-/commit/bdabd71c2f91b18526e31a9dc52b4c17b3d246b7#898a4b8b00022df1b8689910b67707f3e738d180","https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/work_items/1633","https://metacpan.org/pod/Apache::Session::Generate::Random","http://www.openwall.com/lists/oss-security/2026/03/05/3"],"weaknesses":["CWE-340","CWE-338"],"ingestedAt":"2026-10-29T20:09:09.358Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/40xxx/CVE-2025-40931.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-40931","state":"PUBLISHED","datePublished":"2026-03-05T01:41:09.588Z","dateUpdated":"2026-04-21T02:42:43.047Z","assignerShortName":"CPANSec","assignerOrgId":"9b29abf9-4ab0-4765-b253-1875cd9b441e","dateReserved":"2025-04-16T09:05:34.363Z"},"containers":{"cna":{"title":"Apache::Session::Generate::MD5 versions through 1.94 for Perl create insecure session id","descriptions":[{"lang":"en","value":"Apache::Session::Generate::MD5 versions through 1.94 for Perl create insecure session id.\n\nApache::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.\n\nNote that the libapache-session-perl package in some Debian-based Linux distributions may be patched to use Crypt::URandom."}],"affected":[{"vendor":"CHORNY","product":"Apache::Session::Generate::MD5","packageName":"Apache-Session","defaultStatus":"unaffected","versions":[{"version":"0","status":"affected","lessThanOrEqual":"1.94","versionType":"custom"}],"collectionURL":"https://cpan.org/modules","programFiles":["lib/Session/Generate/MD5.pm"],"repo":"https://github.com/chorny/Apache-Session"}],"references":[{"url":"https://metacpan.org/dist/Apache-Session/source/lib/Apache/Session/Generate/MD5.pm#L27"},{"url":"https://security.metacpan.org/docs/guides/random-data-for-security.html","tags":["technical-description"]},{"url":"https://github.com/chorny/Apache-Session/issues/4","tags":["issue-tracking"]},{"url":"https://rt.cpan.org/Ticket/Display.html?id=173631","tags":["issue-tracking"]},{"url":"https://www.openwall.com/lists/oss-security/2019/06/15/1","tags":["mailing-list"]},{"url":"https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=930659","tags":["issue-tracking"]},{"url":"https://salsa.debian.org/perl-team/modules/packages/libapache-session-perl/-/commit/bdabd71c2f91b18526e31a9dc52b4c17b3d246b7#898a4b8b00022df1b8689910b67707f3e738d180","tags":["patch"]},{"url":"https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/work_items/1633","tags":["issue-tracking"]},{"url":"https://metacpan.org/pod/Apache::Session::Generate::Random"}],"problemTypes":[{"descriptions":[{"cweId":"CWE-340","description":"CWE-340 Generation of Predictable Numbers or Identifiers","lang":"en","type":"CWE"}]},{"descriptions":[{"cweId":"CWE-338","description":"CWE-338 Use of Cryptographically Weak Pseudo-Random Number Generator","lang":"en","type":"CWE"}]}],"providerMetadata":{"shortName":"CPANSec","orgId":"9b29abf9-4ab0-4765-b253-1875cd9b441e","dateUpdated":"2026-04-12T17:19:38.170Z"},"impacts":[{"capecId":"CAPEC-115","descriptions":[{"lang":"en","value":"CAPEC-115 Authentication Bypass"}]}],"solutions":[{"lang":"en","value":"Consider alternate solutions like https://metacpan.org/pod/Apache::Session::Generate::Random"}],"source":{"discovery":"UNKNOWN"},"timeline":[{"lang":"en","time":"2017-10-06T00:00:00.000Z","value":"Issue created in the GitHub repository for Apache-Session identifying poor entropy."},{"lang":"en","time":"2019-06-15T00:00:00.000Z","value":"Report posted to the Open Source Security mailing list."},{"lang":"en","time":"2019-06-17T00:00:00.000Z","value":"Debian bug 930659 for libapache-session-perl poor source of entropy for session id generation."},{"lang":"en","time":"2019-06-20T00:00:00.000Z","value":"Patch to use Crypt::URandom created by the Debian Perl Group."},{"lang":"en","time":"2025-09-04T00:00:00.000Z","value":"Issue reported to CPANSec."},{"lang":"en","time":"2026-03-05T00:00:00.000Z","value":"CVE disclosed by CPANSec."}],"workarounds":[{"lang":"en","value":"Apply the patch  from the Debian Perl Group that uses Crypt::URandom."}],"x_generator":{"engine":"cpansec-cna-tool 0.1"}},"adp":[{"title":"CVE Program Container","references":[{"url":"http://www.openwall.com/lists/oss-security/2026/03/05/3"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2026-03-05T11:12:52.118Z"}},{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":9.1,"attackVector":"NETWORK","baseSeverity":"CRITICAL","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","integrityImpact":"HIGH","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"NONE","privilegesRequired":"NONE","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"timestamp":"2026-03-05T16:38:07.301789Z","id":"CVE-2025-40931","options":[{"Exploitation":"none"},{"Automatable":"yes"},{"Technical Impact":"total"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-04-21T02:42:43.047Z"}}]}}}