How can a smart contract bug allow unlimited token
Published 10/12/2026, 12:46:28 AM
I have sufficient evidence from multiple authoritative sources to answer this comprehensively. Let me compile the analysis.
Answer
Smart contract bugs enable unlimited token minting when a contract's mint function can be invoked more times than the contract's accounting logic intends — i.e., when the code fails to enforce "who can mint, how many times, and under what conditions." The minting itself is just a state change (totalSupply += amount); the bug is that the guard preventing abuse is missing, bypassable, or corruptible. Based on documented incidents, there are four dominant mechanisms:
1. Reentrancy (external call before state update)
A function makes an external call to another contract before updating its own state. The external contract (or a malicious one) calls back into the original function, repeating the mint with the same stale state. This is the classic vector and is ranked in OWASP's Smart Contract Top 10 (SC05:2025 / SC08:2026).
- Solv Protocol (March 5, 2026): an attacker turned 135 BRO tokens into ~567 million, repeating the exploit 22 times, draining 38.05 SolvBTC from the vault. The root cause was a missing access modifier — "not a novel cryptographic attack... A missing
onlyOwner" (Olympix analysis). [VERIFIED: Independent sources confirm the March 5, 2026 exploit, 22 repetitions, 135 BRO →567M BRO, and 38 SolvBTC ($2.7M) loss. Sources describe the mechanism as a reentrancy/double-minting bug via ERC-3525/ERC-721 callback; the "missing onlyOwner" attribution comes from the Olympix analysis. Verification sources: NomosLabs Security PoC, Yellow.com, FinanceFeeds, DARKNAVY] - GMX (July 2025, $42M loss): exploited via a reentrancy vector in
executeDecreaseOrder(OWASP SC08:2026). [VERIFIED: Independent sources confirm the July 9, 2025 GMX V1 exploit for ~$42M via reentrancy on Arbitrum. Verification sources: QuillAudits, Sherlock, Halborn, CertiK, CoinDesk/Yahoo Finance] - NextGen MinterContract: a reentrancy attack on the mint function lets users mint more NFTs than the max purchasable number, bypassing both allowlist and public limits (code-423n4 finding #1700). [VERIFIED: Multiple independent code-423n4 findings confirm reentrancy in the NextGen mint function bypassing mint limits. Verification sources: code-423n4 issue #1186, code-423n4 issue #2048, code-423n4 issue #1700]
2. Improper access control (missing modifier on mint/burn)
The mint function is callable by anyone because access restrictions are absent. OWASP lists this as SC01:2025/2026, explicitly noting it "can relate to governance and critical logic, such as minting" (OWASP SC01:2025).
- USSD:
mintRebalancerandburnRebalancerhad missing access control — "Anyone can mint/burn USSD, which changes the totalSupply... This can also be used to sell infinite amounts of ussd during the rebalance process, crashing the price" (Sherlock audit finding #449).
3. Integer overflow / underflow
Arithmetic that exceeds the data type's storage capacity corrupts the supply accounting, letting an owner set arbitrary balances.
- Pylon (PYLNT), CVE-2018-18667: "The mintToken function... has an integer overflow that allows the owner of the contract to set the balance of an account" (NVD).
- Truebit (Jan 2026): a smart contract overflow bug let an attacker mint tokens at near-zero cost, sending TRU down 99% and costing $26M (CoinTelegraph via CryptoPanic).
4. Missing state update / reused proof (no "used" tracking)
The contract fails to record that a given input (e.g., a proof) has already been consumed, so the same input can be replayed to mint repeatedly.
- LBTC:
mintWithProof(btcTxProof)could be called repeatedly with the same BTC proof — "Each call results in new LBTC tokens minted with the same proof... allows an attacker to mint unlimited LBTC tokens from thin air, completely breaking the 1:1 peg with Bitcoin." The suggested fix is ausedProofsmapping (GitHub gist).
Real-world scale of the damage
- WEMIX (July 26): 5.23M tokens illegally minted in a flash loan attack (Gate News).
- SAND on Base (Aug 2026): PeckShield reported 14.9 billion SAND minted across two Base addresses, versus a normal total supply of 3 billion (EdgeX).
- Solana Token-22: a bug in the ZK ElGamal Proof program "could have allowed unauthorized minting or withdrawals" of confidential tokens, patched quietly (CoinDesk, Decrypt).
Why this is so damaging
An infinite mint attack is considered "one of the most dangerous threats in the DeFi ecosystem" because it is both damaging and difficult to recover from — the token's supply is permanently inflated, breaking any peg or collateral backing and collapsing price (Indodax Academy). The common thread across all four mechanisms: the contract's state was not updated (or not guarded) before the minting action could be repeated, so the "unlimited" nature comes from the absence of a one-time or authorized-use enforcement, not from any special cryptographic power.
Caveat on evidence: The most detailed technical walkthroughs (LBTC gist, code-423n4 findings, Sherlock audit) are community/audit reports rather than peer-reviewed sources, and some incident figures (e.g., SAND 14.9B) come from a single security-firm report. The mechanism-level claims, however, are corroborated across multiple independent sources (OWASP, Chainlink, NVD, PeckShield, CoinDesk).
Evidence Snippets
Claim: Reentrancy lets a contract be re-entered before state updates, enabling repeated minting.
"A reentrancy attack exploits the vulnerability in smart contracts when a function makes an external call to another contract before updating its own state. This allows the external contract, possibly malicious, to reenter the original function and repeat certain actions, like withdrawals, using the same state." URL: https://owasp.org/www-project-smart-contract-top-10/2025/en/src/SC05-reentrancy-attacks.html
Claim: Solv Protocol's $2.7M exploit was a missing access modifier, repeated 22 times.
"On March 5, 2026, an attacker turned 135 BRO tokens into approximately 567 million. They did it 22 times. By the end, 38.05 SolvBTC had been drained... The vulnerability was a missing modifier. Not a novel cryptographic attack... A missing
onlyOwner." URL: https://olympixai.medium.com/the-2-7m-solv-protocol-exploit-a-reentrancy-bug-that-should-never-have-shipped-and-how-olympix-617e4703a531 [VERIFIED: Independent sources confirm the factual details (22 repetitions, 135 BRO → ~567M, 38 SolvBTC, $2.7M, March 5, 2026) and describe the mechanism as a reentrancy/double-minting bug via ERC-3525/ERC-721 callback. Verification sources: NomosLabs Security PoC, Yellow.com, FinanceFeeds, DARKNAVY]
Claim: Missing access control on mint/burn lets anyone change totalSupply infinitely.
"Missing access control in USSD.sol:mintRebalancer and burnRebalancer functions. Anyone can mint/burn USSD, which changes the totalSupply... This can also be used to sell infinite amounts of ussd during the rebalance process, crashing the price." URL: https://github.com/sherlock-audit/2023-05-USSD-judging/issues/449
Claim: Integer overflow in a mint function allows setting arbitrary balances.
"The mintToken function of Pylon (PYLNT) aka PylonToken, an Ethereum token, has an integer overflow that allows the owner of the contract to set the balance of an account." URL: https://nvd.nist.gov/vuln/detail/CVE-2018-18667
Claim: Truebit's overflow bug enabled near-zero-cost minting, collapsing price 99%.
"Truebit lost $26 million after a smart contract overflow bug let an attacker mint tokens at near-zero cost, sending the TRU price down 99%." URL: https://static.cryptopanic.com/news/28767790/Truebit-exploit-exposes-smart-contract-flaw-behind-26M-token-mint
Claim: Reused proof (no state tracking) allows unlimited minting from thin air.
"Each call results in new LBTC tokens minted with the same proof... This allows an attacker to mint unlimited LBTC tokens from thin air, completely breaking the 1:1 peg with Bitcoin... Suggested Fix: Introduce a
usedProofsmapping." URL: https://gist.github.com/Sasha727-prog/e7db7b62a8c7b848d71ec016ee5b763f
Claim: WEMIX had 5.23M tokens illegally minted in a flash loan attack.
"WEMIX Exploited on July 26, 5.23M Tokens Illegally Minted in Flash Loan Attack... the protocol was exploited on July 26, when attackers leveraged a vulnerability in pub..." URL: https://www.gate.com/news/detail/wemix-exploited-on-july-26-523m-tokens-illegally-minted-in-flash-loan-23095964
Claim: SAND on Base had 14.9B tokens minted vs. a 3B normal supply.
"PeckShield reported that 14.9 billion SAND were minted across two Base addresses during the incident. SAND's normal total supply is 3 billi..." URL: https://pro.edgex.exchange/en-US/news/article/the-sandbox-sand-infinite-mint-base
Claim: Solana's Token-22 ZK ElGamal bug could have allowed unauthorized minting.
"The Solana Foundation revealed a vulnerability in its token system that could have allowed unauthorized minting or withdrawals. The flaw was related to the ZK ElGamal Proof program, affecting confidential transfers but not standard SPL tokens." URL: https://www.coindesk.com/markets/2025/05/05/solana-quietly-fixes-bug-that-could-have-let-attackers-mint-and-steal-certain-tokens
Claim: Infinite mint attacks are among the most dangerous, hard-to-recover DeFi threats.
"Because this attack is so damaging and difficult to recover from, the Infinite Mint Attack is considered one of the most dangerous threats in the DeFi ecosystem." URL: https://indodax.com/academy/en/dangers-of-infinite-mint-attack/
Claim: Access control vulnerabilities can relate to critical logic such as minting.
"Access control in smart contracts can relate to governance and critical logic, such as minting..." URL: https://owasp.org/www-project-smart-contract-top-10/2025/en/src/SC01-access-control.html
Claim: GMX lost $42M in July 2025 via reentrancy.
"On July 9, 2025, GMX Exchange - one of the leading decentralized perpetual trading platforms - was exploited for over $42 million. The attacker used a complex re-entrancy technique targeting GMX V1 on the Arbitrum network to manipulate the vault accounting mechanism and the GLP token pricing." URL: https://sherlock.xyz/post/gmx-exchange-hack-explained [VERIFIED: Multiple independent sources confirm the July 9, 2025 GMX V1 exploit for ~$42M via reentrancy on Arbitrum. Verification sources: QuillAudits, Halborn, CertiK, CoinDesk/Yahoo Finance]
Claim: NextGen MinterContract reentrancy bypasses mint limits.
"Mint limit can be bypassed by reentrancy... Reentrancy is possible with safeMint and (allowlist or public) mint limit can be bypassed." URL: https://github.com/code-423n4/2023-10-nextgen-findings/issues/1186 [VERIFIED: Multiple independent code-423n4 findings confirm reentrancy in the NextGen mint function bypassing mint limits. Verification sources: code-423n4 issue #1186, code-423n4 issue #2048, code-423n4 issue #1700]
Some steps didn't finish and sources may be incomplete. Ask if you want me to go deeper.