Platypus attack exploited incorrect ordering of code, auditor claims

Share This Post

The misordered lines caused a solvency check to be performed before the user’s amount, factor, and rewardDebt had been set to zero

The $8m Platypus flash loan attack was made possible because of code that was in the wrong order, according to a post mortem report from Platypus auditor Omniscia. The auditing company claims the problematic code didn’t exist in the version they saw.

According to the report, the Platypus MasterPlatypusV4 contract “contained a fatal misconception in its emergencyWithdraw mechanism” which made it perform “its solvency check before updating the LP tokens associated with the stake position.”

The report emphasized that the code for the emergencyWithdraw function had all of the necessary elements to prevent an attack, but these elements were simply written in the wrong order, as Omniscia explained:

“The issue could have been prevented by re-ordering the MasterPlatypusV4::emergencyWithdraw statements and performing the solvency check after the user’s amount entry has been set to 0 which would have prohibited the attack from taking place.”

Omnisia admitted that they audited a version of the MasterPlatypusV4 contract from Nov. 21 to Dec. 5, 2021. However, this version “contained no integration points with an external platypusTreasure system” and therefore did not contain the misordered lines of code. From Omniscia’s point of view, this implies that the developers must have deployed a new version of the contract at some point after the audit was made.

Related: Raydium announces details of hack, proposes compensation for victims

The auditor claims that the contract implementation at Avalanche (AVAX) C-Chain address 0xc007f27b757a782c833c568f5851ae1dfe0e6ec7 is the one that was exploited. Lines 582-584 of this contract appear to call a function called “isSolvent” on the PlatypusTreasure contract, and lines 599-601 appear to set the user’s amount, factor, and rewardDebt to zero. However, these amounts are set to zero after the “isSolvent” function has already been called.

The Platypus team confirmed on Feb. 16 that the attacker exploited a “flaw in [the] USP solvency check mechanism,” but the team did not initially provide further detail. This new report from the auditor sheds further light on how the attacker may have been able to accomplish the exploit.

The Platypus team announced on Feb. 16 that the attack had occurred. It has attempted to contact the hacker and get the funds returned in exchange for a bug bounty. The attacker used flashed loans to perform the exploit, which is similar to the strategy used in the Defrost Finance exploit of Dec. 25.

Read Entire Article
spot_img
- Advertisement -spot_img

Related Posts

Bitcoin Price Achieves $94k, BTC Price Eyes To Hit $100k This Weekend?

The post Bitcoin Price Achieves $94k, BTC Price Eyes To Hit $100k This Weekend appeared first on Coinpedia Fintech News Story Highlights Bitcoin price records a new ATH of $94,00287 on 20th November

Bitcoin All-Time High at $94K: What the Crypto Fear and Greed Index Reveals

The post Bitcoin All-Time High at $94K: What the Crypto Fear and Greed Index Reveals appeared first on Coinpedia Fintech News Last day, the Bitcoin market reached a new all-time high of $92,32613

Bitcoin Refuses to Flip Before $100K After Breaking $94,000-Here’s Why the Sell-offs May Not Hinder the BTC Price Rally

The post Bitcoin Refuses to Flip Before $100K After Breaking $94,000-Here’s Why the Sell-offs May Not Hinder the BTC Price Rally appeared first on Coinpedia Fintech News Bitcoin has begun to range!

13 Regions Face Crypto Mining Ban Under Russia’s New Energy Policies

Russia’s governmental commission on electricity development approved cryptocurrency mining restrictions on Monday, set to take effect on Dec 1 with subsequent enforcement covering Nov 15 to March

Cardano Hits 8-Month High: Will It Keep Soaring Against Bitcoin?

The post Cardano Hits 8-Month High: Will It Keep Soaring Against Bitcoin appeared first on Coinpedia Fintech News Cardano is slowly becoming one of the most interesting stories in the crypto world

Crypto News Today (Nov 20th, 2024): Bitcoin Hits New ATH Above $94k | BONK Memecoin Tops Gainers

The post Crypto News Today (Nov 20th, 2024): Bitcoin Hits New ATH Above $94k | BONK Memecoin Tops Gainers appeared first on Coinpedia Fintech News The crypto market today has been experiencing mixed