SafeERC20.sol is imported but not used in the transferBribes() function
The transferBribes() function in BribeVault.sol uses token.transfer() instead of safeTransfer, so tokens like USDT that do not return a boolean will cause the transaction to revert. This makes such tokens unusable in the protocol.
Submitted by jayjonah8, also found by cccz, cmichel, Dravee, gzeon, hyh, IllIllI, leastwood, NoamYakov, and Omik
In BribeVault.sol the transferBribes() function uses token.transfer() instead of token.safeTransfer. Tokens that don’t correctly implement the latest EIP20 spec, like USDT, will be unusable in the protocol as they revert the transaction because of the missing return value. The fact that the SafeERC20.sol library is imported at the top of the BribeVault.sol implies that safeTransfer should be being used but may have been forgotten.
Proof of Concept
Recommended Mitigation Steps
It’s recommended to use OpenZeppelin’s SafeERC20 versions with the safeTransfer and safeTransferFrom functions that handle the return value check as well as non-standard-compliant tokens.
kphed (Redacted Cartel) confirmed and commented:
Good catch!
Thanks again for participating in our contest jayjonah8, looking forward to more feedback/suggestions/comments.
Alex the Entreprenerd (judge) decreased severity to Medium and commented:
Agree with the finding, because this is contingent on the specific token failing. I believe Medium severity to be more appropriate.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the developer used the standard transfer function instead of a safe version that handles tokens without a return value.
What the attacker needed
Token like USDT that returns no boolean
The fix
It should be fixed by using OpenZeppelin's SafeERC20 safeTransfer and safeTransferFrom functions, which handle the return value check and non-standard tokens.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Some tokens, like USDT, do not follow the standard exactly and do not return a true/false value when you transfer them. The code here expects that return value, so the transfer fails and the whole transaction is cancelled. Using a safe transfer function that checks the return value only if it exists would avoid this.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.