GHSA-9cc5-2pq7-hfj8 — xmas-elf
Fix: nrc/xmas-elf@57685c3GHSA-9cc5-2pq7-hfj8 is a security vulnerability in xmas-elf. A fix is available for xmas-elf — see the affected versions and patch details below.
xmas-elf potential out-of-bounds read with a malformed ELF file and the HashTable API.
Real-World Exposure
xmas-elfReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🦀crates.io | xmas-elf | all versions | 0.10cargo update -p xmas-elf --precise 0.10 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for xmas-elf, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update xmas-elf to 0.10 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-9cc5-2pq7-hfj8 is resolved across your whole dependency graph.
Workarounds
Constrain what reaches the vulnerable code: limit the size and shape of untrusted input, isolate the affected component in a sandboxed or least-privileged process, and enable the platform's memory-safety mitigations (ASLR, stack protector, hardened allocator) so an out-of-bounds access is more likely to fail closed than to be exploitable.
Frequently Asked Questions
Is GHSA-9cc5-2pq7-hfj8 in your dependencies?
Find it across crates.io, including transitive dependencies.