https://github.com/Cyfrin/2024-08-fjord/blob/main/src/FjordPoints.sol
The claimPoints()
function is susceptible to reentrancy attacks, where malicious contracts could exploit it to mint more tokens than intended.
The function claimPoints()
updates pendingPoints
and then mints tokens to the caller. If a malicious contract calls claimPoints()
and reenters before pendingPoints
is reset, it can mint additional tokens during the reentrant call. This is due to the function’s state changes occurring after the external call, making it vulnerable to reentrancy attacks.
Proof of Concept (PoC):
High. An attacker could repeatedly exploit this vulnerability to mint excessive tokens, undermining the contract’s integrity and causing financial loss.
Manual Review
Implement a reentrancy guard or apply the Checks-Effects-Interactions pattern to mitigate the risk. Example:
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.