Gravitational plate of three masses and a slashed discABC0Static engraved plate. Three-dimensional view is unavailable or reduced motion is requested.

← back to fieldarticle

articleJul 29, 2022

Damn Vulnerable DeFi Challenge 3 — Truster (high-level)

Earlier blog mirror of the Truster flash-loan challenge: arbitrary target/calldata during a free DVT flash loan undermines pool safety. Solve steps omitted.

Damn Vulnerable DeFi Challenge #3 — Truster

Blog-era notes on the same educational challenge covered in the Paragraph “Truster” analysis. Provider: @tinchoabbate. Solve steps and PoC omitted.

Theme

A lending pool advertises free flash loans of DVT and holds on the order of a million tokens. The player starts with nothing and is challenged to empty the pool in one transaction.

Root-cause concept

  • flashLoan sends tokens, then performs a generic external call with a borrower-chosen target address and calldata
  • Repayment is enforced only via “balance before == balance after”
  • That check misses ERC-20 allowance changes and similar side effects executed during the callback

Impact (abstract)

Control of the callback can be enough to authorize later withdrawal of the pool’s tokens without leaving the balance check failing mid-loan.

Mitigations / lessons

  • Constrain flash-loan callbacks; never forward arbitrary calldata as the pool
  • Audit for approve / transferFrom patterns around loan helpers
  • Treat “balance unchanged” as necessary but not sufficient for safety

Solve steps and PoC omitted.

related

  1. Dec 25, 2022/articleDamn Vulnerable DeFi — Free Rider (msg.value reuse in NFT marketplace)
  2. Dec 21, 2022/articleDamn Vulnerable DeFi — Selfie (flash-loan governance)
  3. Dec 16, 2022/articleDamn Vulnerable DeFi — Side entrance (high-level)

graphfeed