CVE-2025-40923Plack-Middleware-Session before version 0.35 for Perl generates session ids insecurely
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.
What to do
Fixed builds are available from Debian: see the table below for the fixed version per release.
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.04 | libplack-middleware-session-perl | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | libplack-middleware-session-perl | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2025-40923 | |
| Ubuntu 24.04 | libplack-middleware-session-perl | Under investigation | UBUNTU-CVE-2025-40923 | |
| Ubuntu 22.04 | libplack-middleware-session-perl | Under investigation | UBUNTU-CVE-2025-40923 | |
| Ubuntu 20.04 | libplack-middleware-session-perl | Fix pending | UBUNTU-CVE-2025-40923 | |
| Ubuntu 18.04 | libplack-middleware-session-perl | Fix pending | UBUNTU-CVE-2025-40923 | |
| Ubuntu 16.04 | libplack-middleware-session-perl | Fix pending | UBUNTU-CVE-2025-40923 | |
| Debian 14 | libplack-middleware-session-perl | Fixed | 0.36-1 | DEBIAN-CVE-2025-40923 |
| Debian 13 | libplack-middleware-session-perl | Fix pending | DEBIAN-CVE-2025-40923 | |
| Debian 12 | libplack-middleware-session-perl | Fix pending | DEBIAN-CVE-2025-40923 |
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.
- MIYAGAWA Plack::Middleware::Session: affected: 0.01 to before 0.35; fixed in
0.35
Solution: Users are advised to upgrade to Plack-Middleware-Session v0.35 or later.
Workaround: Users who are unable to upgrade are advised to change the sid_generator attribute of Plack::Session::State to a function that returns a securely generated session id based on a secure source of entropy from the system.
Vendor advisories:
References
- https://metacpan.org/release/MIYAGAWA/Plack-Middleware-Session-0.34/source/lib/Plack/Session/State.pm#L22
- https://github.com/plack/Plack-Middleware-Session/pull/52
- https://github.com/plack/Plack-Middleware-Session/commit/1fbfbb355e34e7f4b3906f66cf958cedadd2b9be.patch
- https://security.metacpan.org/docs/guides/random-data-for-security.html
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.