CVE-2026-54542: nimiq-primitives: Out-of-bounds panic in KeyNibbles::Add from oversized child suffix in a deserialized proof
Impact A malicious peer acting as a state-sync source can crash a syncing node with a crafted TrieChunk whose proof contains a TrieNodeChild whose suffix, when concatenated with the parent key via KeyNibbles::Add, exceeds the fixed 63-byte backing array.
Published Jul 16, 2026
Affected packages
nimiq-primitives
- Ecosystem
- Rust (crates.io)
- Affected
- < 1.6.0
- Fixed in
- 1.6.0
- Check
cargo tree -i nimiq-primitives
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Impact
A malicious peer acting as a state-sync source can crash a syncing node with a crafted TrieChunk whose proof contains a TrieNodeChild whose suffix, when concatenated with the parent key via KeyNibbles::Add, exceeds the fixed 63-byte backing array. Add (primitives/src/key_nibbles.rs:332 / :341) indexes bytes[self.bytes_len()..self.bytes_len() + other.bytes_len()] with no combined-length check, causing an out-of-bounds slice panic (both the even- and odd-length branches).
KeyNibbles deserialization validates only the individual length <= 126, not the combined parent + suffix length. The panic occurs at put_chunk → child.key() → is_stump() → +, i.e. before proof.verify(), so no valid proof is required. As with the related child_index issue, exploitation requires being the victim's sync peer during state sync, and the resulting crash is transient (the node restarts and re-syncs).
Affected: core-rs-albatross <= 1.5.1 (nimiq-primitives).
Patches
Fixed in 1.6.0 via https://github.com/nimiq/core-rs-albatross/pull/3790 (commit eabfc3e2), which guards key-nibble concatenation against exceeding the maximum length instead of indexing out of bounds.
Workarounds
None other than syncing only from trusted peers. Upgrade to 1.6.0.
Credited to paberr, Piravlos.
References
- https://github.com/nimiq/core-rs-albatross/security/advisories/GHSA-5rg2-xv9j-gv5p
- https://github.com/nimiq/core-rs-albatross/pull/3790
- https://github.com/nimiq/core-rs-albatross/commit/eabfc3e21731b0628c3f933163a0f1e1864217bf
- https://github.com/nimiq/core-rs-albatross/releases/tag/v1.6.0
- https://github.com/advisories/GHSA-5rg2-xv9j-gv5p
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Rust (crates.io) vulnerabilities
All Rust (crates.io) entriesCVE-2026-54541
nimiq-primitives: Panic in TrieProof::verify via child_index unwrap on equal-length keys
low3.7Jul 16, 2026CVE-2026-46539
nimiq-primitives: BlockInclusionProof interlink issue when hops are empty
medium5.9No fixMay 21, 2026CVE-2026-46545
nimiq-primitives: Panic DoS in trie chunk processing via ROOT-keyed item
high7.5May 21, 2026CVE-2026-34065
nimiq-primitives: Node crash due to missing interlink validation in election macro block proposals
high7.5No fixApr 22, 2026
