Skip to content

Sherlock

Derby

Every publicly disclosed report for Derby and what kind of bugs they were.

disclosed reports
56
most reported class
Business logic
bug classes found
5
first disclosure
2023
Find Derby on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Derby chose to make public.

Business logic

Incorrect chainId comparison in xProvider

Two functions in the xProvider contract compared the destination chain ID from their parameters against the controller or game chain ID, rather than comparing the provider's own home chain. This caused calls to fail in certain chain configurations, preventing some vaults from progressing to the next stage.

Derby

Medium
Business logic

Rewards per locked token are calculated incorrectly

The protocol calculates rewards per locked token at the time new allocations are received, before the funds are deposited into providers. This means rewards are based on allocations that have not yet earned anything, leading to incorrect reward distribution.

Derby

Medium
Business logic

Vault.claim should be called before `pushTotalUnderlyingToController`

The vault's total underlying amount is pushed to the controller without first claiming earned reward tokens, so the reported balance and exchange rate omit those funds. This makes the amount sent to the controller inaccurate and the exchange rate too low.

Derby

Medium
DoS

Vault.blacklistProtocol can revert in emergency

The Vault.blacklistProtocol function attempts to withdraw all underlying balance from a protocol, which can revert if the protocol is hacked or paused, preventing the protocol from being blacklisted. This could leave the system unable to remove a compromised protocol, potentially causing operational issues.

Derby

Medium
Business logic

withdrawal request override

A withdrawal request could be overridden during the initial period when the rebalancing period is zero, because the check for an existing request passes. An attacker could call the withdrawal request function multiple times, burning their shares and losing the previous withdrawal allowance.

Derby

Medium
Business logic

Deposited funds are locked in inactive vaults

Users cannot request withdrawal of their funds from inactive vaults because the withdrawalRequest function is blocked by a modifier that only allows calls when the vault is active. An attacker could not directly exploit this, but users' funds could be locked in an inactive vault for a prolonged period if the vault receives zero allocations from gamers.

Derby

Medium
Business logic

`XProvider` forces increased relayer fees when transferring tokens cross-chain

The XProvider contract sends two separate cross-chain messages when transferring tokens and updating state, causing the caller to pay relayer fees twice. An attacker could not exploit this directly, but the guardian or rebalancing actor incurs unnecessary extra costs.

Derby

Medium
Business logic

Rebalancing can be indefinitely blocked due to ever-increasing `totalWithdrawalRequests`, causing locking of funds in vaults

The XChainController contract never resets its totalWithdrawalRequests counter between rebalancing periods, so the value accumulates over time. Once it exceeds a vault's total underlying balance, the subtraction in pushVaultAmounts underflows and reverts, blocking rebalancing indefinitely and locking funds because withdrawals only execute after a successful rebalance.

Derby

Medium
Business logic

exchangeRate is not up to date in case if vault that is off is changed to on

When a vault is switched off, its exchange rate is not updated; if later switched on, users deposit or withdraw using a stale, lower exchange rate, causing incorrect share calculations. Depositors may receive more shares and withdrawers may receive less than they should.

Derby

Medium
Business logic

IdleProvider's balanceUnderlying and calcShares outputs are misscaled by up to 10^12

The IdleProvider contract's balanceUnderlying and calcShares functions incorrectly scale their return values by using the underlying token's decimals instead of the LP token's decimals. This causes the reported balance to be overstated and the required shares to be understated by a factor of up to 10^12 for tokens like USDC and USDT, potentially leading to protocol-wide losses during rebalancing.

Derby

High
Access control

Deposit allows for stealing underlying tokens from TruefiProvider, IdleProvider, YearnProvider, BetaProvider, CompoundProvider and AaveProvider balances

The deposit functions in several provider contracts accept a user-supplied underlying token address and amount, then use the contract's own balance of that token to mint yield-bearing tokens, which are sent to the caller. An attacker can supply a fake token that reports a balance increase without actually transferring funds, causing the provider to use its own holdings of a real underlying token to mint tokens for the attacker.

Derby

High
Business logic

Vault's savedTotalUnderlying tracks withdrawn funds incorrectly

The Vault contract's pullFunds() function reduces the savedTotalUnderlying variable by the requested withdrawal amount before the actual withdrawal occurs, and even when no withdrawal is made due to the minimumPull threshold. This causes savedTotalUnderlying to be understated, leading to incorrect allocation calculations and reduced investment efficiency.

Derby

High
Race condition

Vault could `rebalance()` before funds arrive from xChainController

The vault's rebalance function could be called before cross-chain funds arrive because the feedback message and the fund transfer are processed independently and may arrive out of order. An attacker could trigger rebalancing with incomplete funds, reducing rewards.

Derby

Medium
Business logic

Manipulate Allocations from game using flashloans

A user can use flashloans to temporarily inflate their derby token balance and manipulate protocol allocations within a vault. This could direct funds into poorly performing protocols, potentially causing losses or unexpected behaviour.

Derby

Medium
DoS

`getDecimals()` always call the MainNet

The function pushVaultAmounts calls getDecimals on a vault address that may be on a different chain, causing it to revert or return wrong decimals, which breaks rebalancing logic.

Derby

Medium
Business logic

Blacklisting a protocol leads to lower allocations

Blacklisting a protocol does not decrease the totalAllocatedTokens variable, which is used to calculate new allocations. This leads to lower token allocations to protocols and lower yield.

Derby

Medium
Business logic

Did not Approve to zero first

The contract calls ERC20 approve directly on tokens such as USDT that revert when the existing allowance is not zero, so the approval step can fail. An attacker cannot exploit this directly, but legitimate transfers through the bridge could be blocked.

Derby

Medium
Business logic

Unprotected slippage tolerance can lead to user/protocol loss of funds

The rebalanceXChain() function allows any user to set the slippage tolerance for cross-chain swaps, and an attacker can front-run the transaction to set it to 100%. This could cause the protocol or users to lose funds due to unfavourable swap rates.

Derby

Medium
Business logic

Asking for `balanceOf()` in the wrong address

The sendFundsToVault function retrieves the underlying token address for a specified chain, but when the chain is Optimism (L2), it calls balanceOf on that L2 token address while the contract is on Mainnet, which is invalid. This prevents the protocol from rebalancing the vault.

Derby

Medium
Business logic

Vault.rebalance calculates rewards per locked token incorrectly

The Vault.rebalance function updates the total allocated tokens before calculating rewards, so rewards are computed using the new period's allocation instead of the previous period's. This causes rewards for all reward cycles to be incorrect.

Derby

Medium
Business logic

maxTrainingDeposit can be bypassed

The deposit function checks the sender's current balance against a maximum training deposit limit, but a user can transfer their balance to another account and then deposit from the emptied account, bypassing the limit. An attacker could deposit more than the allowed maximum during the training phase.

Derby

Medium
Business logic

YearnProvider freezes yearn tokens on partial withdrawal

The YearnProvider contract's withdraw function transfers the full requested share amount from the caller but only receives a partial underlying amount from Yearn when liquidity is insufficient, leaving the unused shares stuck on the contract. An attacker or normal user could cause protocol funds to be permanently frozen, leading to losses for many users.

Derby

High
Business logic

MainVault.rebalanceXChain doesn't check that savedTotalUnderlying >= reservedFunds

The MainVault.rebalanceXChain function does not verify that the vault retains enough funds to cover reservedFunds after sending funds cross-chain. If the vault's total underlying decreases between allocation and rebalance, the vault may send all its funds, leaving nothing to cover reserved withdrawals.

Derby

Medium