Reproduced Exploit

Level Money: initiateRedeem pays a victim's stETH collateral to any caller

initiateRedeem accepts an order whose benefactor and beneficiary are chosen by the caller. A user who has approved the minter for lvlUSD can be named as benefactor. Bob sets himself as beneficiary. The call pulls 50 lvlUSD from the victim and sends 50 stETH collateral to Bob. Requiring order.benefa…

Sep 2024•Ethereum•access-control•3 min read

Loss

50 stETH moved from the minting contract to Bob. The victim's 50 lvlUSD is taken with it

Chain

Ethereum

Category

access-control

Date

Sep 2024

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. Query opens a search over the trace: previous and next writes, balance changes and calls, breakpoints, and a diff of everything that changed between two steps. No backend, no live RPC.

Loading fork state…

Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 42043-mint-initiateredeem-and-redeem-lack-access-control-cantina-n. Standalone Foundry PoC and full write-up: 42043-mint-initiateredeem-and-redeem-lack-access-control-cantina-n_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/access-control/missing-auth · vuln/logic/missing-check

Key info#

FieldValue
Loss50 stETH moved from the minting contract to Bob. The victim's 50 lvlUSD is taken with it
Vulnerable contractLevelMinting.initiateRedeem
Attacker EOA0x1111111111111111111111111111111111111111
Attack contractExploit
Attack txExploit.run()
Chain / block / dateEthereum model · block 0 · 2024-09
Compilersolc 0.8.27, cancun, via IR
Bug classRedeem order uses benefactor and beneficiary with no check that the caller is the benefactor

TL;DR#

initiateRedeem accepts an order whose benefactor and beneficiary are chosen by the caller. A user who has approved the minter for lvlUSD can be named as benefactor. Bob sets himself as beneficiary. The call pulls 50 lvlUSD from the victim and sends 50 stETH collateral to Bob. Requiring order.benefactor == msg.sender reverts that order and leaves both balances in place.

Background#

Cantina's September 2024 Level Money review, reported by Delvir0. The published proof sets the redeemer-role check off, then calls initiateRedeem with benefactor equal to the address that received lvlUSD and beneficiary equal to the attacker. The recommended fix, confirmed in commit 5afc1851, is that order.benefactor must be msg.sender.

The vulnerable code#

SOLIDITY
function initiateRedeem(Order calldata order) external {
    require(order.order_type == OrderType.REDEEM, "type");
    // @> VULN: lvlUSD is taken from order.benefactor, not msg.sender, and collateral is paid to order.beneficiary
    lvlusd.transferFrom(order.benefactor, address(this), order.lvlusd_amount);
    collateral.transfer(order.beneficiary, order.collateral_amount);
}

The only gate is the order type. transferFrom spends the benefactor's existing approval. transfer pays collateral_amount to beneficiary.

Root cause#

The order struct carries both the account that supplies lvlUSD and the account that receives collateral, and the function trusts both fields. An approval to the minter is enough. The caller does not have to be the benefactor.

Preconditions#

  • The victim holds 50 lvlUSD and has approved LevelMinting for at least that amount.
  • The minting contract holds 50 stETH collateral.
  • Bob can call initiateRedeem. In the report this is the configuration where the redeemer-role check is not enforced.

Attack walkthrough#

  1. Bob builds a REDEEM order with nonce 3, the victim as benefactor, and himself as beneficiary. Both amounts are 50.
  2. initiateRedeem checks the order type and nothing else.
  3. 50 lvlUSD is pulled from the victim.
  4. 50 stETH is transferred to Bob.
  5. The victim's lvlUSD balance is 0 and the collateral pool is empty.
  6. The control uses the same order shape against a minting contract that requires benefactor == msg.sender. The theft reverts. A self-redeem by the token holder still pays that holder 50 stETH.

Diagrams#

flowchart TD A["Victim holds 50 lvlUSD and has approved the minter"] --> B["Bob sets benefactor to the victim and beneficiary to himself"] B --> C["initiateRedeem checks only that the order type is REDEEM"] C --> D["VULN pulls 50 lvlUSD from the victim"] D --> E["50 stETH collateral is paid to Bob"] E --> F["Victim lvlUSD is 0 and the collateral pool is empty"]

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.