The VeraacToken
contract allows users to lock RAAC tokens in exchange for Veraac tokens, which serve as voting tokens. However, the lock function does not enforce proper restrictions on multiple lock calls. As a result, a user can first lock tokens for the maximum duration (thereby obtaining maximum voting power) and then re-lock the same tokens with a shorter duration. This flaw permits premature withdrawal and manipulation of voting power, compromising the intended locking mechanism and governance model.
Lack of Proper Lock Differentiation:
The lock
function does not record distinct lock positions for each locking event or enforce a check that prevents a user from calling the function multiple times. This omission allows a user to override or reset lock parameters (such as the lock expiry) by re-locking tokens with a different duration.
Overriding Lock Conditions:
Without proper differentiation, an attacker can:
Lock tokens for the maximum allowed duration (e.g., 4 years) to obtain maximum voting power.
Before the long lock expires, call the lock
function again to lock the same tokens for a minimal duration (e.g., 1 year).
Withdraw tokens earlier than intended while still having benefited from the long-duration lock's voting power.
Insufficient Update Mechanism:
The contract provides functions like increaseLock
or extendLock
that only allow increasing the locked amount or extending the duration, but they do not handle separate locking positions. This lack of proper state management for multiple locks creates a vulnerability that can be exploited.
The following proof-of-concept (PoC) demonstrates the vulnerability. In this test scenario, a user locks tokens for the maximum duration to get maximum voting power and then locks the same tokens again with a shorter duration, allowing premature withdrawal:
Inflated Voting Power:
Attackers can obtain maximum voting power by exploiting the multiple locking vulnerability, which may influence governance decisions disproportionately.
Premature Withdrawal:
Users can withdraw their locked tokens earlier than intended, undermining the purpose of the locking mechanism and destabilizing the protocol's economic model.
Governance Manipulation:
The ability to manipulate lock durations can lead to unfair governance advantages, impacting the protocol's decision-making and overall trust.
Manual review and writing test
Implement Distinct Lock Tracking:
Use a mapping or structured data (e.g., lock IDs mapped to individual lock details) to record each lock separately. This approach will prevent a new lock call from overriding an existing lock.
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.