CVE-2025-40923: MIYAGAWA Plack::Middleware::Session · Generation of Predictable Numbers or Identifiers
Affects MIYAGAWA Plack::Middleware::SessionSource CVE Database V5
Not known to be exploited · CVSS 7.3 High · fixed in 0.35 : patch MIYAGAWA Plack::Middleware::Session soon.
Data as of 26 Oct 2026, 14:05 UTC
- EPSS
- 0.3% chance of exploitation in 30 days – higher than 32% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 0.35
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:LExploitation evidence
Disclosed: evidence found.
CVE published 16 Jul 2025
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.
What to do
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| MIYAGAWA Plack::Middleware::Session | Affected
| Fixed in– |
AI-suggested
The primary mitigation is to upgrade Plack::Middleware::Session to version 0.35 or later, where the session ID generation uses a cryptographically secure random number generator, eliminating predictability. Organizations should audit their Perl web applications to identify usage of the vulnerable middleware version and prioritize patching. If immediate upgrade is not feasible, consider implementing compensating controls such as: enforcing strict session expiration and rotation policies to limit the window of token validity; monitoring session activity for anomalies indicative of hijacking attempts; restricting session access by IP address or device fingerprinting to reduce the risk of token misuse; disabling or filtering HTTP headers that leak epoch time information, such as the Date header, to reduce predictability; and employing web application firewalls (WAFs) to detect and block suspicious session-related requests. Additionally, developers should review session management practices to ensure adherence to cryptographic best practices and avoid reliance on insecure random number generators. Regular security assessments and penetration testing focused on session management can help detect residual weaknesses.
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.
References
- metacpan.org/release/MIYAGAWA/Plack-Middleware-Session-0.34/source/lib/Plack/Session/State.pm (opens in a new tab)
- github.com/plack/Plack-Middleware-Session/pull/52 (opens in a new tab)
- github.com/plack/Plack-Middleware-Session/commit/1fbfbb355e34e7f4b3906f66cf958cedadd2b9be.patch (opens in a new tab)
- security.metacpan.org/docs/guides/random-data-for-security.html (opens in a new tab)
- openwall.com/lists/oss-security/2025/07/16/4 (opens in a new tab)