The contractInteractions
function allows the owner to perform arbitrary external calls, but due to its reliance on a flawed nonReentrant
modifier, it becomes vulnerable to reentrancy if the owner calls a malicious contract.
This function executes an external call:
While the function is protected by the nonReentrant
modifier, that guard is implemented using transient storage and mistakenly checks a different slot (slot 1) than the one it writes to (slot 0). Consequently, the reentrancy guard may fail, allowing a malicious contract, when invoked by the owner, to perform reentrant calls into this contract.
Exploitation Risk: An attacker controlling the target contract could re-enter vulnerable functions if the owner inadvertently interacts with a malicious contract.
State Manipulation: Reentrancy could lead to unauthorized state changes or fund drainage in parts of the contract assumed to be secure.
Increased Attack Surface: The broken guard undermines the security assumptions of the contract, leaving it open to subtle, complex attack vectors in multi-call transactions.
Manual Code Review
Correct the Reentrancy Guard: Fix the nonReentrant
modifier to use the same transient storage slot for both checking and setting the flag:
Use Established Libraries: Consider using a well-audited reentrancy guard from libraries such as OpenZeppelin.
Thorough Testing: Conduct comprehensive testing for reentrancy attacks, particularly when making arbitrary external calls.
Review External Interactions: Minimize risks by validating target contracts and carefully managing external calls, especially when involving complex transactions.
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.