Reproduced Exploit

KittenSwap — Lack of `lastMintedPeriod` update allows unlimited minting of Kitten

1. Minter.updatePeriod() is meant to mint weekly Kitten once per epoch period. 2. The guard is if (currentPeriod > lastMintedPeriod). 3. After minting, the code never writes lastMintedPeriod = currentPeriod. 4. Once period advances past the initial value, every call remints the full weekly amount.

Jun 2025Otheruntagged2 min read

Chain

Other

Category

untagged

Date

Jun 2025

Source

AuditVault

EVM Playground

Source-level debugger — step opcodes and Solidity in sync

evm-hack-analyzer

The attack is replayed in an in-browser EVM preloaded with the exact dumped fork state. The execution tree shows every call; step by Solidity line or by opcode across all depths — source, Stack, Memory, Storage, Balances (native / ERC-20 / NFT), Transient storage and Return value stay in sync. Click a tree node, opcode, or source line to jump. No backend, no live RPC.

Loading fork state…

Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 58066-c-02-lack-of-lastmintedperiod-update-allows-unlimited-mintin. Standalone Foundry PoC and full write-up: 58066-c-02-lack-of-lastmintedperiod-update-allows-unlimited-mintin_exp in the evm-hack-registry mirror.


Vulnerability classes: access-roles · specific-token-type · inflation

Reproduction: self-contained Foundry PoC with only forge-std — no fork. output.txt · test/58066-…sol.

AuditVault taxonomy: lang/solidity · sector/farm · sector/token · severity/high · genome: access-roles · specific-token-type


Key info#

ImpactHIGH — Kitten emissions mint unbounded once the first period elapses
ProtocolKittenSwap — Minter.updatePeriod
Vulnerable codeif (currentPeriod > lastMintedPeriod) never followed by lastMintedPeriod = currentPeriod
Bug classMissing state update / emission guard bypass
FindingPashov Audit Group — KittenSwap 2025-06-12 · #58066
ReportKittenSwap-security-review_2025-06-12.md
SourceAuditVault
FixlastMintedPeriod = currentPeriod after the mint
Compiler^0.8.24 (PoC)

TL;DR#

  1. Minter.updatePeriod() is meant to mint weekly Kitten once per epoch period.
  2. The guard is if (currentPeriod > lastMintedPeriod).
  3. After minting, the code never writes lastMintedPeriod = currentPeriod.
  4. Once period advances past the initial value, every call remints the full weekly amount.

Vulnerable code#

SOLIDITY
if (currentPeriod > lastMintedPeriod) { // @> VULN
    // mint emissions to rebaseReward + voter
    // FIX: lastMintedPeriod = currentPeriod;
    return true;
}

Root cause#

A one-sided guard: the comparison is present, but the state variable that makes it one-shot is never updated. After the first successful period, lastMintedPeriod stays at 0 forever.

Preconditions#

  • At least one period has elapsed so currentPeriod > lastMintedPeriod (initially 1 > 0).
  • Caller can invoke updatePeriod (permissionless in the audited design).

Attack walkthrough#

  1. First updatePeriod() mints 1× weekly (legitimate).
  2. Nine more calls each remint another weekly amount.
  3. Supply = 10× weekly; lastMintedPeriod still 0.

Diagrams#

sequenceDiagram participant Anyone participant Minter participant Kitten Note over Minter: lastMintedPeriod = 0, currentPeriod = 1 Anyone->>Minter: updatePeriod() Minter->>Kitten: mint weekly Note over Minter: lastMintedPeriod still 0 Anyone->>Minter: updatePeriod() x9 Minter->>Kitten: mint weekly x9 Note over Kitten: supply = 10x weekly

Impact#

Unbounded Kitten inflation dilutes all holders and corrupts emissions to RebaseReward / Voter.

Sources#


Sources & further analysis#

Reproductions & code

Alerts & third-party analyses

  • Web3Sec X hacked database: search.
  • Rekt leaderboard: search.
  • Solodit incident search: search.

These dashboards index community alerts tweets, post-mortems, and independent write-ups. Reach them through the protocol name above to cross-check this reproduction against other analyses.