if (value > MAX_MSG_VALUE) {
// The if above should never be true, since noone should be able to have
// MAX_MSG_VALUE wei of ether. However, if it does happen for some reason,
// we will revert(0,0).
// Note, that we use raw revert here instead of `panic` to emulate behaviour close to
// the EVM's one, i.e. returndata should be empty.
assembly {
return(0, 0)
}
}
The comments do not match the implementation aswell.
Tools Used
Manual Review
Recommended Mitigation Steps
Just implement it the way that is described in the comments.
Lines of code
https://github.com/code-423n4/2023-03-zksync/blob/main/contracts/MsgValueSimulator.sol#L55
Vulnerability details
Impact
This makes it theoretically possible for user a to send more than MAX_MSG_VALUE
Proof of Concept
https://github.com/code-423n4/2023-03-zksync/blob/main/contracts/MsgValueSimulator.sol#L55
The comments do not match the implementation aswell.
Tools Used
Manual Review
Recommended Mitigation Steps
Just implement it the way that is described in the comments.