CVE-2026-59146: CWE-787 Out-of-bounds Write in EGOR Data::SpatialHash::Shared
Data::SpatialHash::Shared versions before 0.02 for Perl allow out-of-bounds reads and writes via unvalidated bucket, link and free-list indices in sph_walk_cell and sph_alloc_slot. The attach-time validator sph_validate_header checks the header scalars and region layout against the file size, but does not validate the array contents it then trusts. sph_walk_cell reads entries[buckets[b]] and follows each entry's next link raw, and sph_alloc_slot writes through a file-stored free_head index, none bounded against the entry count (max_entries). A local peer that can write the backing file can leave the header valid while poisoning the bucket chain and free list, so a query reads through an out-of-bounds bucket and next index and an insert writes through an out-of-bounds free-list head, corrupting memory or crashing the process.
AI Analysis
Technical Summary
The vulnerability in Data::SpatialHash::Shared (versions <0.02) arises from insufficient validation of array indices used in the functions sph_walk_cell and sph_alloc_slot. Although the attach-time validator sph_validate_header checks header scalars and region layout against file size, it does not validate the contents of arrays such as buckets and free lists. An attacker with local write access to the backing file can craft a valid header while poisoning bucket chains and free lists, leading to out-of-bounds reads and writes. Specifically, sph_walk_cell reads entries using unbounded bucket indices, and sph_alloc_slot writes through an unbounded free-list head index, resulting in memory corruption or crashes.
Potential Impact
A local attacker who can modify the backing file can exploit this vulnerability to cause out-of-bounds memory access, leading to potential memory corruption or process crashes. This compromises the stability and reliability of applications using the affected Data::SpatialHash::Shared module.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, restrict local write access to the backing file to trusted users only to prevent exploitation.
CVE-2026-59146: CWE-787 Out-of-bounds Write in EGOR Data::SpatialHash::Shared
Description
Data::SpatialHash::Shared versions before 0.02 for Perl allow out-of-bounds reads and writes via unvalidated bucket, link and free-list indices in sph_walk_cell and sph_alloc_slot. The attach-time validator sph_validate_header checks the header scalars and region layout against the file size, but does not validate the array contents it then trusts. sph_walk_cell reads entries[buckets[b]] and follows each entry's next link raw, and sph_alloc_slot writes through a file-stored free_head index, none bounded against the entry count (max_entries). A local peer that can write the backing file can leave the header valid while poisoning the bucket chain and free list, so a query reads through an out-of-bounds bucket and next index and an insert writes through an out-of-bounds free-list head, corrupting memory or crashing the process.
Affected software
pkg:github/Data-SpatialHash-SharedRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in Data::SpatialHash::Shared (versions <0.02) arises from insufficient validation of array indices used in the functions sph_walk_cell and sph_alloc_slot. Although the attach-time validator sph_validate_header checks header scalars and region layout against file size, it does not validate the contents of arrays such as buckets and free lists. An attacker with local write access to the backing file can craft a valid header while poisoning bucket chains and free lists, leading to out-of-bounds reads and writes. Specifically, sph_walk_cell reads entries using unbounded bucket indices, and sph_alloc_slot writes through an unbounded free-list head index, resulting in memory corruption or crashes.
Potential Impact
A local attacker who can modify the backing file can exploit this vulnerability to cause out-of-bounds memory access, leading to potential memory corruption or process crashes. This compromises the stability and reliability of applications using the affected Data::SpatialHash::Shared module.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, restrict local write access to the backing file to trusted users only to prevent exploitation.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- CPANSec
- Date Reserved
- 2026-07-02T16:24:17.913Z
- Cvss Version
- null
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a5fcbb52a4a8d5989ac6cd4
Added to database: 07/21/2026, 19:42:45 UTC
Last enriched: 07/21/2026, 19:53:23 UTC
Last updated: 07/21/2026, 21:09:23 UTC
Views: 5
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.