Binance Smart Chain
Logic error with the takeWithdraw function
Days in Operation:
BlockSec reported an analysis on Babyswap's recent vulnerability.
The root cause is that the "factory" parameter of the router can be faked. Thus a fake swap can earn the BABY rewards token.
From the trace, one can see that the factory is an attacker-controlled one. Then the swap in the router is controlled by the attacker. But for the swap mining contract, the factory is a real one, and the contract thinks there is a real swap and records rewards. Then the attacker claim rewards through takerWithdraw.
DISCLAIMER: While web3rekt has used the best efforts in aggregating and maintaining this database, this web site makes no representations or warranties with respect to the accuracy or completeness of its information and data herein, and specifically disclaim any implied warranties of merchantability or fitness for any particular purpose.
Under no circumstances, shall web3rekt be liable for any loss of profit or funds, any regulatory or governmental penalties, any legal costs, or any other commercial and non-commercial damages, including but not limited to special, incidental, consequential, or other damages from any or all usage of the data and information derived from this database.