Square Flint Grasshopper
High
The withdrawGraduatedMarketFunds function in the contract contains a reentrancy vulnerability. The _sendEth() function is called before resetting the marketFunds[profileId] value to 0. This allows a malicious contract to reenter the function and repeatedly withdraw funds associated with the same profileId, potentially draining the contract's funds.
In ReputationMarket.sol:675 is sent arketFunds[profileId]
wei which assume is not zero.
In ReputationMarket.sol:677 it is reset to zero, but before it can be recalled and arketFunds[profileId]
will have old, not updated value.
- Authorized account try to take more eth than it should.
No response
- Attacker creates contract which has implemented receive() and implement calling
withdrawGraduatedMarketFunds
funciton in it. - It calls function
withdrawGraduatedMarketFunds
. - Function is recalled and eth is transferred to the contract
The contract may be drained(ETH only) if wrong contract will be passed as trusted.
No response
reinit value to new variable and reset marketFunds[profileId]
before sending ether to the sender.