Incorrectly set _maxTime to be in line with the locking maxTime of each veToken could render the deposit of this contract to be unfunctional or even freeze assets inside the contract
The contract's _maxTime was set higher than the maximum lock time allowed by Curve's VotingEscrow, causing increase_unlock_time to revert. If a user deposits without locking, the asset becomes stuck in the contract because lockVeAsset cannot succeed.
Submitted by Kumpa, also found by SecureZeroX and unforgiven
Since _maxTime needs to be manually input in the constructor with no other ways of changing it, if the owner inputs the _maxTime that is higher than the capacity of each vaults of veTokens, it will cause IVoteEscrow(escrow).increase_unlock_time(_value); to get rejected.
In the mild case when a user initially locks the asset during depositing, the contract will simply revert the transaction.
In the severe case when a user does not lock the asset during depositing, the asset will end up locked in the contract since noone will be able to succesfully call lockVeAsset. This will cause the asset to be locked up with no way of withdrawing it. Even though a user will still get benefits from the minted reward, a contract will not be able to receive any benefits since it can’t utilize the locked asset in VeAssetDepositor.
Proof of Concept
1.The owner initially sets _maxTime in constructor to be 126489600 (864003664) instead of 126144000 (864003654) which is the maximum time that a user can deposit in curve
2.A user deposit veAsset but deferring the locking to save gas
3.The veAsset is transferred from a user to the contract and the contract mint a reward token to the user
*Above shows that the deposit will get reverted if lockAmount is more than 4 years in curve’s VotingEscrow
4.The veAsset will not be able to move to the staking contract because when VoterProxy calls increase_unlock_time in the targeted vault, the call will get reverted due to exceeded _value of unlockAt
Recommended Mitigation Steps
The owner should set the value of _maxTime in advance for each veAsset and not relying on manual inputting during the constructoring as the risk of misconfiging ot is high. Otherwise the contract should add an emergency measure that can help change _maxTime but this function needs to be protected with the highest security (eg. with timelock and multisig).
solvetony (veToken Finance) disagreed with severity and commented:
We can set it by a function instead of a constructor. Middle risk.
Alex the Entreprenerd (judge) decreased severity to Medium and commented:
The warden has shown how, due to misconfiguration a lock may not be created, causing tokens to be stuck in the contract.
We can confirm that a revert would happen by checking
VotingEscrowBecause this is contingent on a wrong configuration 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 contract's _maxTime was manually set in the constructor to a value exceeding the maximum lock time enforced by Curve's VotingEscrow, and there was no way to change it later.
Impact
In the mild case, deposits that lock immediately revert; in the severe case, assets deposited without locking become stuck in the contract with no way to withdraw them, though users still receive minted rewards.
What the attacker needed
Owner misconfigures _maxTime in constructor; user deposits without locking
The fix
The owner should set _maxTime in advance for each veAsset rather than relying on manual input during construction, or add a securely protected emergency function to change it.
How it was found
- The owner sets _maxTime in the constructor to 126489600 instead of 126144000.
- A user calls deposit but defers locking to save gas.
- The veAsset is transferred to the contract and a reward token is minted to the user.
- The veAsset cannot be moved to the staking contract because VoterProxy calls increase_unlock_time, which reverts due to the exceeded unlock time.
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.
This report is about a smart contract that lets people deposit tokens and lock them for rewards. The contract had a setting for the longest lock time, but it was set longer than the system allows, so the lock step always failed. If someone deposited without locking, their tokens got stuck because the contract could never lock them later.
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.