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.
Published: 2026-02-16
Score: 7.5 High
EPSS: < 1% Very Low
KEV: No
Impact: Heap Buffer Overflow – potential memory corruption and denial of service
Action: Patch
AI Analysis

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.

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

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 yet.

History

Wed, 04 Mar 2026 02:30:00 +0000

Type Values Removed Values Added
First Time appeared Ddick crypt\
CPEs cpe:2.3:a:ddick:crypt\:\:urandom:*:*:*:*:*:perl:*:*
Vendors & Products Ddick crypt\

Tue, 17 Feb 2026 15:15:00 +0000

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'}


Tue, 17 Feb 2026 09:00:00 +0000

Type Values Removed Values Added
First Time appeared Ddick
Ddick crypt::urandom
Vendors & Products Ddick
Ddick crypt::urandom

Mon, 16 Feb 2026 21:15:00 +0000

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

Subscriptions

Ddick Crypt::urandom Crypt\
cve-icon MITRE

Status: PUBLISHED

Assigner: CPANSec

Published:

Updated: 2026-02-17T14:48:49.595Z

Reserved: 2026-02-13T15:45:19.206Z

Link: CVE-2026-2474

cve-icon Vulnrichment

Updated: 2026-02-17T14:48:44.873Z

cve-icon NVD

Status : Analyzed

Published: 2026-02-16T21:22:18.107

Modified: 2026-03-04T02:27:15.217

Link: CVE-2026-2474

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-04-18T18:00:06Z

Weaknesses