The createNewShare function in the 1155Tech Market contract allows for the creation of shares susceptible to reorg attacks on certain chains like Arbitrum, Optimism, and Polygon.
Sponsor confirmed 1155tech could be deployed on different chain:
The impact is severe, as a malicious actor can exploit the reorg vulnerability during the share market listing event. If users rely on share IDs obtained in advance and initiate buy actions based on them, a malicious actor could frontrun the process during a reorg, resulting in the unauthorized sale of shares and the theft of user funds.
Proof of Concept
Alice starts a new share market and promotes her share ID.
Users obtain the share ID and initiate buy actions based on it.
Bob notices a reorg, frontruns createNewShare to obtain the share ID.
Alice's createNewShare is executed, assigning a new share ID (+1).
Users' pendinbuy transactions execute, unintentionally buying shares from Bob, leading to unintended profits for Bob.
Tools Used
Manual Review
Recommended Mitigation Steps
To address this critical vulnerability, it is recommended to add a warm-up period to shareData before buy/sell transactions can take place. This ensures that a sufficient amount of time has passed, making reorg attacks impossible during the creation of new shares.
Lines of code
https://github.com/code-423n4/2023-11-canto/tree/main/1155tech-contracts/src/Market.sol#L118
Vulnerability details
Impact
The
createNewShare
function in the 1155Tech Market contract allows for the creation of shares susceptible to reorg attacks on certain chains like Arbitrum, Optimism, and Polygon.Sponsor confirmed 1155tech could be deployed on different chain:
The impact is severe, as a malicious actor can exploit the reorg vulnerability during the share market listing event. If users rely on share IDs obtained in advance and initiate buy actions based on them, a malicious actor could frontrun the process during a reorg, resulting in the unauthorized sale of shares and the theft of user funds.
Proof of Concept
createNewShare
to obtain the share ID.createNewShare
is executed, assigning a new share ID (+1).Tools Used
Manual Review
Recommended Mitigation Steps
To address this critical vulnerability, it is recommended to add a warm-up period to
shareData
before buy/sell transactions can take place. This ensures that a sufficient amount of time has passed, making reorg attacks impossible during the creation of new shares.References
Assessed type
MEV