mirror of
https://github.com/autistic-symposium/blockchains-security-toolkit.git
synced 2025-08-03 03:46:15 -04:00
1.2 KiB
1.2 KiB
Polygon Double-Spend Bugfix Review
- Polygon introduced two bridges: Plasma (more secure) and PoS bridge.
- The main vulnerability lies in how Polygon’s WithdrawManager verifies the inclusion and uniqueness of the burn transaction in previous blocks.

PoC
- Deposit a large amount of ETH/tokens to Polygon through the Plasma Bridge.
- After confirmation of the funds being available on the Polygon, start the Withdrawal process.
- Wait for seven days for an exit to be valid.
- Resubmit the exit payload but with a modified first byte of the branch mask.
- The same valid transaction can be resubmitted up to 223 times with different values for the first byte of the HP-encoded path.
- Profit.
Fix
- 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.