report identifies a critical vulnerability in the SablierV2BatchLockup contract related to unchecked external calls to ERC-20 transfer functions. This issue could lead to unexpected behavior, such as Denial of Service (DoS) attacks or unauthorized token transfers.
The vulnerability is found in the _handleTransfer method of the contract, where the transfer and approve functions of the ERC-20 token are called without checking their return values. According to the ERC-20 standard, these functions return a boolean indicating success. Failing to verify these return values could allow the contract to proceed as if the transfers were successful, even when they fail.
The unchecked external calls can have severe consequences:
Denial of Service (DoS): An attacker could exploit this vulnerability by causing the transfer function to fail repeatedly, preventing legitimate users from transferring their tokens.
Unauthorized Token Transfers: If an ERC-20 token has a non-standard implementation that returns false or reverts under certain conditions, it could lead to tokens being transferred without proper authorization.
Manual Code Review
Mythril
To mitigate this vulnerability, it is essential to add checks that verify the success of the ERC-20 transfer and approve calls. like:
require(asset.transferFrom(msg.sender, address(this), amount), "Transfer failed");
require(asset.approve(sablierContract, amount), "Approval failed");
https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity
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.