CVE-2026-2474

Crypt::URandom versions from 0.41 before 0.55 for Perl is vulnerable to a heap buffer overflow in the XS function crypt_urandom_getrandom()

Published Feb 16, 2026 CVSS 3.1 · 7.5 High EPSS < 1% KEV · Not listed
Description
Crypt::URandom versions from 0.41 before 0.55 for Perl is vulnerable to a heap buffer overflow in the XS function crypt_urandom_getrandom().

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 getrandom(data, length, GRND_NONBLOCK) 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.

Analysis

AI-generated

Technical impact

The Perl module Crypt::URandom contains a heap buffer overflow in the XS function crypt_urandom_getrandom() when the length argument is negative. Because the function fails to validate that the length is non‑negative, a negative value such as –1 causes an integer wraparound; the calculation length + 1u results in zero bytes allocated, while the subsequent call to getrandom() passes the original negative value as an unsigned quantity, typically SIZE_MAX. This mismatch allows the module to write beyond the allocated buffer, corrupting heap memory and causing the application to crash, which manifests as a denial of service. The vulnerability does not provide a direct path to remote code execution or information disclosure by itself. Based on the description, it is inferred that the attacker would need to provide a negative length argument, which in practice would require a point of input that is not properly validated or is controlled by an attacker.

Affected Systems

All installations of the DDICK Crypt::URandom module from version 0.41 up to and including 0.54 are affected. The fix is included in version 0.55 and later, which validates the length argument. The vulnerability applies to all platforms that use these versions, regardless of operating system, because it resides in native XS code shared across Perl interpreters. No specific operating system or architecture is excluded by the CVE data.

Risk and Exploitability

The CVSS base score of 7.5 indicates high severity, while the EPSS score below 1% suggests a very low probability of exploitation in the wild. The vulnerability is not listed in CISA's KEV catalog. The most likely attack vector, inferred from the lack of explicit user interaction in the CVE data, is through malicious or improperly sanitized input supplied to the length parameter. In typical usage the length is hardcoded, which limits exploitation opportunities, but applications that accept untrusted input for this parameter remain at risk of triggering the heap overflow and causing a denial of service.

Remediation

Vendor Solution

Update to version 0.55 or later


OpenCVE Recommended Actions

  • Update the Crypt::URandom module to version 0.55 or later.
  • Validate the length parameter in application code before calling crypt_urandom_getrandom(), ensuring it is non‑negative.
  • Restrict the length argument to trusted or sanitized sources to prevent accidental negative values.

Generated by OpenCVE AI on April 18, 2026 at 17:58 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Ddick crypt\
CPEs cpe:2.3:a:ddick:crypt\:\:urandom:*:*:*:*:*:perl:*:*
Vendors & Products Ddick crypt\
Type Values Removed Values Added
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}

ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Ddick
Ddick crypt::urandom
Vendors & Products Ddick
Ddick crypt::urandom
Type Values Removed Values Added
Description Crypt::URandom versions from 0.41 before 0.55 for Perl is vulnerable to a heap buffer overflow in the XS function crypt_urandom_getrandom(). 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 getrandom(data, length, GRND_NONBLOCK) 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.
Title Crypt::URandom versions from 0.41 before 0.55 for Perl is vulnerable to a heap buffer overflow in the XS function crypt_urandom_getrandom()
Weaknesses CWE-122
CWE-1284
References
Weaknesses
  • CWE-122

    Heap-based Buffer Overflow

  • CWE-1284

    Improper Validation of Specified Quantity in Input

Sources

Status
PUBLISHED
Assigner
CPANSec
Published
Updated
Feb 17, 2026, 2:48 PM
Reserved
Feb 13, 2026, 3:45 PM
Status
Analyzed
Published
Feb 16, 2026, 9:22 PM
Modified
Jun 17, 2026, 10:31 AM