
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2025-40931 is a predictable session ID generation vulnerability in Apache::Session::Generate::MD5 for Perl, affecting all versions through 1.94. The module generates session IDs by computing an MD5 hash seeded with Perl's built-in rand() function, the epoch time, and the process ID (PID) — none of which are cryptographically secure sources of entropy. This flaw was publicly disclosed on March 5, 2026 via the oss-security mailing list by Robert Rothenberg of the CPAN Security Group, though the underlying weakness had been noted as early as June 2019 (oss-security, oss-security 2019). It carries a CVSS v3.1 base score of 9.1 (Critical) (Red Hat).
The root cause is classified under CWE-338 (Use of Cryptographically Weak PRNG) and CWE-340 (Generation of Predictable Numbers or Identifiers). The vulnerable code in MD5.pm constructs session IDs as md5_hex(md5_hex(time() . {} . rand() . $$)), where $$ is the PID (a small, predictable integer), time() is the Unix epoch (guessable or leaked via the HTTP Date response header), and rand() is Perl's non-cryptographic PRNG (oss-security, MetaCPAN source). No authentication or special privileges are required to exploit this flaw; an attacker only needs network access to a target application using the affected module. The CPAN Security Group recommends migrating to Apache::Session::Generate::Random as an alternative (oss-security).
Successful exploitation allows an unauthenticated remote attacker to predict valid session IDs and hijack active user sessions, resulting in unauthorized access to sensitive data and application functionality. The vulnerability has high confidentiality and integrity impact (CVSS scores of H/H) with no availability impact, as it enables session impersonation rather than denial of service (Red Hat). Depending on the application using Apache::Session, this could expose user accounts, administrative interfaces, or sensitive business data, and could facilitate lateral movement within multi-tier applications.
There is no public proof-of-concept exploit or evidence of in-the-wild exploitation at this time (Feedly). The EPSS score is approximately 0.017% (0.000170), indicating a low current probability of exploitation in the wild. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. However, the attack requires no authentication and low complexity, making it theoretically straightforward for a motivated attacker with knowledge of the target environment to brute-force or predict session IDs.
Apache::Session with the Generate::MD5 backend (e.g., RequestTracker/RT, LemonLDAP::NG prior to their fix, Torrus). Check HTTP response headers for the Date header to obtain the server's current epoch time.Date header. Enumerate likely PID values (typically 1–65535 on Linux, often clustered in a smaller range for web server worker processes).rand() seeding behavior and the collected epoch time and PID range, generate a list of candidate session IDs by computing md5_hex(md5_hex(time . {} . rand() . $$)) across the plausible input space.No upstream patch for Apache::Session versions through 1.94 was available at the time of disclosure; the CPAN Security Group recommends migrating to Apache::Session::Generate::Random as a drop-in replacement that uses a cryptographically secure random source (oss-security). Some Debian-based distributions ship a patched libapache-session-perl package that substitutes Crypt::URandom for the insecure PRNG — verify your distribution's package version. Interim mitigations include: suppressing the HTTP Date response header to reduce epoch time leakage, implementing session binding to additional client attributes (e.g., IP address, User-Agent), enforcing short session timeouts, and deploying anomaly detection for unusual session usage patterns. The related Apache-Session-Browseable package released version 1.3.19 with a fix (MetaCPAN).
The vulnerability was disclosed via the oss-security mailing list on March 5, 2026 by Robert Rothenberg of the CPAN Security Group, noting that the underlying weakness had been identified as early as 2017 in a GitHub issue and again in 2019 on oss-security without receiving a CVE at the time (oss-security, GitHub Issue). Red Hat tracked the issue and assigned it a moderate/high priority (Red Hat). Fedora issued updates for perl-Apache-Session-Browseable for Fedora 43 and 44 in response to the related CVE chain (Linux Security). Community discussion on Bluesky and Mastodon noted the long-standing nature of the flaw.
Fix availability across major Linux distributions and their releases.
bookworm
libapache-session-perl
sid
libapache-session-perl
trixie
libapache-session-perl
bionic (esm-apps)
libapache-session-perl
devel
libapache-session-perl
focal (esm-apps)
libapache-session-perl
jammy
libapache-session-perl
jammy (esm-apps)
libapache-session-perl
noble
libapache-session-perl
noble (esm-apps)
libapache-session-perl
resolute
libapache-session-perl
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."