Klever-Go, Zero-Debit Royalty Mint Vulnerability, CVE-2024-XXXX (pending) (Critical) -DC-Aug2026-2034

Listen to this Post

The vulnerability exists in the `processPercentageRoyaltiesTransfer` function of the Klever-Go blockchain node (package core/kapp/accounts/accounts.go). This function handles the distribution of transfer royalties when an asset has a percentage‑based royalty and a split of that royalty among multiple recipients. The core flaw is the order of operations: the royalty pool is computed from the transfer amount and the royalty rate, then the function iterates over the configured split entries, crediting each split recipient with its proportional share of the royalty pool. After each split credit, the function updates a running tally `royaltiesToPay` by subtracting the amount credited. Crucially, the sender’s balance is debited for the total royalty amount only after this split loop has completed, and moreover there is an early‑return check `if royaltiesToPay <= 0 { return Ok }` placed immediately after the loop. If a split entry is configured with `PercentTransferPercentage = 10000` (i.e., 100% of the royalty pool), then after crediting that single split recipient, `royaltiesToPay` becomes exactly zero. The function then hits the early‑return and returns `Ok` before executing the sender debit acntSrc.SubFromBalance(royaltyAmount). As a result, the split recipient receives the full royalty amount, but the sender’s balance is never reduced—effectively creating (minting) new tokens out of thin air. This bypasses all supply‑consistency checks because the debit never fires, and no account is charged for the newly created value. The vulnerability is only triggered when the asset’s royalty split configuration includes a split entry with exactly 100% of the royalty pool; any lower percentage (e.g., 50%) does not zero out `royaltiesToPay` and thus the early‑return is skipped, causing the debit to execute and value to be conserved. The bug is reachable only when the fork flags KdaFpr, EnableSmartContracts, and `FixMarketBuyOverflow` are all active (which is the case on mainnet after certain upgrades). The exploit is owner‑gated in the sense that only the asset owner can set the split configuration, but once set, the minting occurs on any transfer of that asset by any holder—not just the owner. The proof‑of‑concept test `TestExploit_PercentRoyaltyZeroDebit` clearly demonstrates the mint: with a 100% split, the recipient is credited 40 units while the sender’s `SubFromBalance` is called zero times; a sibling test with 50% split shows correct debit and conservation. A live local‑net reproduction using asset `F07‑3NG3` with a 10% royalty and a 100% split to address `R` confirmed that upon a transfer, the royalty amount was credited to `R` without any debit from the sender, as seen in the transaction receipts. The issue is classified as critical because it allows unbounded inflation of the asset supply, undermining the tokenomics and potentially enabling infinite token creation.

DailyCVE Form:

Platform: Klever-Go (Klever Blockchain)
Version: Versions with KdaFpr enabled (prior to patch)
Vulnerability : processPercentageRoyaltiesTransfer early‑return bypass
Severity: Critical
date: 2024‑05‑20

Prediction: 2024‑06‑01 (expected patch release)

What Undercode Say:

Create asset with 10% transfer royalty and 100% split to recipient R
klever-cli tx create-asset \
--type Fungible \
--name "Finding07" \
--ticker F07 \
--precision 6 \
--initialSupply 1000000000000 \
--royalty-address klv1ddnnxjrt4jhus4ddtzmp6ccpcu3us78ndrn4qet0x0vegpg4995qv4nctq \
--transfer-percentage 1000 \
--split-address klv1qeh4py4p5zzy94l2hnygpfklug82gpzw08u680ycwp00njxyhgdqcv2xjm \
--split-percent 10000
Transfer 100,000,000,000 F07 to trigger the exploit
klever-cli tx transfer \
--asset F07-3NG3 \
--to klv1fttx7kd0mzw3t8nekmh98489dwqq6mehs98nfcuvewwz0yt776aqf5ydfa \
--amount 100000000000 \
--kda-royalties 10000000000
Query transaction receipts to see the royalty credit without sender debit
klever-cli query tx 37527757b10dcf968b86cc3c0abf971c70e81aef0348b4a5b7d4ccc1bf3706b1

Exploit: (Educational Purposes!)

// PoC from TestExploit_PercentRoyaltyZeroDebit
// Simulates a 100% split: recipient credited, sender never debited.
func run(splitPercent uint32) {
// setup accounts: sender, recipient, royaltyReceiver
// configure split with PercentTransferPercentage = 10000
// call processPercentageRoyaltiesTransfer with royaltyAmount = 40
// result: recipient.AddToBalance(40) called, sender.SubFromBalance not called
}
// Execution confirms mint: credited - debited = 40.

Protection:

  • Reorder the debit operation `acntSrc.SubFromBalance(royaltyAmount)` to occur before the split‑distribution loop and the early‑return check, mirroring the safe order in processFixedRoyaltiesTransfer.
  • Add a regression test (the provided TestExploit_PercentRoyaltyZeroDebit) to guard against future regressions.
  • Gate the fix behind a new activation flag to avoid consensus changes without coordination.

Impact:

  • Unbounded self‑inflation of the affected KDA asset: `royaltyAmount = transferValue × rate` is minted to an owner‑controlled split address on every transfer of the asset.
  • No source debit and no supply‑counter update, making the inflation off‑the‑books and undetectable by standard balance checks.
  • Any holder of the asset can trigger the mint when transferring, leading to rapid supply expansion and potential financial loss for users who rely on fixed supply.
  • The vulnerability is owner‑gated to configure, but once configured, it affects all transfers, making it a high‑risk backdoor for malicious asset creators.

🎯Let’s Practice Exploiting & Learn Patching For Free:

🎓 Live Courses & Certifications:

Join Undercode Academy for Verified Certifications

🚀 Request a Custom Project:

Secure, high-velocity infrastructure and disruptive technological engineering. Contact our engineering team for high-tier development and proprietary systems:
[email protected]
💎 Smart Architecture | 🛡️ Secure by Design | ⭐ Trusted by Thousands

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow DailyCVE & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin Featured Image

Scroll to Top