CVE-2025-40923 Details
Description
Plack-Middleware-Session before version 0.35 for Perl generates session ids insecurely. The default session id generator returns a SHA-1 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.
A vulnerability exists in Plack-Middleware-Session versions prior to 0.35 for Perl, where session IDs are generated insecurely. The default generator creates a SHA-1 hash that is seeded with the built-in rand function, the epoch time, and the process ID (PID). This method is flawed because the PID is drawn from a limited range of values, the epoch time can be predicted unless it is disclosed in the HTTP Date header, and the rand function is not suitable for cryptographic purposes. The predictability of session IDs could potentially allow an attacker to gain unauthorized access to systems.
Users can upgrade to Plack-Middleware-Session version 0.35 or later, where this vulnerability has been addressed. Instructions for upgrading can be found on the module's CPAN page.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Jul 16, 2025CISA-ADP
Assessed Jul 16, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/plack/Plack-Middleware-Session/commit/1fbfbb355e34e7f4b3906f66cf958cedadd2b9be.patch | CPANSec | Source CodeVendor |
| https://github.com/plack/Plack-Middleware-Session/pull/52 | CPANSec | Issue TrackingVendor |
| https://metacpan.org/release/MIYAGAWA/Plack-Middleware-Session-0.34/source/lib/Plack/Session/State.pm#L22 | CPANSec | Source CodeVendor |
| https://security.metacpan.org/docs/guides/random-data-for-security.html | CPANSec | |
| http://www.openwall.com/lists/oss-security/2025/07/16/4 | CVE |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-338 | Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) | CPANSec |
| CWE-340 | Generation of Predictable Numbers or Identifiers | CPANSec |
Affected Products
| Product | Versions |
|---|---|
| Plack-Middleware-Session | All versions |
CPE
Remediation
| |
Change History
5 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | CPANSec |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Nov 4, 2025 | CVE Modified | CVE |
| Jul 16, 2025 | CVE Modified | CISA-ADP |
| Jul 16, 2025 | New CVE Received | CPANSec |
Volerion