According to code snippet _nonReservedToken will send to beneficiary via transfer function.
Some function doesnot revert on failure, they return false.
In that case Protocol doesn't checking return value from transfer().
// The amount to send to the beneficiary
uint256 _nonReservedToken = PRBMath.mulDiv(
_amountReceived, JBConstants.MAX_RESERVED_RATE - _reservedRate, JBConstants.MAX_RESERVED_RATE
);
// The amount to add to the reserved token
uint256 _reservedToken = _amountReceived - _nonReservedToken;
// Send the non-reserved token to the beneficiary (if any / reserved rate is not max)
if (_nonReservedToken != 0) projectToken.transfer(_data.beneficiary, _nonReservedToken);
Lines of code
https://github.com/code-423n4/2023-05-juicebox/blob/main/juice-buyback/contracts/JBXBuybackDelegate.sol#L286
Vulnerability details
Impact
User will loss fund.
Proof of Concept
According to code snippet
_nonReservedToken
will send tobeneficiary
viatransfer
function. Some function doesnotrevert
on failure, they returnfalse
.In that case Protocol doesn't checking return value from
transfer()
.Tools Used
Manual Review
Recommended Mitigation Steps\
Use
safeTransfer()
Assessed type
ERC20