Skip to content
Access control Audit finding Intermediate

Voter in VoteEscrowCore can permanently lock user tokens

A malicious voter can call voting() or attach() to increase a token's attachments or set its voted status, preventing withdrawal, merge, or transfer. This locks the user's tokens in the contract indefinitely.

scaraven Follow

Originally disclosed on Code4rena

Submitted by scaraven

https://github.com/code-423n4/2022-07-golom/blob/e5efa8f9d6dda92a90b8b2c4902320acf0c26816/contracts/vote-escrow/VoteEscrowCore.sol#L873-L876

https://github.com/code-423n4/2022-07-golom/blob/e5efa8f9d6dda92a90b8b2c4902320acf0c26816/contracts/vote-escrow/VoteEscrowCore.sol#L883-L886

https://github.com/code-423n4/2022-07-golom/blob/e5efa8f9d6dda92a90b8b2c4902320acf0c26816/contracts/vote-escrow/VoteEscrowCore.sol#L894

https://github.com/code-423n4/2022-07-golom/blob/e5efa8f9d6dda92a90b8b2c4902320acf0c26816/contracts/vote-escrow/VoteEscrowCore.sol#L538

https://github.com/code-423n4/2022-07-golom/blob/e5efa8f9d6dda92a90b8b2c4902320acf0c26816/contracts/vote-escrow/VoteEscrowCore.sol#L1008

A malicious voter can arbitrarily increase the number of attachments or set the voted status of a token to true. This prevents the token from being withdrawn, merged or transfered thereby locking the tokens into the contract for as long as the voter would like.

I submitted this is as a medium severity because it has external circumstances (a malicious voter) however has a very high impact if it does occur.

Proof of Concept

  1. A user creates a lock for their token and deposits it into the VoteEscrowDelegate/Core contract.
  2. The malicious voter then calls either voting() or attach() thereby preventing the user withdrawing their token after the locked time bypasses

Tools Used

VS Code

Recommended Mitigation Steps

I have not seen any use of voting() or attach() in any of the other contracts so it may be sensible to remove those functions altogether. On the other hand, setting voter to be smart contract which is not malicious offsets this problem.

zeroexdead (Golom) confirmed

zeroexdead (Golom) commented:

Removed Voter: https://github.com/golom-protocol/contracts/commit/03572010ef868597310f4736c91aacf3aa044ce9

0xsaruman (Golom) resolved


The original report as published on Code4rena, by scaraven. 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 voting() and attach() functions lack access control, allowing any voter to modify a token's state and block its withdrawal.

Impact

A malicious voter can permanently lock a user's tokens, preventing withdrawal, merge, or transfer.

What the attacker needed

A malicious voter; user has locked tokens

The fix

The project removed the Voter functionality to fix the issue.

How it was found

  1. A user creates a lock for their token and deposits it into the VoteEscrowDelegate/Core contract.
  2. The malicious voter calls either voting() or attach(), preventing the user from withdrawing their token after the lock time expires.

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.

In this voting contract, a voter can mark a token as 'voted' or add attachments. If a voter is malicious, they can do this to someone else's token, and the contract then refuses to let the owner withdraw or transfer it. So the owner's tokens get stuck.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by scaraven

View all

6 more disclosed reports, best first.

More from Golom contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.