Skip to content
Business logic Audit finding Intermediate

Malicious users could set allocations to a blacklist Protocol and break the rebalancing logic

Ch_301 Follow with Met, bin2chen and 2 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2023-01-derby-judging/issues/192

Found by

Ch_301, Met, bin2chen, immeas, saidam017

Summary

game.sol pushes deltaAllocations to vaults by pushAllocationsToVaults() and it deletes all the value of the deltas

Solidity
vaults[_vaultNumber].deltaAllocationProtocol[_chainId][i] = 0;

Vulnerability Detail

Malicious users could set allocations to a blacklist Protocol. If only one of the Baskets has a non-zero value to a Protocol on blacklist receiveProtocolAllocations() will revert receiveProtocolAllocations().receiveProtocolAllocationsInt().setDeltaAllocationsInt()

Solidity
  function setDeltaAllocationsInt(uint256 _protocolNum, int256 _allocation) internal {
    require(!controller.getProtocolBlacklist(vaultNumber, _protocolNum), "Protocol on blacklist");
    deltaAllocations[_protocolNum] += _allocation;
    deltaAllocatedTokens += _allocation;
  }

and You won't be able to execute rebalance()

Impact

The guardian isn't able to restart the protocol manually. game.sol loses the value of the deltas. The whole system is down.

Code Snippet

Tool used

Manual Review

Recommendation

You should check if the Protocol on the blacklist when Game players rebalanceBasket()

Discussion

sjoerdsommen

duplicate with #168

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

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

What is known

A medium-severity business logic bug in Derby. Sherlock made it public on 10 April 2023. Found in the 13 audit contest (finding M-23), also found by 4 other wardens.

About Business logic

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

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

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 Ch_301

View all

39 more disclosed reports, best first.

More from Derby

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.