{"id":"CVE-2026-59146","state":"PUBLISHED","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.","publishedAt":"2026-07-21T19:04:56.729Z","updatedAt":"2026-07-22T19:36:54.589Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","source":"CISA-ADP"},"assigner":"CPANSec","products":["EGOR Data::SpatialHash::Shared"],"affected":[{"vendor":"EGOR","product":"Data::SpatialHash::Shared","packageName":"Data-SpatialHash-Shared","defaultStatus":"unaffected","versions":[{"version":"0","status":"affected","lessThan":"0.02","versionType":"custom"}],"collectionURL":"https://cpan.org/modules","programFiles":["sphash.h"],"programRoutines":[{"name":"sph_walk_cell"},{"name":"sph_alloc_slot"}],"repo":"https://github.com/vividsnow/perl5-data-spatialhash-shared"}],"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"],"weaknesses":["CWE-787","CWE-125"],"ingestedAt":"2026-10-29T20:12:32.778Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/59xxx/CVE-2026-59146.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-59146","state":"PUBLISHED","datePublished":"2026-07-21T19:04:56.729Z","dateUpdated":"2026-07-22T19:36:54.589Z","assignerShortName":"CPANSec","assignerOrgId":"9b29abf9-4ab0-4765-b253-1875cd9b441e","dateReserved":"2026-07-02T16:24:17.913Z"},"containers":{"cna":{"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","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."}],"affected":[{"vendor":"EGOR","product":"Data::SpatialHash::Shared","packageName":"Data-SpatialHash-Shared","defaultStatus":"unaffected","versions":[{"version":"0","status":"affected","lessThan":"0.02","versionType":"custom"}],"collectionURL":"https://cpan.org/modules","programFiles":["sphash.h"],"programRoutines":[{"name":"sph_walk_cell"},{"name":"sph_alloc_slot"}],"repo":"https://github.com/vividsnow/perl5-data-spatialhash-shared"}],"references":[{"url":"https://metacpan.org/release/EGOR/Data-SpatialHash-Shared-0.02/diff/EGOR/Data-SpatialHash-Shared-0.01#sphash.h"},{"url":"https://metacpan.org/release/EGOR/Data-SpatialHash-Shared-0.02/changes","tags":["release-notes"]}],"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":{"shortName":"CPANSec","orgId":"9b29abf9-4ab0-4765-b253-1875cd9b441e","dateUpdated":"2026-07-21T19:04:56.729Z"},"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"},"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"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":7.8,"attackVector":"LOCAL","baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","integrityImpact":"HIGH","userInteraction":"REQUIRED","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"NONE","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"timestamp":"2026-07-22T19:36:20.230490Z","id":"CVE-2026-59146","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-07-22T19:36:54.589Z"}}]}}}