Reproduced Exploit

Gondi — triggerFee stolen from other auctions in settleWithBuyout

1. Multiple auctions share one contract balance of the principal asset. 2. Buyout correctly pulls other-lender repayment from the buyer. 3. triggerFee is paid with safeTransfer from the contract, not the buyer. 4. Fee is stolen from other auctions' escrow → shortfall / unsettled principal.

Apr 2024Otheruntagged3 min read

Chain

Other

Category

untagged

Date

Apr 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. No backend, no live RPC.

Loading fork state…

Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 35207-h-05-triggerfee-is-stolen-from-other-auctions-during-settlew. Standalone Foundry PoC and full write-up: 35207-h-05-triggerfee-is-stolen-from-other-auctions-during-settlew_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/fee-theft · vuln/single-function · vuln/reentrancy-guard

Reproduction: self-contained Foundry PoC with only forge-std — no fork, no RPC. Full trace: output.txt. PoC: test/35207-h-05-triggerfee-is-stolen-from-other-auctions-during-settlew.sol.


Key info#

ImpactHIGHsettleWithBuyout pays triggerFee from the auction contract balance via safeTransfer, siphoning escrow belonging to other concurrent auctions; later auctions cannot settle
ProtocolGondi — NFT multi-source lending / liquidation auctions
Vulnerable codesettleWithBuyout: asset.safeTransfer(_auction.originator, fee) instead of safeTransferFrom(buyer, …)
Bug classFee paid from shared contract balance rather than buyer funds
FindingCode4rena — Gondi, 2024-04 · #35207 · reporter minhquanym
Reportcode4rena.com/reports/2024-04-gondi
SourceAuditVault
StatusAudit finding — confirmed; mitigated to safeTransferFrom buyer
Compiler^0.8.24 (PoC)

TL;DR#

  1. Multiple auctions share one contract balance of the principal asset.
  2. Buyout correctly pulls other-lender repayment from the buyer.
  3. triggerFee is paid with safeTransfer from the contract, not the buyer.
  4. Fee is stolen from other auctions' escrow → shortfall / unsettled principal.

The vulnerable code#

SOLIDITY
// @> VULN: fee from contract balance
uint256 fee = totalOwed.mulDivDown(_auction.triggerFee, _BPS);
asset.safeTransfer(_auction.originator, fee);
// FIX: asset.safeTransferFrom(msg.sender, _auction.originator, fee);

Root cause#

The buyout path never collects the trigger fee from the main lender. Paying it from the shared balance treats other auctions' locked funds as free liquidity for the fee.

Attack walkthrough#

  1. Auction A escrows 1000 USDC in the house.
  2. Auction B opens with 100 USDC escrow and 10% trigger fee.
  3. Buyer settles B with buyout (repays B's other lenders from own wallet).
  4. Originator B receives 10 USDC taken from the shared balance (A's funds).
  5. Combined expected escrow short by exactly the fee.

Diagrams#

sequenceDiagram participant Buyer participant House as AuctionHouse participant Orig as OriginatorB Note over House: holds Auction A escrow 1000 Buyer->>House: settleWithBuyout B Buyer->>House: repay B other lenders from buyer House->>Orig: safeTransfer triggerFee from contract Note over House: A escrow short by fee

Impact#

Loss of principal to other concurrent auctions (judge: high). Last auctions may be unable to settle due to insufficient balance. Originator is overpaid from others' funds.

Taxonomy#

  • genome: single-function, fee-theft, use-reentrancy-guard, integer-bounds, liquidation-underwater, reentrancy-guard
  • sector: lending, nft, nft-lending, token
  • severity: high
  • platform: code4rena

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.