CVE-2026-54541: nimiq-primitives Panic Vulnerability

LOW
Advisory Identifier: GHSA-46wq-28cx-mhw4
CVSS 3.7
CWE-248
Published
Advisory Summary

CVE-2026-54541 is a LOW (CVSS 3.7) panic vulnerability (CWE-248: Uncaught Exception) affecting nimiq-primitives libraries in the crates.io ecosystem. The issue involves panic in trieproof::verify via child_index unwrap on equal-length keys. Remediation is available by upgrading affected packages to version 1.6.0.

CVE-2026-54541 at a Glance

CVE Identifier CVE-2026-54541
GHSA Identifier GHSA-46wq-28cx-mhw4
Severity LOW
CVSS v3.1 Base Score 3.7
CWE Classification CWE-248: Uncaught Exception
Affected Product nimiq-primitives
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 3.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2026-54541

To remediate this vulnerability, upgrade all affected nimiq-primitives dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

nimiq-primitives fixed: 1.6.0
Upgrade nimiq-primitives to 1.6.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for nimiq-primitives

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-54541, inspect your project dependencies for nimiq-primitives:

inspect dependencies for nimiq-primitives

Analyze the terminal output to locate any version of nimiq-primitives in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.6.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-248: Uncaught Exception, where an exception is thrown from a function, but it is not caught. In nimiq-primitives, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact A malicious peer acting as a state-sync source can crash a syncing node by sending a crafted `TrieChunk` whose proof contains two `TrieProofNode`s with identical keys. `TrieProof::verify()` calls `TrieProofNode::child_index()` (`primitives/src/trie/trie_proof_node.rs:94`), which unconditionally unwraps `KeyNibbles::get(self.key.len())`. Because `is_prefix_of` returns `true` for two equal keys, execution reaches `get(len)`, which returns `None`, and the `unwrap()` panics. The panic is reached from untrusted network input (`ResponseChunk` → `commit_chunks` → `put_chunk` → `proof.verify()`) **before** any cryptographic proof verification, so the attacker does not need to produce a valid proof. Exploitation requires the attacker to be selected as the victim's sync peer while the victim is performing 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/3789 (commit `41d35ace`). `child_index` now rejects equal-length keys and returns `MerkleRadixTrieError::WrongPrefix` instead of unwrapping. ### Workarounds None other than syncing only from trusted peers. Upgrade to 1.6.0.

CVE-2026-54541 Affected nimiq-primitives Versions

1 component(s)
Fixed Versions:
1.6.0
Product / Package Ecosystem Affected Versions Fixed Version
nimiq-primitives
crates.io
< 1.6.0
1.6.0

References

Frequently Asked Questions

What is CVE-2026-54541?
CVE-2026-54541 is a security vulnerability in nimiq-primitives involving Panic in TrieProof::verify via child_index unwrap on equal-length keys under CWE-248: Uncaught Exception.
Which nimiq-primitives versions are affected?
Affected versions include releases prior to 1.6.0 across affected packages: nimiq-primitives.
What version fixes CVE-2026-54541?
Upgrading to 1.6.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is nimiq-primitives affected?
Yes, nimiq-primitives is affected in releases prior to 1.6.0. Upgrade your dependency to 1.6.0 or later.
What is the CVSS score of CVE-2026-54541?
CVE-2026-54541 has a CVSS v3.1 base score of 3.7 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2026-54541?
CVE-2026-54541 is classified under CWE-248: Uncaught Exception (An exception is thrown from a function, but it is not caught.).
How can I check crates.io dependencies for CVE-2026-54541?
Run the dependency tree command: 'inspect dependencies for nimiq-primitives'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-46wq-28cx-mhw4",
  "modified" : "2026-07-16T20:03:00Z",
  "published" : "2026-07-16T20:03:00Z",
  "aliases" : [ "CVE-2026-54541" ],
  "summary" : "nimiq-primitives: Panic in TrieProof::verify via child_index unwrap on equal-length keys",
  "details" : "### Impact\n\nA malicious peer acting as a state-sync source can crash a syncing node by sending a crafted `TrieChunk` whose proof contains two `TrieProofNode`s with identical keys. `TrieProof::verify()` calls `TrieProofNode::child_index()` (`primitives/src/trie/trie_proof_node.rs:94`), which unconditionally unwraps `KeyNibbles::get(self.key.len())`. Because `is_prefix_of` returns `true` for two equal keys, execution reaches `get(len)`, which returns `None`, and the `unwrap()` panics.\n\nThe panic is reached from untrusted network input (`ResponseChunk` → `commit_chunks` → `put_chunk` → `proof.verify()`) **before** any cryptographic proof verification, so the attacker does not need to produce a valid proof. Exploitation requires the attacker to be selected as the victim's sync peer while the victim is performing state sync, and the resulting crash is transient (the node restarts and re-syncs).\n\nAffected: core-rs-albatross <= 1.5.1 (`nimiq-primitives`).\n\n### Patches\n\nFixed in **1.6.0** via https://github.com/nimiq/core-rs-albatross/pull/3789 (commit `41d35ace`). `child_index` now rejects equal-length keys and returns `MerkleRadixTrieError::WrongPrefix` instead of unwrapping.\n\n### Workarounds\n\nNone other than syncing only from trusted peers. Upgrade to 1.6.0.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "nimiq-primitives"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.6.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nimiq/core-rs-albatross/security/advisories/GHSA-46wq-28cx-mhw4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nimiq/core-rs-albatross/pull/3789"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nimiq/core-rs-albatross/commit/41d35acee1b5cf3bc34ec3ddc1abbc03604e791e"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nimiq/core-rs-albatross"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nimiq/core-rs-albatross/releases/tag/v1.6.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-248" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-16T20:03:00Z",
    "nvd_published_at" : null
  }
}