OMNI Real Estate Hack
What happened
OMNI Real Estate Token (ORT) on BNB Chain lost about $70,000 on January 17, 2023, through its staking contract. The attacker earned roughly 236 BNB (SolidityScan reports 256 BNB).
invest(end_date, qty_ort) in the StakingPool contract accepted an end_date of 0. That value becomes the lock duration passed to _Check_reward(), which picks a reward rate through a chain of if/else duration checks. None of the branches handled a duration of 0, so the function fell through and returned the full total_percent. The attacker staked 1 wei of ORT with end_date 0, withdrew straight away with withdrawAndClaim() for a large ORT reward, repeated this, and swapped the ORT for BNB on PancakeSwap.
**Block data**
- Attacker addresses:
0x9bbd94506398a1459f0cd3b2638512627390255e,0xda5919bf3a49ad47b7c7103a9ed3902cee78d528 - Attack contract:
0xdD87D807774c8aA9D70FC6aF5912C97FaDBF531B - Invest transaction:
0x49bed801b9a9432728b1939951acaa8f2e874453d39c7d881a62c2c157aa7613 - Withdraw transaction:
0xa916674fb8203fac6d78f5f9afc604be468a514aa61ea36c6d6ef26ecfbd0e97 - ORT token:
0x1d64327C74d6519afeF54E58730aD6fc797f05Ba
How it happened
- The attacker bought a small amount of ORT on PancakeSwap.
- It called
invest(0, 1)on the StakingPool, staking 1 wei of ORT with anend_dateof 0. The contract did not reject the zero value. - It called
withdrawAndClaim()on the new stake right away._Check_reward()received a duration of 0, matched none of its duration branches, and returned the fulltotal_percent, so the claim paid out a large amount of ORT. - It repeated the invest-and-withdraw cycle to collect more ORT.
- It sold the ORT for BNB on PancakeSwap, netting roughly 236 BNB (about $70,000).
Protocol details
Evidence
- report Report hacked.slowmist.io
- report @QuillAudits incident report twitter.com
- transaction bscscan.com transaction 0x49be…7613 bscscan.com
- transaction bscscan.com transaction 0xa916…0e97 bscscan.com
- address bscscan.com address 0x9bbd…255e bscscan.com
- address bscscan.com address 0xdD87…531B bscscan.com
- address bscscan.com address 0xda59…d528 bscscan.com
- code DeFiHackLabs OmniEstate_exp.sol PoC github.com
- code DeFiHackLabs 2023 index: 20230117 - OmniEstate - No Input Parameter Check github.com
- analysis DeFiLlama defillama.com
- analysis Omni Estate Group Hack Analysis - Missing Zero Duration Validation blog.solidityscan.com
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.