ការវាយប្រហារ Platypus កេងប្រវ័ញ្ចលើការបញ្ជាទិញកូដមិនត្រឹមត្រូវ សវនករអះអាង

Disclaimer: The article has been updated to reflect that Omniscia did not audit a version of the MasterPlatypusV4 contract. Instead, the company audited a version of the MasterPlatypusV1 contract from Nov. 21 to Dec. 5, 2021.

The $8 million Platypus flash loan attack was made possible because of code that was in the wrong order, នេះបើយោងតាម to a post-mortem report from Platypus auditor Omniscia. The auditing company claims the problematic code didn’t exist in the version they audited.

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.”

របាយការណ៍បានសង្កត់ធ្ងន់ថា កូដសម្រាប់មុខងារដកប្រាក់សង្គ្រោះបន្ទាន់ មានធាតុចាំបាច់ទាំងអស់ដើម្បីការពារការវាយប្រហារ ប៉ុន្តែធាតុទាំងនេះត្រូវបានសរសេរយ៉ាងសាមញ្ញក្នុងលំដាប់ខុស ដូចដែល Omniscia បានពន្យល់ថា:

"បញ្ហាអាចត្រូវបានរារាំងដោយការបញ្ជាទិញឡើងវិញនូវ MasterPlatypusV4::emergencyWithdraw និងអនុវត្តការត្រួតពិនិត្យការដោះស្រាយបន្ទាប់ពីការបញ្ចូលចំនួនទឹកប្រាក់របស់អ្នកប្រើប្រាស់ត្រូវបានកំណត់ទៅ 0 ដែលនឹងហាមឃាត់ការវាយប្រហារមិនឱ្យកើតឡើង។"

Omniscia audited a version of the MasterPlatypusV1 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.

It is important to note that the code that was exploited did not exist at the time of Omniscia’s audit. Omniscia’s point of view implies that the developers must have deployed a new version of the contract at some point after the audit was made.

ដែលទាក់ទង: Raydium ប្រកាសព័ត៌មានលម្អិតអំពីការ Hack ស្នើសំណងសម្រាប់ជនរងគ្រោះ

The auditor claims that the contract implementation at Avalanche C-Chain address 0xc007f27b757a782c833c568f5851ae1dfe0e6ec7 is the one that was កេងប្រវ័ញ្ច. 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.

ក្រុម Platypus បានបញ្ជាក់ កាលពីថ្ងៃទី 16 ខែកុម្ភៈ ថាអ្នកវាយប្រហារបានកេងប្រវ័ញ្ច "កំហុសនៅក្នុង [the] USP solvency check mechanism" ប៉ុន្តែក្រុមការងារមិនបានផ្តល់ព័ត៌មានលម្អិតបន្ថែមពីដំបូងឡើយ។ របាយការណ៍ថ្មីនេះពីសវនករបង្ហាញពន្លឺបន្ថែមទៀតអំពីរបៀបដែលអ្នកវាយប្រហារអាចសម្រេចបាននូវការកេងប្រវ័ញ្ចនេះ។

ក្រុមការងារ Platypus បានប្រកាសនៅថ្ងៃទី 16 ខែកុម្ភៈថា ការវាយប្រហារបានកើតឡើង. It has attempted to contact the hacker and get the funds returned in exchange for a bug bounty. The attacker used flashed loans ដើម្បីអនុវត្តការកេងប្រវ័ញ្ច ដែលស្រដៀងទៅនឹងយុទ្ធសាស្រ្តដែលបានប្រើនៅក្នុង ការកេងប្រវ័ញ្ចហិរញ្ញវត្ថុ defrost on Dec. 25, 2022.