Description
Data::RingBuffer::Shared versions before 0.04 for Perl allow a stack buffer overflow via an unvalidated elem_size in ring_read_seq.

The attach-time validator ring_validate_header checks the capacity-overflow and total_size consistency of the header but never caps elem_size against the destination size. ring_read_seq does memcpy(out, ring_slot(h, seq), elem_size) with elem_size read raw from the mmap'd segment, copying into a fixed 8-byte destination scalar. An elem_size larger than 8 bytes writes past the destination.

A local peer that can write the backing file can leave the header valid while setting a large elem_size, so the next read copies a file-controlled length into the fixed 8-byte stack buffer, corrupting adjacent stack frames.
Published: 2026-07-21
Score: 9.8 Critical
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Data::RingBuffer::Shared before 0.04 contains a flaw where the ring_read_seq routine copies an unvalidated element size directly into a fixed 8‑byte buffer on the stack. When the elem_size field in the shared memory header exceeds eight bytes, a memcpy writes beyond the bounds of the destination scalar, corrupting adjacent stack data. This classic stack buffer overflow can compromise program stability and potentially enable arbitrary code execution.

Affected Systems

The vulnerability afflicts the EGOR Data::RingBuffer::Shared Perl module. All releases earlier than 0.04 are vulnerable. No other vendors or products are listed.

Risk and Exploitability

The CVSS score of 9.8 reflects critical severity, while the EPSS score of less than 1% indicates a low current exploitation probability. The flaw is not listed in CISA KEV. The attack requires a local attacker who can write to the backing file used by the shared buffer. If the backing file resides in a directory writable by untrusted local users or processes, an attacker can set an oversized elem_size, trigger the overflow, and corrupt the stack. The description does not confirm successful code execution, but based on the nature of the overflow it is inferred that an attacker could potentially leverage the memory corruption for code execution.

Generated by OpenCVE AI on August 4, 2026 at 05:31 UTC.

Remediation

Vendor Solution

Upgrade to Data::RingBuffer::Shared 0.04 or later, which pins elem_size to the fixed element size of the buffer's registered variant.


Vendor Workaround

For deployments that cannot upgrade to 0.04, place the backing file in a directory writable only by the owning user, so a local peer cannot tamper with the elem_size the read path trusts.


OpenCVE Recommended Actions

  • Upgrade Data::RingBuffer::Shared to version 0.04 or later, which pins elem_size to the correct fixed element size and eliminates the overflow.
  • If upgrade is not possible, keep the backing file in a directory that is writable only by the owning user, so that no other local process can alter elem_size.
  • Restrict write permissions on the shared‑memory backing file and its containing directory using owner‑only mode or, if applicable, SELinux/AppArmor rules to prevent tampering by local users.

Generated by OpenCVE AI on August 4, 2026 at 05:31 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 23 Jul 2026 21:45:00 +0000

Type Values Removed Values Added
First Time appeared Egor
Egor data::ringbuffer::shared
Vendors & Products Egor
Egor data::ringbuffer::shared

Wed, 22 Jul 2026 20:30:00 +0000

Type Values Removed Values Added
Metrics cvssV3_1

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

ssvc

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


Tue, 21 Jul 2026 19:45:00 +0000

Type Values Removed Values Added
Description Data::RingBuffer::Shared versions before 0.04 for Perl allow a stack buffer overflow via an unvalidated elem_size in ring_read_seq. The attach-time validator ring_validate_header checks the capacity-overflow and total_size consistency of the header but never caps elem_size against the destination size. ring_read_seq does memcpy(out, ring_slot(h, seq), elem_size) with elem_size read raw from the mmap'd segment, copying into a fixed 8-byte destination scalar. An elem_size larger than 8 bytes writes past the destination. A local peer that can write the backing file can leave the header valid while setting a large elem_size, so the next read copies a file-controlled length into the fixed 8-byte stack buffer, corrupting adjacent stack frames.
Title Data::RingBuffer::Shared versions before 0.04 for Perl allow a stack buffer overflow via an unvalidated elem_size in ring_read_seq
Weaknesses CWE-121
References

Subscriptions

Egor Data::ringbuffer::shared
cve-icon MITRE

Status: PUBLISHED

Assigner: CPANSec

Published:

Updated: 2026-07-22T19:33:34.869Z

Reserved: 2026-07-02T16:24:17.913Z

Link: CVE-2026-59144

cve-icon Vulnrichment

Updated: 2026-07-22T19:33:04.793Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-04T05:45:03Z

Weaknesses
  • CWE-121

    Stack-based Buffer Overflow