Optimizer bug with memory operations with Solidity 0.8.13
Several contracts have functions performing low level assembly memory operations: MerkleBase.sol, Transfer.sol. Due to a bug in the optimizer for Solidity 0.8.13, these operations can be omitted by the compiler. This would result in several functions breaking, including key transfer functions such as Transfer.ERC20Transfer or Transfer.ERC721TransferFrom
Lines of code
https://github.com/code-423n4/2022-07-fractional/blob/8f2697ae727c60c93ea47276f8fa128369abfe51/src/targets/Transfer.sol#L18-L22 https://github.com/code-423n4/2022-07-fractional/blob/8f2697ae727c60c93ea47276f8fa128369abfe51/src/targets/Transfer.sol#L222-L227 https://github.com/code-423n4/2022-07-fractional/blob/8f2697ae727c60c93ea47276f8fa128369abfe51/src/targets/Transfer.sol#L341-L347 https://github.com/code-423n4/2022-07-fractional/blob/8f2697ae727c60c93ea47276f8fa128369abfe51/src/targets/Transfer.sol#L474-L480
Vulnerability details
Optimizer bug with memory operations with Solidity
0.8.13
Several contracts have functions performing low level assembly memory operations:
MerkleBase.sol
,Transfer.sol
. Due to a bug in the optimizer for Solidity 0.8.13, these operations can be omitted by the compiler. This would result in several functions breaking, including key transfer functions such asTransfer.ERC20Transfer
orTransfer.ERC721TransferFrom
Impact
High
Proof Of Concept
see this article
Mitigation
Update the compiler's versions to 0.8.15