CVE-2026-2597 Details
Description
Crypt::SysRandom::XS versions before 0.010 for Perl is vulnerable to a heap buffer overflow in the XS function random_bytes(). The function does not validate that the length parameter is non-negative. If a negative value (e.g. -1) is supplied, the expression length + 1u causes an integer wraparound, resulting in a zero-byte allocation. The subsequent call to chosen random function (e.g. getrandom) passes the original negative value, which is implicitly converted to a large unsigned value (typically SIZE_MAX). This can result in writes beyond the allocated buffer, leading to heap memory corruption and application crash (denial of service). In common usage, the length argument is typically hardcoded by the caller, which reduces the likelihood of attacker-controlled exploitation. Applications that pass untrusted input to this parameter may be affected.
A heap buffer overflow vulnerability has been identified in Crypt::SysRandom::XS versions prior to 0.010 for Perl. The issue arises in the XS function random_bytes(), which fails to validate that the length parameter is non-negative. When a negative value is supplied, it causes an integer wraparound, leading to a zero-byte allocation. This allows for a subsequent call to the chosen random function to pass the original negative value, converted to a large unsigned value, resulting in writes beyond the allocated buffer. Such memory corruption can cause the application to crash, creating a denial-of-service condition. While the length argument is usually hardcoded, applications that accept untrusted input may be vulnerable.
Users are advised to update to Crypt::SysRandom::XS version 0.010 or later, where this vulnerability has been addressed.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Feb 27, 2026References 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://metacpan.org/dist/Crypt-SysRandom-XS/changes | CPANSec | Release Notes |
| https://metacpan.org/release/LEONT/Crypt-SysRandom-XS-0.011/source/lib/Crypt/SysRandom/XS.xs#L51-52 | CPANSec | Issue Tracking |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-122 | Heap-based Buffer Overflow | CPANSec |
| CWE-1284 | Improper Validation of Specified Quantity in Input | CPANSec |
Affected Products
| Product | Versions |
|---|---|
| leont crypt::sysrandom::xs | < 0.010 |
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 |
| Mar 3, 2026 | Initial Analysis | [email protected] |
| Feb 27, 2026 | CVE Modified | CISA-ADP |
| Feb 27, 2026 | New CVE Received | CPANSec |