CVE-2026-8829: Perl Xs Svpv Alias Uaf

A string buffer pointer is extracted via `SvPV` from a hash value fetched using `hv_fetch`. If this hash value is self-aliased with an SV that gets reallocated (e.g., via `SvGROW`), the cached pointer will point to freed memory, causing a use-after-free. Ensure you check for self-aliasing between the fetched SV and the target SV before caching the pointer.

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0C
greprules fetch cve-2026-8829-perl-xs-svpv-alias-uaf --engine opengrep

Description

A string buffer pointer is extracted via `SvPV` from a hash value fetched using `hv_fetch`. If this hash value is self-aliased with an SV that gets reallocated (e.g., via `SvGROW`), the cached pointer will point to freed memory, causing a use-after-free. Ensure you check for self-aliasing between the fetched SV and the target SV before caching the pointer.