CVE-2026-54542: nimiq-primitives Out-of-bounds Panic Vulnerability

LOW
Advisory Identifier: GHSA-5rg2-xv9j-gv5p
CVSS 3.7
CWE-125
Published
Advisory Summary

CVE-2026-54542 is a LOW (CVSS 3.7) out-of-bounds panic vulnerability (CWE-125: Out-of-bounds Read) affecting nimiq-primitives libraries in the crates.io ecosystem. The issue involves out-of-bounds panic in keynibbles::add from oversized child suffix in a deserialized proof. Remediation is available by upgrading affected packages to version 1.6.0.

CVE-2026-54542 at a Glance

CVE Identifier CVE-2026-54542
GHSA Identifier GHSA-5rg2-xv9j-gv5p
Severity LOW
CVSS v3.1 Base Score 3.7
CWE Classification CWE-125: Out-of-bounds Read
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-54542

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-54542, 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-125: Out-of-bounds Read, where the product reads data past the end, or before the beginning, of the intended buffer. 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 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.

CVE-2026-54542 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-54542?
CVE-2026-54542 is a security vulnerability in nimiq-primitives involving Out-of-bounds panic in KeyNibbles::Add from oversized child suffix in a deserialized proof under CWE-125: Out-of-bounds Read.
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-54542?
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-54542?
CVE-2026-54542 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-54542?
CVE-2026-54542 is classified under CWE-125: Out-of-bounds Read (The product reads data past the end, or before the beginning, of the intended buffer.).
How can I check crates.io dependencies for CVE-2026-54542?
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-5rg2-xv9j-gv5p",
  "modified" : "2026-07-16T20:03:25Z",
  "published" : "2026-07-16T20:03:25Z",
  "aliases" : [ "CVE-2026-54542" ],
  "summary" : "nimiq-primitives: Out-of-bounds panic in KeyNibbles::Add from oversized child suffix in a deserialized proof",
  "details" : "### Impact\n\nA 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).\n\n`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).\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/3790 (commit `eabfc3e2`), which guards key-nibble concatenation against exceeding the maximum length instead of indexing out of bounds.\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-5rg2-xv9j-gv5p"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nimiq/core-rs-albatross/pull/3790"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nimiq/core-rs-albatross/commit/eabfc3e21731b0628c3f933163a0f1e1864217bf"
  }, {
    "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-125" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-16T20:03:25Z",
    "nvd_published_at" : null
  }
}