Integer Overflow in Klever Split-Royalty Validation Enables Unbounded Token Minting
An integer overflow vulnerability in the Klever node (klever-go) allows attackers to mint arbitrary amounts of KLV and other assets by bypassing split-royalty validation checks.
The Klever blockchain node (klever-go) contains a critical integer overflow vulnerability in its split-royalty validation logic. The system decodes per-entry royalty percentages as uint32 values without individual upper bounds and aggregates them into a uint32 accumulator. By providing two split royalty entries that sum to a value exceeding 2^32, the accumulator wraps around to zero, successfully passing the 100% (10000) validation check.
During royalty payout, the system calculates payments using these massive overflowed values, crediting recipients with KLV far exceeding the original royalty pool. The negative remainder is silently discarded rather than returning an error, allowing the attacker to mint KLV or other assets out of thin air. This vulnerability is not gated by existing guards such as FixMarketBuyOverflow and remains exploitable on current mainnet deployments. Because the minted tokens are credited directly via balance modification rather than tracked mint events, the inflation remains invisible in official supply dashboards, posing a significant risk to the economic integrity of the ecosystem.
Attack Chain
- Attacker crafts a malicious KDA asset creation transaction using the
kloperatortool. - The transaction includes two split-royalty recipients, each assigned a percentage value of 21474836.48.
- The node processes these as raw
uint32values (2147483648), causing the sum to wrap around to0in theuint32accumulator. - The
CheckValid100Paramsfunction incorrectly validates the wrapped sum of0as permissible. - The attacker initiates a standard asset transfer or market buy, triggering the royalty payout logic.
- The payout logic retrieves the overflowed
2147483648percentage, calculating a massive credit for the recipient. - The
AddToBalancefunction executes, crediting the recipient's wallet with inflated KLV or asset balances. - The system silently ignores the resulting negative remainder, finalizing the unauthorized mint.
Impact
Successful exploitation results in the unbounded inflation of KLV and other assets. Because the inflation is handled via direct balance updates rather than tracked minting processes, the supply metrics appear accurate while the token value is eroded. This can lead to a total loss of economic integrity, affecting all holders within the Klever ecosystem. Any user with sufficient funds for transaction fees can exploit this without requiring administrative privileges.
Recommendation
- Implement per-entry bounds checking in
decodeSplitInfowithincore/kapp/builtInFunctions/utils.goto reject any individual percentage exceedingHundredPercent(10000). - Modify the validation logic in
core/kapp/kda/create.goandcore/kapp/kda/trigger.goto useuint64accumulators to prevent integer wrapping during the summation of royalty percentages. - Enforce these changes via a new activation-epoch fork flag to ensure historical blocks remain consistent while preventing future exploitation.
Immediate actions
Patch klever-go validation logic to include per-entry bounds and uint64 accumulation