The assembly code in the nonReentrant
modifier has a major flaw.
The tload
checks if slot 1 is true or false and then sets slot 0 to true in tstore(0, 1
). If there is a reentrancy attack the wrong storage slot is being checked( 1 instead of 0 ) making the modifier useless.
Because of this flaw the nonReentrant
modifier does not protect against reentrancy attacks.
These functions would not be protected against reentrancy attacks: sendERC20
, sendETH
, and contractInteractions
.
Manual code review
Make these changes to the nonReentrant
modifier:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.