The vulnerability in the buyPresent
function is rooted in the misalignment of token transfers. The use of _mintAndIncrement()
mistakenly sends tokens to the function invoker (msg.sender)
instead of the intended recipient (presentReceiver)
.
The impact of this vulnerability is significant, as it introduces the risk of unauthorized token transfers and disrupts the expected behavior of the present purchase mechanism.
Manual Review
Using mintAndIncrement()
in the function should be changed and be dynamic in the sense that it should accept a parameter of address to be minted to, say:
So the original function could be tweaked to accept an address parameter or a new function that handles that could be created.
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.