
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2025-40924 is an insecure session ID generation vulnerability in Catalyst::Plugin::Session for Perl, affecting all versions before 0.44. The session ID is derived from a SHA-1 (or similar) hash of a simple counter, epoch time, Perl's built-in rand function, the process ID (PID), and the current Catalyst context object — all of which are low-entropy or guessable values. Disclosed on July 17, 2025, the vulnerability was assigned by CPANSec and tracked under EUVD-2025-21775. It carries a CVSS v3.1 base score of 6.5 (Medium) (Red Hat CVE, Red Hat Bugzilla).
The root cause is classified under CWE-338 (Use of Cryptographically Weak PRNG) and CWE-340 (Generation of Predictable Numbers or Identifiers). In versions before 0.44, the session_hash_seed method concatenates a monotonically incrementing counter, time() (epoch seconds), rand(), the process PID ($$), and the stringified Catalyst context object, then hashes the result with SHA-1, SHA-256, or MD5 depending on module availability. Because rand() is not cryptographically secure, PIDs are drawn from a small numeric range, and epoch time can be inferred or leaked via the HTTP Date response header, an attacker with knowledge of the server environment can narrow the session ID search space significantly. The fix, merged July 16, 2025 via GitHub PR #5, replaces the entire generation routine with a call to Crypt::SysRandom::random_bytes(20), producing a 40-character hex string from the OS entropy source (GitHub PR, Commit Patch).
Successful exploitation allows an attacker to predict or brute-force valid session IDs, enabling session hijacking and unauthorized access to authenticated user sessions. This compromises confidentiality (access to session-protected data and user accounts) and integrity (ability to perform actions as an impersonated user), while availability is not directly affected. Any Catalyst-based web application relying on the default session ID generation prior to version 0.44 is at risk, potentially exposing all active user sessions to takeover (Red Hat Bugzilla, Red Hat CVE).
No public proof-of-concept exploit code or evidence of in-the-wild exploitation has been reported as of the disclosure date. The EPSS score is approximately 0.036% (0.000360), indicating a low near-term exploitation probability. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation requires the ability to observe or infer server-side parameters (e.g., approximate request time via HTTP headers, PID range) and the capacity to make many session validation attempts against the target application (Red Hat CVE).
Catalyst::Plugin::Session versions before 0.44 (e.g., via HTTP response headers such as X-Catalyst or framework-specific error pages).Date response header to approximate the server's epoch time at session creation. Estimate the server's PID range (typically 1–65535 on Linux, often clustered around a narrow range for web workers).counter + time + rand() + PID + context_string, construct a candidate generation script that iterates over plausible combinations of these low-entropy values.session_hash_seed logic, sweeping over likely counter values (small integers), time values (±a few seconds of observed Date header), PID values, and rand() seeds to produce a list of candidate session ID hashes.Upgrade Catalyst::Plugin::Session to version 0.44 or later, which replaces the insecure session ID generation with Crypt::SysRandom::random_bytes(20) for cryptographically strong randomness. Installing the optional Crypt::SysRandom::XS module (version 0.009+) is recommended for improved performance. As an interim workaround prior to upgrading, operators can override the generate_session_id method in their application to use /dev/urandom or a CPAN cryptographic randomness module such as Crypt::URandom. Additionally, enabling short session expiry and IP/user-agent binding can reduce the window of opportunity for session hijacking (GitHub PR, Commit Patch).
The fix was initiated by contributor Robert Rothenberg (robrwo) via a GitHub pull request opened June 25, 2025, with discussion among maintainers about balancing backward compatibility with security improvement for this 20+ year old module used in nearly every Catalyst application. Maintainer jjn1056 noted caution about changing dependencies for such a widely deployed module, while haarg ultimately advocated for a simple, direct replacement using Crypt::SysRandom. The vulnerability was reported to Red Hat's security team and tracked in their Bugzilla, and was picked up by Fedora for a package update advisory (GitHub PR, Red Hat Bugzilla).
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."