Skip to content
Business logic Audit finding Intermediate

not able to create claim

After an admin revokes a recipient's claim, the claim's startTimestamp is not reset to zero, so the hasNoClaim modifier blocks creating a new claim for the same recipient. This prevents the admin from re-creating a claim for that recipient in the same vesting contract.

rajatbeladiya Follow

Originally disclosed on Code4rena

Submitted by rajatbeladiya, also found by 0x4non, ak1, berndartmueller, CertoraInc, Chom, imare, JLevick, joestakey, JohnSmith, KIntern_NA, obront, rbserver, rotcivegaf, Ruhum, RustyRabbit, and supernova

If admin revoked any recipient’s claim, admin can not create claim for the same recipient because startTimestamp is not updated to initial value on revoke claim. There will be a need to create a claim again for any reason like: 1) mistakenly revoked claim, 2) wrong info provided to claim, 3) new vesting period starts, etc.

Proof of Concept

  1. Alice creates claim for Bob

  2. Alice revokes claim of Bob

  3. Alice tries to create claim for Bob but claim will not create because it has modifier hasNoClaim() which is checked for claim should not active and it checks for require(_claim.startTimestamp == 0, "CLAIM_ALREADY_EXISTS");

  4. VTVLVesting.sol#L245-L253

  5. VTVLVesting.sol#L123-L140

Recommended Mitigation Steps

Update startTimestamp to 0 on revokeClaim().

0xean (judge) decreased severity to Low and commented:

Downgrading to low severity. While true, why wouldn’t the employee just use a different address? There is no residual benefit to using the old address (unless it was a smart contract, which the warden doesn’t mention as part of their POC). The sponsor may want to fix this, since the fix is simple, but it poses very little risk and certainly no direct loss of funds.

0xean (judge) increased severity to Medium and commented:

Spent a bit more time thinking about this one and do think that it qualifies as Medium severity since it does affect the availability of the protocol in a number of ways. Going to go ahead and revise to Medium.

lawrencehui (VTVL) acknowledged, but disagreed with severity and commented:

The vesting contract is designed to be created and used in a one-off manner and the revoke function is to prevent any mistakes made upon creation (wrong address / amount / timestamp etc.). In practical sense, if a claim (or the recipient address) is revoked, one (the admin) can always create a new vesting contract with the correct claim parameters.

I therefore think that it is by design that the address is only able be claimable once per vesting contract, in all circumstance, the admin can re-create a new vesting contract to mitigate this issue and therefore this is a low risk / non-critical issue.

0xean (judge) commented:

I don’t think the tactic of deploying a new contract is the correct one here simply to be able to set up vesting for one botched person or someone whose vesting token amount changes for example. I am going to stick with the Medium severity on this one, but do appreciate the response and thoughts on possible mitigations.

ak1 (warden) commented:

I have explained one of the real use case scenarios where this protocol will fail to serve many. Refer to issue 384. It is not always contract address or EOA which will decide the identity of a person. Each one will have unique ID. That id is going to be used in all the places.


The original report as published on Code4rena, by rajatbeladiya. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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 revoke function sets the claim as inactive but leaves startTimestamp non-zero, and the hasNoClaim check requires startTimestamp to be zero.

Impact

The admin cannot re-create a claim for the same recipient in the same vesting contract, which affects availability; the judge noted there is no direct loss of funds.

What the attacker needed

Admin role; existing claim for recipient; claim revoked

The fix

The fix should reset startTimestamp to zero when a claim is revoked.

How it was found

  1. Alice creates a claim for Bob.
  2. Alice revokes Bob's claim.
  3. Alice tries to create a new claim for Bob, but it fails because startTimestamp is not zero.

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.

A vesting contract lets an admin set up a schedule for someone to receive tokens over time. If the admin cancels that schedule, the contract still remembers that the person had one, so it refuses to set up a new schedule for them. The fix is to clear that memory when cancelling.

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.

More by rajatbeladiya

View all

2 more disclosed reports, best first.

More from VTVL contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.