Skip to content
Business logic Write-up Intermediate

Beluga Protocol

The BELA token's vote accounting incorrectly moves votes to the recipient on transfer instead of their delegatee, allowing an attacker to reduce any address's votes to zero. This causes all transfers from that address to revert, permanently freezing BELA in contracts like VeBela.

github.com

Published on github.com

History

The author, on github.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The _transfer function moves votes between sender and recipient instead of their respective delegatees.

Impact

An attacker can reduce any address's votes to zero, causing all future BELA transfers from that address to revert and permanently freezing funds in contracts like VeBela.

What the attacker needed

Attacker holds some BELA; victim address has BELA votes

The fix

The _transfer function should move votes between the sender's and recipient's delegatees, not the sender and recipient directly.

How it was found

  1. Charlie calls delegate() to set his delegatee to Bob.
  2. Alice calls transfer() to send 1000 BELA to Charlie.
  3. Charlie calls delegate() and sets his delegatee to himself.
  4. Bob's votes are reduced by 1000, and Charlie gains 1000 votes.

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 write-up has not been written yet. The Original tab links to the source.

The token tracks votes for governance, and when tokens move, votes should follow the person they delegated to. But the code gives votes directly to the receiver, so an attacker can use a delegate-then-transfer trick to wipe out someone else's votes. With zero votes, that address can no longer send tokens, locking funds forever.

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.

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.