Polygon Critical Exploit Fixed: Difference between revisions
(Created page with "{{Imported Case Study|source=https://www.quadrigainitiative.com/casestudy/polygoncriticalexploitfixed.php}} thumb|PolygonThe 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...") |
No edit summary |
||
| Line 1: | Line 1: | ||
{{Imported Case Study|source=https://www.quadrigainitiative.com/casestudy/polygoncriticalexploitfixed.php}} | {{Imported Case Study|source=https://www.quadrigainitiative.com/casestudy/polygoncriticalexploitfixed.php}} | ||
{{Unattributed Sources}} | |||
[[File:Polygon.jpg|thumb|Polygon]]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. | [[File:Polygon.jpg|thumb|Polygon]]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. | ||
| Line 6: | Line 7: | ||
This is a global/international case not involving a specific country. | This is a global/international case not involving a specific country. | ||
<ref name="cointelegraph-5106" /><ref name="0xpolygontwitter-5107" /><ref name="polygonblog-5108" /><ref name="immunefimedium-5109" /><ref name="decrypt-5110" /><ref name="coindesk-5111" /><ref name="theblockcrypto-5112" /><ref name="mihailobjelictwitter-5113" /><ref name="polygon-6075" /><ref name="polygon-6076" /><ref name="talbeerysectwitter-8672" /><ref name="immunefitwitter-8673" /><ref name="coinmarketcap-8674" /><ref name="cranehehe1twitter-8727" /><ref name="cryptobriefing-8913" /><ref name="redditold-9248" /><ref name="cryptonews-9848" /> | |||
== About Polygon == | == About Polygon == | ||
| Line 115: | Line 117: | ||
== References == | == References == | ||
[https://cointelegraph.com/news/polygon-upgrade-quietly-fixes-bug-that-put-24b-of-matic-at-risk Polygon upgrade quietly fixes bug that put $24B of MATIC at risk] (Dec 30) | <references><ref name="cointelegraph-5106">[https://cointelegraph.com/news/polygon-upgrade-quietly-fixes-bug-that-put-24b-of-matic-at-risk Polygon upgrade quietly fixes bug that put $24B of MATIC at risk] (Dec 30, 2022)</ref> | ||
[https://twitter.com/0xPolygon/status/1476032036804513792 @0xPolygon Twitter] (Jan 2) | <ref name="0xpolygontwitter-5107">[https://twitter.com/0xPolygon/status/1476032036804513792 @0xPolygon Twitter] (Jan 2, 2022)</ref> | ||
[https://blog.polygon.technology/all-you-need-to-know-about-the-recent-network-upgrade/ All You Need to Know About the Recent Network Upgrade — Polygon | Blog] (Jan 2) | <ref name="polygonblog-5108">[https://blog.polygon.technology/all-you-need-to-know-about-the-recent-network-upgrade/ All You Need to Know About the Recent Network Upgrade — Polygon | Blog] (Jan 2, 2022)</ref> | ||
[https://medium.com/immunefi/polygon-lack-of-balance-check-bugfix-postmortem-2-2m-bounty-64ec66c24c7d Polygon Lack Of Balance Check Bugfix Postmortem 2 2m Bounty] (Jan 2) | <ref name="immunefimedium-5109">[https://medium.com/immunefi/polygon-lack-of-balance-check-bugfix-postmortem-2-2m-bounty-64ec66c24c7d Polygon Lack Of Balance Check Bugfix Postmortem 2 2m Bounty] (Jan 2, 2022)</ref> | ||
[https://decrypt.co/89514/polygon-quietly-patched-vulnerability-that-put-24-billion-in-matic-at-risk Polygon Quietly Patched Vulnerability That Put $24 Billion in MATIC at Risk - Decrypt] (Jan 2) | <ref name="decrypt-5110">[https://decrypt.co/89514/polygon-quietly-patched-vulnerability-that-put-24-billion-in-matic-at-risk Polygon Quietly Patched Vulnerability That Put $24 Billion in MATIC at Risk - Decrypt] (Jan 2, 2022)</ref> | ||
[https://www.coindesk.com/tech/2021/12/29/polygon-discloses-patched-exploit-that-put-9b-matic-at-risk/ Polygon Discloses Patched Exploit That Put 9B MATIC at Risk] (Jan 2) | <ref name="coindesk-5111">[https://www.coindesk.com/tech/2021/12/29/polygon-discloses-patched-exploit-that-put-9b-matic-at-risk/ Polygon Discloses Patched Exploit That Put 9B MATIC at Risk] (Jan 2, 2022)</ref> | ||
[https://www.theblockcrypto.com/post/128784/polygon-critical-bug-24-billion-matic-tokens-at-risk-hard-fork 'Critical' Polygon bug put $24 billion in tokens at risk until recent hard fork] (Jan 2) | <ref name="theblockcrypto-5112">[https://www.theblockcrypto.com/post/128784/polygon-critical-bug-24-billion-matic-tokens-at-risk-hard-fork 'Critical' Polygon bug put $24 billion in tokens at risk until recent hard fork] (Jan 2, 2022)</ref> | ||
[https://twitter.com/MihailoBjelic/status/1471114922247528458 @MihailoBjelic Twitter] (Jan 2) | <ref name="mihailobjelictwitter-5113">[https://twitter.com/MihailoBjelic/status/1471114922247528458 @MihailoBjelic Twitter] (Jan 2, 2022)</ref> | ||
[https://polygon.technology/ Polygon | Ethereum's Internet of Blockchains] (Jan 29) | <ref name="polygon-6075">[https://polygon.technology/ Polygon | Ethereum's Internet of Blockchains] (Jan 29, 2022)</ref> | ||
[https://polygon.technology/about/ About - Polygon | Ethereum's Internet of Blockchains] (Jan 29) | <ref name="polygon-6076">[https://polygon.technology/about/ About - Polygon | Ethereum's Internet of Blockchains] (Jan 29, 2022)</ref> | ||
[https://twitter.com/TalBeerySec/status/1477327949842075648 @TalBeerySec Twitter] (Jul 22) | <ref name="talbeerysectwitter-8672">[https://twitter.com/TalBeerySec/status/1477327949842075648 @TalBeerySec Twitter] (Jul 22, 2022)</ref> | ||
[https://twitter.com/immunefi/status/1476028698751082507 @immunefi Twitter] (Jul 22) | <ref name="immunefitwitter-8673">[https://twitter.com/immunefi/status/1476028698751082507 @immunefi Twitter] (Jul 22, 2022)</ref> | ||
[https://coinmarketcap.com/currencies/polygon/historical-data/ https://coinmarketcap.com/currencies/polygon/historical-data/] (Jul 22) | <ref name="coinmarketcap-8674">[https://coinmarketcap.com/currencies/polygon/historical-data/ https://coinmarketcap.com/currencies/polygon/historical-data/] (Jul 22, 2022)</ref> | ||
[https://twitter.com/Cranehehe1/status/1476323347579674625 @Cranehehe1 Twitter] (Jul 23) | <ref name="cranehehe1twitter-8727">[https://twitter.com/Cranehehe1/status/1476323347579674625 @Cranehehe1 Twitter] (Jul 23, 2022)</ref> | ||
[https://cryptobriefing.com/a-hacker-stole-1-6m-after-exploiting-a-polygon-bug/ A Hacker Stole $1.6M After Exploiting a Polygon Bug - Crypto Briefing] (Aug 24) | <ref name="cryptobriefing-8913">[https://cryptobriefing.com/a-hacker-stole-1-6m-after-exploiting-a-polygon-bug/ A Hacker Stole $1.6M After Exploiting a Polygon Bug - Crypto Briefing] (Aug 24, 2022)</ref> | ||
[https://old.reddit.com/r/CryptoCurrency/comments/rs6fam/polygon_admits_the_network_was_hacked_hacker/ Polygon Admits The Network Was Hacked, Hacker Swiped 801,601 MATIC Tokens - The Crypto Basic : CryptoCurrency] (Oct 12) | <ref name="redditold-9248">[https://old.reddit.com/r/CryptoCurrency/comments/rs6fam/polygon_admits_the_network_was_hacked_hacker/ Polygon Admits The Network Was Hacked, Hacker Swiped 801,601 MATIC Tokens - The Crypto Basic : CryptoCurrency] (Oct 12, 2022)</ref> | ||
[https://cryptonews.com/news/polygon-justifies-its-quiet-hard-fork-citing-critical-vulnerability.htm Polygon Justifies Its Quiet Hard-Fork Citing 'Critical Vulnerability'] (Dec 1) | <ref name="cryptonews-9848">[https://cryptonews.com/news/polygon-justifies-its-quiet-hard-fork-citing-critical-vulnerability.htm Polygon Justifies Its Quiet Hard-Fork Citing 'Critical Vulnerability'] (Dec 1, 2022)</ref></references> | ||
Revision as of 11:48, 28 February 2023
Notice: This page is a freshly imported case study from the original repository. The original content was in a different format, and may not have relevant information for all sections. Please help restructure the content by moving information from the 'About' section to other sections, and add any missing information or sources you can find. If you are new here, please read General Tutorial on Wikis or Anatomy of a Case Study for help getting started.
Notice: This page contains sources which are not attributed to any text. The unattributed sources follow the initial description. Please assist by visiting each source, reviewing the content, and placing that reference next to any text it can be used to support. Feel free to add any information that you come across which isn't present already. Sources which don't contain any relevant information can be removed. Broken links can be replaced with versions from the Internet Archive. See General Tutorial on Wikis, Anatomy of a Case Study, and/or Citing Your Sources Guide for additional information. Thanks for your help!
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.
This is a global/international case not involving a specific country. [1][2][3][4][5][6][7][8][9][10][11][12][13][14][15][16][17]
About Polygon
"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."
This is a global/international case not involving a specific country.
The background of the exchange platform, service, or individuals involved, as it would have been seen or understood at the time of the events.
Include:
- Known history of when and how the service was started.
- What problems does the company or service claim to solve?
- What marketing materials were used by the firm or business?
- Audits performed, and excerpts that may have been included.
- Business registration documents shown (fake or legitimate).
- How were people recruited to participate?
- Public warnings and announcements prior to the event.
Don't Include:
- Any wording which directly states or implies that the business is/was illegitimate, or that a vulnerability existed.
- Anything that wasn't reasonably knowable at the time of the event.
There could be more than one section here. If the same platform is involved with multiple incidents, then it can be linked to a main article page.
The Reality
This sections is included if a case involved deception or information that was unknown at the time. Examples include:
- When the service was actually started (if different than the "official story").
- Who actually ran a service and their own personal history.
- How the service was structured behind the scenes. (For example, there was no "trading bot".)
- Details of what audits reported and how vulnerabilities were missed during auditing.
What Happened
The specific events of the loss and how it came about. What actually happened to cause the loss and some of the events leading up to it.
| Date | Event | Description |
|---|---|---|
| December 4th, 2021 12:00:00 AM | Main Event | Expand this into a brief description of what happened and the impact. If multiple lines are necessary, add them here. |
Total Amount Lost
The total amount at risk has been estimated at $21,057,846,000 USD. The total amount lost has been estimated at $1,820,000 USD.
How much was lost and how was it calculated? If there are conflicting reports, which are accurate and where does the discrepancy lie?
Immediate Reactions
How did the various parties involved (firm, platform, management, and/or affected individual(s)) deal with the events? Were services shut down? Were announcements made? Were groups formed?
Ultimate Outcome
What was the end result? Was any investigation done? Were any individuals prosecuted? Was there a lawsuit? Was any tracing done?
A bounty of $3,470,000 USD was paid for the discovery.
Total Amount Recovered
The total amount recovered has been estimated at $1,820,000 USD.
What funds were recovered? What funds were reimbursed for those affected users?
Ongoing Developments
What parts of this case are still remaining to be concluded?
Prevention Policies
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.
References
- ↑ Polygon upgrade quietly fixes bug that put $24B of MATIC at risk (Dec 30, 2022)
- ↑ @0xPolygon Twitter (Jan 2, 2022)
- ↑ All You Need to Know About the Recent Network Upgrade — Polygon | Blog (Jan 2, 2022)
- ↑ Polygon Lack Of Balance Check Bugfix Postmortem 2 2m Bounty (Jan 2, 2022)
- ↑ Polygon Quietly Patched Vulnerability That Put $24 Billion in MATIC at Risk - Decrypt (Jan 2, 2022)
- ↑ Polygon Discloses Patched Exploit That Put 9B MATIC at Risk (Jan 2, 2022)
- ↑ 'Critical' Polygon bug put $24 billion in tokens at risk until recent hard fork (Jan 2, 2022)
- ↑ @MihailoBjelic Twitter (Jan 2, 2022)
- ↑ Polygon | Ethereum's Internet of Blockchains (Jan 29, 2022)
- ↑ About - Polygon | Ethereum's Internet of Blockchains (Jan 29, 2022)
- ↑ @TalBeerySec Twitter (Jul 22, 2022)
- ↑ @immunefi Twitter (Jul 22, 2022)
- ↑ https://coinmarketcap.com/currencies/polygon/historical-data/ (Jul 22, 2022)
- ↑ @Cranehehe1 Twitter (Jul 23, 2022)
- ↑ A Hacker Stole $1.6M After Exploiting a Polygon Bug - Crypto Briefing (Aug 24, 2022)
- ↑ Polygon Admits The Network Was Hacked, Hacker Swiped 801,601 MATIC Tokens - The Crypto Basic : CryptoCurrency (Oct 12, 2022)
- ↑ Polygon Justifies Its Quiet Hard-Fork Citing 'Critical Vulnerability' (Dec 1, 2022)