$0 USD

OCTOBER 2021

GLOBAL

POLYGON

DESCRIPTION OF EVENTS

"Polygon is a protocol and a framework for building and connecting Ethereum-compatible blockchain networks. Aggregating scalable solutions on Ethereum supporting a multi-chain Ethereum ecosystem." "Polygon is an open source project built by decentralized team of contributors from all over the world."

 

"We envision an open, borderless world. A world in which people and machines collaborate and exchange value globally and freely, without gatekeepers or intermediaries. A world in which communities thrive, unconstrained by artificial borders and archaic regulations." "We don’t believe in traditional companies, hierarchy and management. Anyone is welcome to contribute code, ideas or anything else that can help make our vision a reality!"

 

"Polygon combines the best of Ethereum and sovereign blockchains into a full-fledged multi-chain system. Polygon solves pain points associated with Blockchains, like high gas fees and slow speeds, without sacrificing on security. This multi-chain system is akin to other ones such as Polkadot, Cosmos, Avalanche etc, but with at least three major upsides: (1) It is able to fully benefit from Ethereum’s network effects. (2) It is inherently more secure. (3) It is more open and powerful."

 

"Polygon combines the best of Ethereum and sovereign blockchains into an attractive feature set." "Ethereum is the blockchain development platform of choice, but it has limitations. Low Throughput. Poor UX (gas, delayed PoW finality). No sovereignty (shared throughput/clogging risk, tech stack not customizable, governance dependence)." "Many projects are exploring Ethereum-compatible blockchains as a way to mitigate these limitations while still leveraging Ethereum’s thriving ecosystem."

 

"A blockchain bridge is a way to connect two distinct blockchains and enable communication between them. Polygon offers a trustless, two-way transaction channel between Polygon and Ethereum. It introduced the cross-chain bridge with Plasma and Proof of Stake (PoS) security." “A bridge is basically a set of contracts that help in moving assets from the root chain to the child chain. There are primarily two bridges to move assets between Ethereum and Polygon.”

 

"(1) User deposits tokens to a Polygon contract on the Root Chain (Ethereum). (2) When the token deposit transaction is confirmed on Ethereum, corresponding tokens will be minted on the Polygon chain. These tokens are ready to be used on the Polygon network. (3) When a user is ready to withdraw from the Child Chain (Polygon), they can do so by initiation from Polygon. A checkpoint interval needs to pass (around 30 minutes) where all blocks have been validated since the last checkpoint. Checkpoint is then submitted to the Root Chain contract. (4) An EXIT NFT token is minted of the value the user wants to withdraw. (5) A wait period is initialized, and the user needs to wait for seven days before being able to withdraw their funds. (6) Using the process-exit procedure, once the waiting period finishes, a user can claim back funds to their Ethereum account."

 

"Whitehat Gerhard Wagner submitted a critical vulnerability on October 5th, 2021 that affected the Polygon Plasma Bridge. The vulnerability allowed an attacker to exit their burn transaction from the bridge multiple times, up to 223 times. There was around ~$850M at risk. Having just $100k to launch the attack with would result in $22.3M in losses! This means the DepositManager for the Plasma Bridge could be depleted with a sufficient amount."

 

"The main vulnerability lies in how Polygon’s WithdrawManager verifies the inclusion and uniqueness of the burn transaction in previous blocks." "One crucial parameter the exit proof contains is Merkle proof’s branchMask for the receipt. branchMask is an essential security guard that helps keep the system secure. That’s why the branch mask must be unique, as it is used to generate Exit ID. Property that needs to be behold is one exiting transaction == one Exit ID. But as the whitehat found, that’s not necessarily the case."

 

"An important security property that must always hold when a user starts an exit is that one exit id can only refer to one burn transaction. The exit id is composed partly of the branch mask that comes directly from user input, which immediately felt like a soft spot when I looked at the code for the first time. If it were possible to create an alternative branch mask that somehow passes the receipt inclusion proof, then we would find a way to create more than one exit id referring to the same burn transaction."

 

"Because the decoding into an array of nibbles ignores some of the value and differences in the ignored portion are not rejected by the uint256 decoding, the same value as decoded by MerklePatriciaProof may have many encodings as a uint256. The uint256 decoding is the one used to avoid replays; therefore the same proof can be replayed due to the differences in the decoding." "The same valid transaction can be resubmitted up to 223 times with different values for the first byte of the HP-encoded path."

 

"There are capital requirements for a successful attack, but they are minimal compared to a malicious user’s potential reward." "Having just $100k to launch the attack with would result in $22.3M in losses!"

 

"The Immunefi triaging team confirmed the underlying issue and escalated it to the client. After 30 minutes, Polygon confirmed the bug and immediately began fixing the underlying issue. In the meantime, the triage team decided to calculate the funds at risk. The whitehat also confirmed our calculations, and Polygon agreed to pay the maximum for this submission."

 

"As it turns out, the first byte of the encoded branch mask is supposed to always be 0x00. The fix is to check if the first byte of the encoded branch mask is 0x00 and not to disregard it as an incorrect mask."

 

"Polygon fixed [the] critical double spend vulnerability in the Plasma Bridge after it was responsibly disclosed by Gerhard Wagner. The whitehat collected a cool $2M bounty thanks to the bug bounty program hosted by Immunefi."

 

"The whitehat received a payout of $2m from Polygon, which is the highest bounty ever paid out in history. We congratulate Gerhard for his fantastic work and excellent report. We also want to thank Polygon for a swift answer and subsequent fix."

The Polygon bridge allows users to cash funds from the Polygon side-chain back to Ethereum. As part of this mechanism, a smart contract hot wallet checks to see proof that the Polygon tokens are accurate. This smart contract hot wallet had a vulnerability where the same proof could be submitted up to 223 times, to withdraw 223 times as much money. After launching a bug bounty program, a developer found the vulnerability and was rewarded with a $2m bounty. No funds were stolen.

Sources And Further Reading

 For questions or enquiries, email info@quadrigainitiative.com.

Get Social

  • email
  • reddit
  • telegram
  • Twitter

© 2021 Quadriga Initiative. Your use of this site/service accepts the Terms of Use and Privacy Policy. This site is not associated with Ernst & Young, Miller Thompson, or the Official Committee of Affected Users. Hosted in Canada by HosterBox.