The buyOrder
function on ln. 261 exposes the contract to reentrancy vulnerability due to the absence of a "checks-effects-interactions" in the contract.
This buyOrder
function makes external calls to the seller and the contract owner using call
. If either the seller or owner is a malicious or ill-intentioned contract, they could re-enter the contract before state changes/updates are finalized and concluded
A bad actor/an attacker could re-enter this function and be able to manipulate the number of orders before contract completion/finalization
Manual code review
Use and implement a reentrancy guard using the ReentrancyGuard
library from OpenZeppelin to prevent reentrancy.
In addition to implementing the ReentrancyGuard
library, use the "checks-effects-interactions" to:
Check conditions and update contract state, and
Perform external interactions as the final step.
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.