Hello team,
While reviewing the source code of the LibWellConvert contract in the Beanstalk protocol, I discovered a potential security issue related to the transfer
function call. The code does not adequately handle the return value of the transfer
function, which could lead to token loss under certain conditions.
Navigate to the LibWellConvert contract on GitHub at: LibWellConvert.sol
Identify the section of code responsible for the C.bean().transfer(well, beansConverted)
function call.
Note that the return value of the transfer
function is not checked.
Deploy the contract and execute the function corresponding to the vulnerable code path.
Observe that the transaction does not revert even if the transfer
function fails.
Ignoring the return value of the transfer
function could lead to potential token loss if the transfer fails for any reason, such as insufficient gas or incorrect recipient address.
This vulnerability could be exploited by attackers to cause financial harm to the contract or its users.
Manual VS code review
To mitigate this issue, it is recommended to check the return value of the transfer
function and handle any failure cases appropriately. This can be achieved by reverting the transaction if the transfer fails, ensuring that token transfers are executed securely.
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.