Rust advisories / xmas-elf
Vulnerability MediumRUSTSEC-2025-0018 · xmas-elf
RUSTSEC-2025-0018: Potential out-of-bounds read with a malformed ELF file and the HashTable API.
Short answerA security vulnerability in the xmas-elf crate: Potential out-of-bounds read with a malformed ELF file and the HashTable API.. GitHub rates it Medium. Fixed in 0.10.0: update to a fixed version.
| Crate | xmas-elf |
|---|---|
| Type | Vulnerability (memory-exposure) |
| Affected versions | Before 0.10.0. |
| Fixed in | 0.10.0 |
| Severity | Medium (GitHub rating) |
| Published | 2025-03-26 |
| Last changed | 2025-10-28 |
| Also known as | GHSA-9cc5-2pq7-hfj8 |
| Affected functions | xmas_elf::hash::HashTable::get_bucket, xmas_elf::hash::HashTable::get_chain |
What to do
- See which version you have:
cargo tree -i xmas-elf(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p xmas-elf. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplexmas-elf = "0.10.0") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
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.
References
- Package: crates.io/crates/xmas-elf
- Advisory: rustsec.org/advisories/RUSTSEC-2025-0018.html
- Report: github.com/nrc/xmas-elf/issues/86
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Up next
Are you affected?Check your whole dependency treePaste Cargo.lock: every advisory, for your exact versions.Read it next →Also worth your time
Did this answer your question?