Submitted by cergyk
A malicious user can use reentrancy in twAML to brick reward distribution
As we can see in participate in twAML, the function _safeMint is used to mint the voting position to the user;
However this function executes a callback on the destination contract: onERC721Received, which can then be used to reenter:
The _participant contract can reenter in exitPosition, and release the position since,
position.expiry is not set yet.
However we see that the following effects are executed after _safeMint:
And these have a direct impact on reward distribution;
The malicious user can use reentrancy to increase weekTotals[w0 + 1].netActiveVotes by big amounts without even locking her tokens;
Later when the operator wants to distribute the rewards:
totals.totalDistPerVote[_rewardTokenId] becomes zero
Use any of these:
0xRektora (Tapioca) confirmed
