Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-2597: CWE-122 Heap-based Buffer Overflow in LEONT Crypt::SysRandom::XS

0
High
VulnerabilityCVE-2026-2597cvecve-2026-2597cwe-122cwe-1284
Published: Thu Feb 26 2026 (02/26/2026, 23:29:16 UTC)
Source: CVE Database V5
Vendor/Project: LEONT
Product: Crypt::SysRandom::XS

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.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 02/26/2026, 23:57:30 UTC

Technical Analysis

CVE-2026-2597 is a heap-based buffer overflow vulnerability identified in the Perl module Crypt::SysRandom::XS, specifically in versions prior to 0.010. The issue resides in the XS function random_bytes(), which is designed to generate random bytes of a specified length. The vulnerability arises because the function does not validate that the length parameter is non-negative. If a negative value, such as -1, is supplied, the expression length + 1u (unsigned) causes an integer wraparound, resulting in an allocation of zero bytes on the heap. However, the subsequent call to the underlying random number generation function (e.g., getrandom) uses the original negative length value, which is implicitly converted to a very large unsigned integer (commonly SIZE_MAX). This mismatch causes the function to write beyond the allocated buffer, corrupting heap memory. The corruption can lead to application crashes, resulting in denial of service. While the vulnerability is severe in terms of memory safety, exploitation is limited by the fact that the length parameter is typically hardcoded by developers, reducing the chance of attacker-controlled input. However, applications that pass untrusted or user-controlled input to random_bytes() are at risk. No public exploits have been reported to date. The vulnerability is classified under CWE-122 (Heap-based Buffer Overflow) and CWE-1284 (Improper Validation of Array Index). No CVSS score has been assigned yet.

Potential Impact

The primary impact of this vulnerability is denial of service due to application crashes caused by heap memory corruption. In environments where the length parameter to random_bytes() can be influenced by an attacker, this could lead to repeated crashes, disrupting service availability. Although no known exploits exist, the heap corruption could potentially be leveraged for more advanced attacks such as remote code execution or privilege escalation if combined with other vulnerabilities or memory corruption techniques. Organizations relying on Crypt::SysRandom::XS for cryptographic randomness in Perl applications may face stability issues or service interruptions. The risk is higher for applications that accept untrusted input for the length parameter, which could be exploited to trigger the overflow. Given the widespread use of Perl in web applications, system scripts, and automation, affected systems could include web servers, backend services, and security tools that depend on this module. The lack of authentication or user interaction requirements for triggering the vulnerability increases the risk in scenarios where input is not properly sanitized.

Mitigation Recommendations

To mitigate this vulnerability, organizations should immediately upgrade Crypt::SysRandom::XS to version 0.010 or later once available, where proper validation of the length parameter is implemented. Until a patched version is released, developers should audit their code to ensure that the length argument passed to random_bytes() is strictly validated and never derived from untrusted or user-controlled input. Implement input validation checks to reject negative or out-of-range values before calling random_bytes(). Employ runtime protections such as heap memory corruption detection tools (e.g., AddressSanitizer) during development and testing to catch potential misuse. Additionally, consider applying application-level sandboxing or process isolation to limit the impact of potential crashes. Monitoring application logs for crashes or abnormal behavior related to random_bytes() calls can help detect exploitation attempts. Finally, maintain an inventory of Perl modules in use and track updates from the vendor to apply patches promptly.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
CPANSec
Date Reserved
2026-02-16T20:27:02.194Z
Cvss Version
null
State
PUBLISHED

Threat ID: 69a0da1732ffcdb8a272349d

Added to database: 2/26/2026, 11:41:11 PM

Last enriched: 2/26/2026, 11:57:30 PM

Last updated: 4/12/2026, 9:11:32 AM

Views: 67

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses