QUADRIGA INITIATIVE
CRYPTO WATCHDOG & FRAUD RECOVERY PLATFORM
A COMMUNITY-BASED, NOT-FOR-PROFIT
$1 820 000 USD
DECEMBER 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 "vulnerability put more than 9.27 billion MATIC at risk that is valued at around $23.6 billion at the time of writing, with the figure representing the vast majority of the token’s total supply of 10 billion." "[A]nyone could [have gotten] any amount from $MATIC by abusing a vulnerable contract function that allowed sending any amount without checking if sender has enough balance. These tokens would have been created "out of thin air" (minted)."
"The network noted that a “malicious hacker” managed to steal 801,601 MATIC ($2.04 million) before the bug was resolved." "Despite our best efforts," "a blackhat–or a set of blackhats–managed to steal 801,601 MATIC tokens using the same exploit before the fix was implemented."
"The vulnerability consisted of a lack of balance/allowance check in the transfer function of Polygon’s MRC20 contract and would have allowed an attacker to steal all ~9,276,584,332 MATIC (as of December 5, the date of the fix) from that contract."
"Gasless MATIC transfers are facilitated by the transferWithSig() function. The user who owns the tokens signs a bundle of parameters including the operator, amount, nonce, and expiration. The signature can be later passed to the MRC20 contract by the operator to perform a transfer on behalf of the token owner. This is gasless for the token owner because the operator pays for the gas."
"The main issue is that _transferFrom will call the _transfer function directly without checking whether the from has enough balance. And we can call the transferWithSig() without a valid signature, thanks to the lack of a check to see if ecrecovery returns the zero address."
"The function takes the balances of from and to address and passes that to the _transfer() which also has the same issue. It doesn’t check that the sender has enough balance." "[T]he bug in the token could have allowed an attacker to mint an arbitrary number of tokens from the MRC20 contract."
"Polygon paid a total of about $3.46 million as bounty to two white hats who helped discover the bug." "Whitehat @leonspacewalker receive[d] a big $2.2m bounty for his critical find." "According to Immunefi, whitehat hacker “Leon Spacewalker” was the first to report on the security hole on Dec. 3 and will be rewarded with $2.2 million worth of stablecoins for their efforts, while the second unnamed hacker, referred to as “Whitehat2” will receive 500,000 MATIC ($1.27 million) from Polygon." "The $2.2m exceeds the maximum value of Polygon’s critical bounty in recognition of the severity of the vulnerability."
"The project’s co-founder Jaynti Kanani said that such a situation was bound to occur “sooner or later,” but the outcome was a testament to the network’s resilience."
“What’s important is that this was a test of our network’s resilience as well as our ability to act decisively under pressure. Considering how much was at stake, I believe our team has made the best decisions possible given the circumstances.”
"[T]he fix, a hard fork live across 90% of network validators by Block #22156660, according to Polygon’s timeline of events, protected a massive trove of funds for the Ethereum scaling tool. Polygon hadn’t publicly discussed the reasoning for the hard fork before Wednesday." "The upgrade was executed on Dec. 5 without impacting liveness and performance of the network in any major way. The vulnerability was fixed and damage was mitigated, with there being no material harm to the protocol and its end-users. All Polygon contracts and node implementations remain fully open source." "The foundation will bear the cost of the theft."
"CoinDesk reviewed the Polygon Discord server’s validator channel on Dec. 5. It contained multiple validators expressing anger over the core developers’ silence on pushing what is usually a major and well-publicized software upgrade through the shadows." "Indeed, the abrupt hard fork had spillover effects for the network as validators unprepared for the shift were knocked offline, according to the Discord logs." "Though details of the incident wouldn't be released until December 29, chatter on social media in mid-December emerged about Polygon's silent, zero-warning hard fork."
"At the time, Polygon co-founder Mihailo Bjelic said that there was a vulnerability and that the team would release additional details. "We are now investing much more in security and we're making an effort to improve security practices across all Polygon projects," he wrote at the time."
"This experience highlighted the importance of investing into an ecosystem of security expert partners. We are very grateful to Immunefi for all their help. At the end of the day, this brought Polygon a step closer to becoming the most battle-tested scaling solution for Ethereum."
The Polygon smart chain contained a critical vulnerability which would have allowed for the full drainage of all funds in the network. This was due to an additional function in the smart contract named transferWithSig, which didn't have the proper validation. Due to having a bug bounty, the issue was reported by a couple of white hackers instead of malicious entities, although it was also exploited by malicious entities.
In the end, $2.04m was taken and $3.46 was paid out in bounty. The Polygon team will cover all losses for any affected users.
HOW COULD THIS HAVE BEEN PREVENTED?
It is recommended that all smart contracts and new protocols obtain at least 2 independent security audits, and a third one within 6 months of launching.
To limit losses if audits still fail to catch problems on new protocols, there should be an upper limit on tokens distributed by the protocol, with minting additional tokens depending on a multi-signature arrangement that can load additional tokens over time.
In this case, the protocol had funds available to reimburse those affected. We have recommended that the industry establish an insurance fund to protect investors against losses that may exceed the capabilities of a single protocol's treasury.
Polygon upgrade quietly fixes bug that put $24B of MATIC at risk (Dec 30)
@0xPolygon Twitter (Jan 2)
All You Need to Know About the Recent Network Upgrade — Polygon | Blog (Jan 2)
Polygon Lack Of Balance Check Bugfix Postmortem 2 2m Bounty (Jan 2)
Polygon Quietly Patched Vulnerability That Put $24 Billion in MATIC at Risk - Decrypt (Jan 2)
Polygon Discloses Patched Exploit That Put 9B MATIC at Risk (Jan 2)
'Critical' Polygon bug put $24 billion in tokens at risk until recent hard fork (Jan 2)
@MihailoBjelic Twitter (Jan 2)
Polygon | Ethereum's Internet of Blockchains (Jan 29)
About - Polygon | Ethereum's Internet of Blockchains (Jan 29)
@TalBeerySec Twitter (Jul 22)
@immunefi Twitter (Jul 22)
https://coinmarketcap.com/currencies/polygon/historical-data/ (Jul 22)
@Cranehehe1 Twitter (Jul 23)
A Hacker Stole $1.6M After Exploiting a Polygon Bug - Crypto Briefing (Aug 24)
Polygon Admits The Network Was Hacked, Hacker Swiped 801,601 MATIC Tokens - The Crypto Basic : CryptoCurrency (Oct 12)
Polygon Justifies Its Quiet Hard-Fork Citing 'Critical Vulnerability' (Dec 1)
Polygon Admits The Network Was Hacked, Hacker Swiped 801,601 MATIC Tokens - The Crypto Basic (Dec 31)
