CVE-2025-40931Apache::Session::Generate::MD5 versions through 1.94 for Perl create insecure session id
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.
What to do
Debian, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | libapache-session-perl | Fix pending | UBUNTU-CVE-2025-40931 | |
| Ubuntu 26.04 | libapache-session-perl | Under investigation | UBUNTU-CVE-2025-40931 | |
| Ubuntu 25.10 | libapache-session-perl | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2025-40931 | |
| Ubuntu 24.04 | libapache-session-perl | Under investigation | UBUNTU-CVE-2025-40931 | |
| Ubuntu 22.04 | libapache-session-perl | Under investigation | UBUNTU-CVE-2025-40931 | |
| Ubuntu 20.04 | libapache-session-perl | Fix pending | UBUNTU-CVE-2025-40931 | |
| Ubuntu 18.04 | libapache-session-perl | Fix pending | UBUNTU-CVE-2025-40931 | |
| Ubuntu 16.04 | libapache-session-perl | Fix pending | UBUNTU-CVE-2025-40931 | |
| Debian 14 | libapache-session-perl | Fix pending | DEBIAN-CVE-2025-40931 | |
| Debian 13 | libapache-session-perl | Fix pending | DEBIAN-CVE-2025-40931 | |
| Debian 12 | libapache-session-perl | Fix pending | DEBIAN-CVE-2025-40931 |
What the vendor says
As published in the CVE record by CPANSec, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- CHORNY Apache::Session::Generate::MD5: affected: up to 1.94
Solution: Consider alternate solutions like https://metacpan.org/pod/Apache::Session::Generate::Random
Workaround: Apply the patch from the Debian Perl Group that uses Crypt::URandom.
Vendor advisories:
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
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.