GitHub Advisoryadvisory · crates.io

GHSA-9cc5-2pq7-hfj8 xmas-elf potential out-of-bounds read with a malformed ELF file and the HashTable API.

MEDIUM Published 2025-03-26 Modified 2025-03-26 Official page ↗
Ecosystem
crates.io
Packages
xmas-elf
Severity
Moderate
CVSS vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
Weaknesses
CWE-125
Reviewed
2025-03-26

Affected packages

• crates.io xmas-elf: < 0.10 → fixed in 0.10

Description

Affected versions of this crate only validated the `index` argument of `HashTable::get_bucket` and `HashTable::get_chain` against the input-controlled `bucket_count` and `chain_count` fields, but not against the size of the ELF section. As a result, a malformed ELF file could trigger out-of-bounds reads in a consumer of the HashTable API by setting these fields to inappropriately large values that would fall outside the relevant hash table section, and by introducing correspondingly out-of-bounds hash table indexes elsewhere in the ELF file.

Related

Weakness · CWE (1)

  • CWE-125 Out-of-bounds Read weakness

References