# CVE-2026-59146: 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

- Severity: High 7.8 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.14%, higher than 3% of CVEs (2026-12-01)
- Published: 2026-07-21T19:04:56.729Z
- Modified: 2026-10-24T19:10:00.127Z
- Weaknesses: CWE-125, CWE-787
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: CPANSec

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

(As written by CVE List.)

## Affected

- Data-SpatialHash-Shared: before 0.02

## References

- <https://metacpan.org/release/EGOR/Data-SpatialHash-Shared-0.02/diff/EGOR/Data-SpatialHash-Shared-0.01#sphash.h>
- <https://metacpan.org/release/EGOR/Data-SpatialHash-Shared-0.02/changes> (release-notes)

## Sources

- CVE List: [CVE-2026-59146](https://www.cve.org/CVERecord?id=CVE-2026-59146), CVE Terms of Use, modified 2026-07-22
- NVD: [CVE-2026-59146](https://nvd.nist.gov/vuln/detail/CVE-2026-59146), Public domain, modified 2026-10-24

---

Page: https://cve.day/CVE-2026-59146 · Whole record: https://cve.day/CVE-2026-59146.json · Rebuilt by cve.day 2026-11-25T22:59:29.396Z
