# SHIDO: lock/claim logic drains WBNB via flash loan

SHIDO lock contract's claimTokens logic let attacker lock SHIDOINU then claim SHIDO, draining ~997 WBNB via flash loan.

- Payout: Real-world hack
- Severity: high
- Program: SHIDO
- Analysis by: DeFiHackLabs
- Disclosed: 2023-06-23
- Write-up quality: 6/10
- Original: https://github.com/SunWeb3Sec/DeFiHackLabs/blob/main/src/test/2023-06/SHIDO_exp.sol
- Library page: https://bugbountylibrary.com/r/dhl%3A20230623-shido
- Tags: area:web3 domain:web3 impact:funds-loss kind:incident platform:defihacklabs sev:high tech:evm tech:solidity vuln:business-logic vuln:flash-loan

**Target:** ShidoLock contract and FeeFreeRouter on BSC
**Root cause:** ShidoLock.lockTokens/claimTokens business logic allowed locking one token (SHIDOINU) and claiming another (SHIDO) without proper accounting, enabling value extraction.
**Steps:**
1. Flash loan 40 WBNB from DODO.
2. Swap 39 WBNB to SHIDOINU via PancakeSwap router, sending output to FeeFreeRouter.
3. Withdraw 0.01 WBNB and swap to SHIDOINU to attacker.
4. Approve FeeFreeRouter and call `addLiquidityETH` with 1e9 SHIDOINU and 0.01 ETH to obtain LP tokens.
5. Approve ShidoLock for SHIDOINU, call `lockTokens()` then `claimTokens()` to receive SHIDO.
6. Swap all SHIDO to WBNB via router.
7. Repay flash loan and keep remaining WBNB (~997 WBNB profit).
**Exploitation:** Attacker used a DODO flash loan of 40 WBNB, swapped to SHIDOINU, added liquidity via FeeFreeRouter, then exploited ShidoLock's lock/claim to obtain SHIDO tokens, swapped them for WBNB, repaid loan, and kept ~997 WBNB.
**Insight:** Business logic bugs in lock/claim mechanisms can allow claiming a different token than locked; check token pair mismatches and reward accounting in staking/lock contracts.

