nimiq-account: Vesting insufficient funds error can panic
Moderate severity
GitHub Reviewed
Published
Apr 22, 2026
in
nimiq/core-rs-albatross
•
Updated Apr 27, 2026
Description
Published to the GitHub Advisory Database
Apr 22, 2026
Reviewed
Apr 22, 2026
Published by the National Vulnerability Database
Apr 22, 2026
Last updated
Apr 27, 2026
Impact
VestingContract::can_change_balancereturnsAccountError::InsufficientFundswhennew_balance < min_cap, but it constructs the error usingbalance: self.balance - min_cap.Coin::subpanics on underflow, so if an attacker can reach a state wheremin_cap > balance, the node crashes while trying to return an error.The
min_cap > balanceprecondition is attacker-reachable because the vesting contract creation data (32-byte format) allows encodingtotal_amountwithout validatingtotal_amount <= transaction.value(the real contract balance). After creating such a vesting contract, the attacker can broadcast an outgoing transaction to trigger the panic during mempool admission and block processing.Patches
The patch for this vulnerability is included as part of v1.3.0.
Workarounds
No known workarounds.
References