CVE-2026-54592: Ruby C Ext Unrestored Pointer Increment

Pointer or depth index `$DOC->$WHERE` is incremented prior to invoking `rb_yield` without state restoration (`$DOC->$WHERE--`) or depth bounds checking. When invoked recursively inside callback blocks, this can cause state pointer corruption and stack buffer overflow.

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0C
greprules fetch cve-2026-54592-ruby-c-ext-unrestored-pointer-increment --engine opengrep

Description

Pointer or depth index `$DOC->$WHERE` is incremented prior to invoking `rb_yield` without state restoration (`$DOC->$WHERE--`) or depth bounds checking. When invoked recursively inside callback blocks, this can cause state pointer corruption and stack buffer overflow.