Skip to content
Business logic Audit finding Intermediate

Blocking Through Change of Blocklist Could Trap Tokens

If the blocklist contract is changed to one that marks an account as blocked, and that account had previously delegated tokens, the account cannot withdraw, quit its lock, or undelegate, so its tokens become stuck. The report claims this could happen during a blocklist migration error.

Respx Follow

Originally disclosed on Code4rena

Submitted by Respx

https://github.com/code-423n4/2022-08-fiatdao/blob/fece3bdb79ccacb501099c24b60312cd0b2e4bb2/contracts/features/Blocklist.sol#L27 https://github.com/code-423n4/2022-08-fiatdao/blob/fece3bdb79ccacb501099c24b60312cd0b2e4bb2/contracts/VotingEscrow.sol#L531 https://github.com/code-423n4/2022-08-fiatdao/blob/fece3bdb79ccacb501099c24b60312cd0b2e4bb2/contracts/VotingEscrow.sol#L637

In the normal flow, an account that is blocked is protected from having its funds locked by a call to forceUndelegate(), as occurs on line 27 of Blocklist.sol. However, this protection could potentially be circumvented if the value of blocklist is changed to an address which returns True for isBlocked() (as tested in the modifier checkBlocklist()) and if this account was not previously blocked (ie. forceUndelegate() was never called on it). In this situation, if the account has delegated, its tokens will be rendered irretrievable.

Proof of Concept

The blocked account would not be able to call wthdraw() successfully because of the check on line 531. The blocked account would not be able to call quitLock() successfully because of the check on line 637. The blocked account would not be able to call delegate() to undelegate and thereby allow it to make these calls because delegate() uses the checkBlocklist modifier. Blocklist has no unblock functionality, so the only way to release the tokens would be through a redeployment of Blocklist.

Recommended Mitigation Steps

This situation is most likely to occur as an error during a blocklist migration. In that case, it could be mitigated by adding an unblock functionality to the blocklist contract.

lacoop6tu (FIAT DAO) acknowledged

elnilz (FIAT DAO) disagreed with severity and commented:

Not High Risk as no funds at risk. In the scenario outlined above, a clear path to restoring user’s access to the blocked tokens exists.

Justin Goro (judge) decreased severity to Meidum and commented:

Severity downgraded.

IllIllI (warden) reviewed mitigation:

The sponsor acknowledges the possible rug vector. It is common for admin rug vectors to not be addressed.


The original report as published on Code4rena, by Respx. 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 blocklist check is applied to all token-release functions, but the blocklist contract has no way to unblock an account, so a mistaken blocklist change permanently traps already-delegated tokens.

Impact

Tokens belonging to an account that becomes blocked after delegating could become irretrievable, though the sponsor argued no funds are at risk because access can be restored.

What the attacker needed

Account has delegated tokens; blocklist is changed to mark account as blocked; account was not previously blocked

The fix

The blocklist contract should be given an unblock function so that a mistaken block can be reversed.

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 smart contract can block certain accounts from moving their tokens. This report says that if the list of blocked accounts is swapped for a new list that includes someone who had already locked up tokens, that person cannot get their tokens back because every function that would release them checks the blocklist first. The tokens are stuck unless the blocklist is replaced again.

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 Respx

View all

4 more disclosed reports, best first.

More from FIAT DAO veFDT 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.