{"api_version":"1","generated_at":"2026-07-21T22:59:25+00:00","cve":"CVE-2026-59146","urls":{"html":"https://cve.report/CVE-2026-59146","api":"https://cve.report/api/cve/CVE-2026-59146.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-59146","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-59146"},"summary":{"title":"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","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.\n\nThe 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).\n\nA 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.","state":"PUBLISHED","assigner":"CPANSec","published_at":"2026-07-21 20:17:03","updated_at":"2026-07-21 20:17:03"},"problem_types":["CWE-125","CWE-787","CWE-787 CWE-787 Out-of-bounds Write","CWE-125 CWE-125 Out-of-bounds Read"],"metrics":[],"references":[{"url":"https://metacpan.org/release/EGOR/Data-SpatialHash-Shared-0.02/changes","name":"https://metacpan.org/release/EGOR/Data-SpatialHash-Shared-0.02/changes","refsource":"9b29abf9-4ab0-4765-b253-1875cd9b441e","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://metacpan.org/release/EGOR/Data-SpatialHash-Shared-0.02/diff/EGOR/Data-SpatialHash-Shared-0.01#sphash.h","name":"https://metacpan.org/release/EGOR/Data-SpatialHash-Shared-0.02/diff/EGOR/Data-SpatialHash-Shared-0.01#sphash.h","refsource":"9b29abf9-4ab0-4765-b253-1875cd9b441e","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-59146","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59146","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"EGOR","product":"Data::SpatialHash::Shared","version":"affected 0.02 custom","platforms":[]}],"timeline":[],"solutions":[{"source":"CNA","title":"","value":"Upgrade to Data::SpatialHash::Shared 0.02 or later, which bounds every entry index against the entry count before dereferencing it.","time":"","lang":"en"}],"workarounds":[{"source":"CNA","title":"","value":"For deployments that cannot upgrade to 0.02, place the backing file in a directory writable only by the owning user, so a local peer cannot tamper with the bucket chain and free list.","time":"","lang":"en"}],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"collectionURL":"https://cpan.org/modules","defaultStatus":"unaffected","packageName":"Data-SpatialHash-Shared","product":"Data::SpatialHash::Shared","programFiles":["sphash.h"],"programRoutines":[{"name":"sph_walk_cell"},{"name":"sph_alloc_slot"}],"repo":"https://github.com/vividsnow/perl5-data-spatialhash-shared","vendor":"EGOR","versions":[{"lessThan":"0.02","status":"affected","version":"0","versionType":"custom"}]}],"descriptions":[{"lang":"en","value":"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.\n\nThe 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).\n\nA 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."}],"problemTypes":[{"descriptions":[{"cweId":"CWE-787","description":"CWE-787 Out-of-bounds Write","lang":"en","type":"CWE"}]},{"descriptions":[{"cweId":"CWE-125","description":"CWE-125 Out-of-bounds Read","lang":"en","type":"CWE"}]}],"providerMetadata":{"dateUpdated":"2026-07-21T19:04:56.729Z","orgId":"9b29abf9-4ab0-4765-b253-1875cd9b441e","shortName":"CPANSec"},"references":[{"url":"https://metacpan.org/release/EGOR/Data-SpatialHash-Shared-0.02/diff/EGOR/Data-SpatialHash-Shared-0.01#sphash.h"},{"tags":["release-notes"],"url":"https://metacpan.org/release/EGOR/Data-SpatialHash-Shared-0.02/changes"}],"solutions":[{"lang":"en","value":"Upgrade to Data::SpatialHash::Shared 0.02 or later, which bounds every entry index against the entry count before dereferencing it."}],"source":{"discovery":"UNKNOWN"},"title":"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","workarounds":[{"lang":"en","value":"For deployments that cannot upgrade to 0.02, place the backing file in a directory writable only by the owning user, so a local peer cannot tamper with the bucket chain and free list."}],"x_generator":{"engine":"cpansec-cna-tool 0.1"}}},"cveMetadata":{"assignerOrgId":"9b29abf9-4ab0-4765-b253-1875cd9b441e","assignerShortName":"CPANSec","cveId":"CVE-2026-59146","datePublished":"2026-07-21T19:04:56.729Z","dateReserved":"2026-07-02T16:24:17.913Z","dateUpdated":"2026-07-21T19:04:56.729Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-07-21 20:17:03","lastModifiedDate":"2026-07-21 20:17:03","problem_types":["CWE-125","CWE-787","CWE-787 CWE-787 Out-of-bounds Write","CWE-125 CWE-125 Out-of-bounds Read"],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"59146","Ordinal":"1","Title":"Data::SpatialHash::Shared versions before 0.02 for Perl allow ou","CVE":"CVE-2026-59146","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"59146","Ordinal":"1","NoteData":"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.\n\nThe 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).\n\nA 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.","Type":"Description","Title":"Data::SpatialHash::Shared versions before 0.02 for Perl allow ou"}]}}}