{"id":8516,"date":"2023-08-01T07:32:00","date_gmt":"2023-08-01T07:32:00","guid":{"rendered":"https:\/\/www.trustrecipe.in\/?p=8516"},"modified":"2024-06-26T09:03:36","modified_gmt":"2024-06-26T09:03:36","slug":"dot-finance-flash-loan-attack-aug-25-2021-detailed-analysis","status":"publish","type":"post","link":"https:\/\/immunebytes.com\/blog\/dot-finance-flash-loan-attack-aug-25-2021-detailed-analysis\/","title":{"rendered":"Dot Finance Flash Loan Attack &#8211; Aug 25, 2021 &#8211; Detailed Analysis"},"content":{"rendered":"\n<p>On Aug 25, 2021, Defi protocol Dot Finance was exploited for ~$429K in a lightning loan attack which reduced the protocol\u00e2\u20ac\u2122s value by 35 %. The attackers utilized flash loans to manipulate the token prices.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Attack Overview<\/h3>\n\n\n\n<p>Dot Finance, operating on the BSC, fell victim to a flash loan attack on August 25th. The attack resulted in a nearly 35% reduction in the protocol&#8217;s value. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/immunebytes.com\/blog\/audit-cost-calculator\/\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"238\" src=\"https:\/\/www.trustrecipe.in\/wp-content\/uploads\/2023\/08\/Group-28059-9-1024x238.png\" alt=\"\" class=\"wp-image-8521\" srcset=\"https:\/\/immunebytes.com\/blog\/wp-content\/uploads\/2023\/08\/Group-28059-9-1024x238.png 1024w, https:\/\/immunebytes.com\/blog\/wp-content\/uploads\/2023\/08\/Group-28059-9-300x70.png 300w, https:\/\/immunebytes.com\/blog\/wp-content\/uploads\/2023\/08\/Group-28059-9-768x179.png 768w, https:\/\/immunebytes.com\/blog\/wp-content\/uploads\/2023\/08\/Group-28059-9-1170x272.png 1170w, https:\/\/immunebytes.com\/blog\/wp-content\/uploads\/2023\/08\/Group-28059-9-585x136.png 585w, https:\/\/immunebytes.com\/blog\/wp-content\/uploads\/2023\/08\/Group-28059-9.png 1366w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>The attack was executed through a series of transactions involving specific addresses and contracts, and its impact on the platform&#8217;s security and financial health is a cause for concern. The attacker gained about ~$429K from this incident.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Hacker&#8217;s Actions and Exploited Vulnerability<\/h3>\n\n\n\n<p>The hacker&#8217;s address involved in the attack is <br>0xDFD78a977c08221822F6699AD933869Da6d9720C.<\/p>\n\n\n\n<p>The attack was orchestrated using a contract address <br>0x33f9bB37d60Fa6424230e6Cf11b2d47Db424C879 which the attacker created.<\/p>\n\n\n\n<p>Attack Transaction: <br>0x68170a309ab2e944e178ccf9bf6f19e25a3f356031ce53539bb9669fc77172f2<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Attack Analysis<\/h3>\n\n\n\n<p>The attack involved a sequence of functions and transactions:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The attacker initiated the attack by utilizing the PancakePair swap function.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"898\" height=\"409\" src=\"https:\/\/www.trustrecipe.in\/wp-content\/uploads\/2023\/08\/dot-finance-flash-load-attack.png\" alt=\"dot finance flash loan attack - Aug 25, 2021\" class=\"wp-image-8517\" srcset=\"https:\/\/immunebytes.com\/blog\/wp-content\/uploads\/2023\/08\/dot-finance-flash-load-attack.png 898w, https:\/\/immunebytes.com\/blog\/wp-content\/uploads\/2023\/08\/dot-finance-flash-load-attack-300x137.png 300w, https:\/\/immunebytes.com\/blog\/wp-content\/uploads\/2023\/08\/dot-finance-flash-load-attack-768x350.png 768w, https:\/\/immunebytes.com\/blog\/wp-content\/uploads\/2023\/08\/dot-finance-flash-load-attack-585x266.png 585w\" sizes=\"auto, (max-width: 898px) 100vw, 898px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>The attacker leveraged a flash loan from PancakeSwap, acquiring 100 Cake tokens as initial funds.<\/li><li>The Cake tokens were inserted into the VaultPinkBNB contract, enabling the execution of the getReward function.<\/li><li>The getReward function utilized the balanceOf(address(this)) method to determine the contract&#8217;s Cake token balance.<\/li><li>Through this balance, the attacker manipulated the performanceFee parameter, significantly impacting the actual value of Cake tokens<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"114\" src=\"https:\/\/www.trustrecipe.in\/wp-content\/uploads\/2023\/08\/dot-finance-flash-load-attack-1.png\" alt=\"\" class=\"wp-image-8518\" srcset=\"https:\/\/immunebytes.com\/blog\/wp-content\/uploads\/2023\/08\/dot-finance-flash-load-attack-1.png 720w, https:\/\/immunebytes.com\/blog\/wp-content\/uploads\/2023\/08\/dot-finance-flash-load-attack-1-300x48.png 300w, https:\/\/immunebytes.com\/blog\/wp-content\/uploads\/2023\/08\/dot-finance-flash-load-attack-1-585x93.png 585w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Subsequently, the mintFor function exploited the altered performanceFee parameter to generate a substantial amount of pink tokens, effectively rewarding the attacker.<\/li><li>The Attacker then deposited the stolen amount to Tornado.cash via multiple transactions.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"218\" src=\"https:\/\/www.trustrecipe.in\/wp-content\/uploads\/2023\/08\/dot-finance-flash-load-attack-2-1024x218.png\" alt=\"\" class=\"wp-image-8519\" srcset=\"https:\/\/immunebytes.com\/blog\/wp-content\/uploads\/2023\/08\/dot-finance-flash-load-attack-2-1024x218.png 1024w, https:\/\/immunebytes.com\/blog\/wp-content\/uploads\/2023\/08\/dot-finance-flash-load-attack-2-300x64.png 300w, https:\/\/immunebytes.com\/blog\/wp-content\/uploads\/2023\/08\/dot-finance-flash-load-attack-2-768x163.png 768w, https:\/\/immunebytes.com\/blog\/wp-content\/uploads\/2023\/08\/dot-finance-flash-load-attack-2-1170x249.png 1170w, https:\/\/immunebytes.com\/blog\/wp-content\/uploads\/2023\/08\/dot-finance-flash-load-attack-2-585x124.png 585w, https:\/\/immunebytes.com\/blog\/wp-content\/uploads\/2023\/08\/dot-finance-flash-load-attack-2.png 1257w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Implications and Lessons Learned<\/h3>\n\n\n\n<p>This attack bears resemblance to previous incidents targeting PancakeBunny, and Cream Finance reflects a pattern of similar attacks. <\/p>\n\n\n\n<p>The increasing frequency of such attacks on the BSC chain and other chains underscores the urgency of bolstering <a href=\"https:\/\/immunebytes.com\/blog\/smart-contract-audit\/\" title=\"\">smart contract security <\/a>measures. <br><br>Read More: <a href=\"https:\/\/www.trustrecipe.in\/flash-loans-building-up-or-breaking-down-the-defi\/\" title=\"\">Flash Loans in DeFi<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Conclusion<\/h3>\n\n\n\n<p>The flash loan attack on Dot Finance highlights the vulnerability of DeFi protocols to sophisticated exploitation techniques.<\/p>\n\n\n\n<p> The attack&#8217;s impact on Dot Finance&#8217;s value and security prompts a call for heightened security measures within the BSC ecosystem. <\/p>\n\n\n\n<p>The incident serves as a reminder of the ever-present risks associated with DeFi platforms and the pressing need for proactive security strategies to safeguard user funds and platform integrity.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On Aug 25, 2021, Defi protocol Dot Finance was exploited for ~$429K in a lightning loan attack which reduced the&hellip;<\/p>\n","protected":false},"author":2,"featured_media":8547,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[6,679],"tags":[],"class_list":["post-8516","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-crypto-hacks-exploits","category-web3-security"],"_links":{"self":[{"href":"https:\/\/immunebytes.com\/blog\/wp-json\/wp\/v2\/posts\/8516","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/immunebytes.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/immunebytes.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/immunebytes.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/immunebytes.com\/blog\/wp-json\/wp\/v2\/comments?post=8516"}],"version-history":[{"count":5,"href":"https:\/\/immunebytes.com\/blog\/wp-json\/wp\/v2\/posts\/8516\/revisions"}],"predecessor-version":[{"id":11404,"href":"https:\/\/immunebytes.com\/blog\/wp-json\/wp\/v2\/posts\/8516\/revisions\/11404"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/immunebytes.com\/blog\/wp-json\/wp\/v2\/media\/8547"}],"wp:attachment":[{"href":"https:\/\/immunebytes.com\/blog\/wp-json\/wp\/v2\/media?parent=8516"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/immunebytes.com\/blog\/wp-json\/wp\/v2\/categories?post=8516"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/immunebytes.com\/blog\/wp-json\/wp\/v2\/tags?post=8516"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}