# CVE-2026-5087: PAGI::Middleware::Session::Store::Cookie versions through 0.001003 for Perl generates random bytes insecurely

- Severity: High 7.5 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.36%, higher than 31% of CVEs (2026-12-02)
- Published: 2026-03-31T16:03:08.278Z
- Modified: 2026-07-24T20:10:00.147Z
- Weaknesses: CWE-338, CWE-1204
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: CPANSec

## Description

PAGI::Middleware::Session::Store::Cookie versions through 0.001003 for Perl generates random bytes insecurely.

PAGI::Middleware::Session::Store::Cookie attempts to read bytes from the /dev/urandom device directly. If that fails (for example, on systems without the device, such as Windows), then it will emit a warning that recommends the user install Crypt::URandom, and then return a string of random bytes generated by the built-in rand function, which is unsuitable for cryptographic applications.

This modules does not use the Crypt::URandom module, and installing it will not fix the problem.

The random bytes are used for generating an initialisation vector (IV) to encrypt the cookie.

A predictable IV may make it easier for malicious users to decrypt and tamper with the session data that is stored in the cookie.

(As written by CVE List.)

## Affected

- PAGI-Middleware-Session-Store-Cookie: up to 0.001003
- jjnapiork pagi::middleware::session::store::cookie: up to 0.001003

## References

- <https://metacpan.org/release/JJNAPIORK/PAGI-Middleware-Session-Store-Cookie-0.001003/source/lib/PAGI/Middleware/Session/Store/Cookie.pm#L156-173> (broken-link)
- <https://metacpan.org/release/JJNAPIORK/PAGI-Middleware-Session-Store-Cookie-0.001004/changes> (release-notes)
- <http://www.openwall.com/lists/oss-security/2026/03/31/10> (mailing-list, third-party-advisory)

## Sources

- CVE List: [CVE-2026-5087](https://www.cve.org/CVERecord?id=CVE-2026-5087), CVE Terms of Use, modified 2026-04-01
- NVD: [CVE-2026-5087](https://nvd.nist.gov/vuln/detail/CVE-2026-5087), Public domain, modified 2026-07-24

---

Page: https://cve.day/CVE-2026-5087 · Whole record: https://cve.day/CVE-2026-5087.json · Rebuilt by cve.day 2026-11-25T22:59:17.602Z
