Apache::Session::Generate::MD5 versions through 1.94 for Perl create insecure session id
Summary
| CVE | CVE-2025-40931 |
|---|---|
| State | PUBLISHED |
| Assigner | CPANSec |
| Source Priority | CVE Program / NVD first with legacy fallback |
| Published | 2026-03-05 02:16:39 UTC |
| Updated | 2026-04-12 18:16:38 UTC |
| 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. |
Risk And Classification
Primary CVSS: v3.1 9.1 CRITICAL from ADP
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Problem Types: CWE-338 | CWE-340 | CWE-340 CWE-340 Generation of Predictable Numbers or Identifiers | CWE-338 CWE-338 Use of Cryptographically Weak Pseudo-Random Number Generator
| Version | Source | Type | Score | Severity | Vector |
|---|---|---|---|---|---|
| 3.1 | ADP | DECLARED | 9.1 | CRITICAL | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N |
| 3.1 | 134c704f-9b21-4f2e-91b3-4a467353bcc0 | Secondary | 9.1 | CRITICAL | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N |
CVSS v3.1 Breakdown
Attack Vector
NetworkAttack Complexity
LowPrivileges Required
NoneUser Interaction
NoneScope
UnchangedConfidentiality
HighIntegrity
HighAvailability
NoneCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
NVD Known Affected Configurations (CPE 2.3)
Vendor Declared Affected Products
| Source | Vendor | Product | Version | Platforms |
|---|---|---|---|---|
| CNA | CHORNY | ApacheSessionGenerateMD5 | affected 1.94 custom | Not specified |
References
| Reference | Source | Link | Tags |
|---|---|---|---|
| salsa.debian.org/perl-team/modules/packages/libapache-session-perl/-/commit/bd... | 9b29abf9-4ab0-4765-b253-1875cd9b441e | salsa.debian.org | |
| gitlab.ow2.org/lemonldap-ng/lemonldap-ng/-/work_items/1633 | 9b29abf9-4ab0-4765-b253-1875cd9b441e | gitlab.ow2.org | |
| metacpan.org/pod/Apache::Session::Generate::Random | 9b29abf9-4ab0-4765-b253-1875cd9b441e | metacpan.org | |
| www.openwall.com/lists/oss-security/2019/06/15/1 | 9b29abf9-4ab0-4765-b253-1875cd9b441e | www.openwall.com | |
| github.com/chorny/Apache-Session/issues/4 | 9b29abf9-4ab0-4765-b253-1875cd9b441e | github.com | Issue Tracking |
| security.metacpan.org/docs/guides/random-data-for-security.html | 9b29abf9-4ab0-4765-b253-1875cd9b441e | security.metacpan.org | Mailing List, Third Party Advisory |
| metacpan.org/dist/Apache-Session/source/lib/Apache/Session/Generate/MD5.pm | 9b29abf9-4ab0-4765-b253-1875cd9b441e | metacpan.org | Product |
| www.openwall.com/lists/oss-security/2026/03/05/3 | af854a3a-2127-422b-91ae-364da2661108 | www.openwall.com | Mailing List, Third Party Advisory |
| bugs.debian.org/cgi-bin/bugreport.cgi | 9b29abf9-4ab0-4765-b253-1875cd9b441e | bugs.debian.org | |
| rt.cpan.org/Ticket/Display.html | 9b29abf9-4ab0-4765-b253-1875cd9b441e | rt.cpan.org | Third Party Advisory |
| CVE Program record | CVE.ORG | www.cve.org | canonical |
| NVD vulnerability detail | NVD | nvd.nist.gov | canonical, analysis |
No vendor comments have been submitted for this CVE.
Additional Advisory Data
| Source | Time | Event |
|---|---|---|
| CNA | 2017-10-06T00:00:00.000Z | Issue created in the GitHub repository for Apache-Session identifying poor entropy. |
| CNA | 2019-06-15T00:00:00.000Z | Report posted to the Open Source Security mailing list. |
| CNA | 2019-06-17T00:00:00.000Z | Debian bug 930659 for libapache-session-perl poor source of entropy for session id generation. |
| CNA | 2019-06-20T00:00:00.000Z | Patch to use Crypt::URandom created by the Debian Perl Group. |
| CNA | 2025-09-04T00:00:00.000Z | Issue reported to CPANSec. |
| CNA | 2026-03-05T00:00:00.000Z | CVE disclosed by CPANSec. |
Solutions
CNA: Consider alternate solutions like https://metacpan.org/pod/Apache::Session::Generate::Random
Workarounds
CNA: Apply the patch from the Debian Perl Group that uses Crypt::URandom.
There are currently no legacy QID mappings associated with this CVE.