The borrow-limit calculation only counts collateral held in the specific bathToken being borrowed against, and ignores collateral the user holds in other bathTokens. As a result, a user with existing collateral elsewhere is treated as having none, so the leverage loop under-borrows and the position is smaller than intended.
A rounding error in the leverage calculation allowed a user to request a leverage just above 1x but receive a much higher effective leverage, increasing their liquidation risk. The attacker could open a position with 1.000000000000000001x leverage and end up with 1.7x leverage.
The notifyRewardAmount function always extends the reward period by the full rewardsDuration when new rewards are added, even if a period is already ongoing. This causes rewards to be distributed over a longer time than intended, giving users smaller rewards per time.
The RubiconMarket buy function rounds down the spend amount, allowing attackers to repeatedly buy small quantities and pay less than the exact proportional cost. This can yield a risk-free profit, especially for tokens with few decimals like WBTC and GUSD, as demonstrated in tests.
The V2Migrator.migrate function withdraws bathTokenV1 tokens, which incurs a fee, and then mints bathTokenV2 tokens using the reduced amount. As a result, the user receives less value after migration than they held before.
The migration contract mints V2 tokens based on a manipulable exchange rate, allowing an attacker to borrow large amounts in the V2 pool to distort the rate and cause the victim to receive fewer V2 tokens than expected. The attacker can profit at the victim's expense when liquidity is low.
An offer created through the inherited SimpleMarket offer function is not added to the market's internal sorted or unsorted lists, so the overridden cancel function cannot find it and reverts. A user who creates an offer this way can never cancel it, leaving their funds locked in the offer.
The _matcho() function in RubiconMarket does not account for the fee when calculating the amount to match, causing a revert when a taker's order is larger than the best offer. This leads to order matching failure, preventing the taker's order from being fulfilled.
The _borrowLimit function in the Position contract uses a while loop that can iterate an excessive number of times when the collateral factor is low, potentially causing the openPosition function to become unresponsive or fail. An attacker could exploit this to disrupt the system's performance and usability.
The reward rate calculation in BathBuddy uses integer division, which can round down to zero for tokens with low decimals or short distribution periods. An attacker could exploit this to cause zero rewards to be distributed, forcing the owner to adjust parameters.
The buyAllAmount function returns the amount spent after subtracting the fee, rather than the gross amount actually spent. A caller relying on the return value would understate how much they paid, for example reporting 9,000 instead of 10,000 tokens spent.
The Position contract's _marketBuy and _marketSell functions calculate fees by dividing by 10000, while the RubiconMarket.buy function uses 100000 as the denominator. This mismatch causes users to receive fewer tokens than they are entitled to when using functions like buyAllAmountWithLeverage.
The market buy and sell functions in Position.sol incorrectly account for fees, which can lead to improper fee deductions and wrong trade execution. An attacker could potentially exploit this to cause incorrect trade amounts or fee losses.
When a user opens a new leveraged position, the contract counts collateral from previous positions when calculating how much it can borrow, so the new position can be opened with less fresh collateral and ends up closer to the liquidation threshold. An attacker (or unlucky user) could therefore be liquidated after only a small price drop.
The FeeWrapper contract forwards ETH to a target contract but has no receive or fallback function, so any ETH refunded by the target causes the whole wrapped call to revert. This prevents users from wrapping calls to contracts that normally return unspent ETH.
The Position contract calculates the repayment amount using the current borrow rate per block, which can change over time, rather than the rate that applied when the position was opened. This can cause the calculated repayment to be higher or lower than the actual amount owed, leading to excess asset being swapped or insufficient repayment.
The leveraged position opening loop borrows and swaps assets but fails to collateralize the final purchased asset, leaving it uncollateralized. This means a user's position has less collateral than expected, making it vulnerable to liquidation after a small price drop.
The BathBuddy contract inherits OpenZeppelin's Pausable but does not expose any public or external function to pause or unpause it. As a result, the protocol admin cannot pause the getReward function when needed.
The Position._marketSell function passes a minimum fill amount that excludes the fee to RubiconMarket.sellAllAmount, which compares it against a fill amount that includes the fee. This makes the slippage check ineffective, so a trade could fill at a worse price than the user intended.
The closePosition function attempts to repay the entire borrowed amount at once, which fails if the user lacks extra liquid assets because the leveraged position's collateral value is insufficient to cover the debt. An attacker could not exploit this, but users cannot close their leveraged positions without additional funds.
The short leverage position calculation is not smooth: at 1.0x and 1.7x leverage the resulting position size is identical, and at 1.3x it is smaller than at 1.0x. This could cause users to open positions different from their expectations.
The Position contract does not check whether a position has already been liquidated before letting the user add more collateral. A user who calls increaseMargin after liquidation has their new collateral locked, because closePosition always reverts when it tries to redeem the larger bath token amount.
The closePosition function attempts to close a margin position using the full original amount, ignoring any liquidation that reduced the position. An attacker could liquidate a position, after which the owner cannot close it, forcing manual recovery and risking mismanagement of other positions.
The BathBuddy reward calculation rounds down to zero when the time between reward updates is very short, so a user with a small bathToken balance earns nothing. An attacker can repeatedly call getReward to refresh the global update time, blocking rewards for small liquidity providers indefinitely.
The Position contract's internal market buy and sell helpers calculate a fee that omits the maker fee, while the underlying market charges that fee on execution. A user calling the leveraged buy function therefore receives more asset tokens than they should, taking value from other users in the protocol.
The market's stop and isClosed functions do not actually pause or close the market because the stopped flag is never used and isClosed always returns false. An attacker could continue to create offers and buy even after the owner tries to stop the market, potentially allowing funds to be lost during an emergency.
Interest owed on a borrowed position is calculated from the number of blocks elapsed rather than elapsed time, and on Optimism blocks are not produced at a constant rate. This means the interest a user repays can be higher than expected and the rate is manipulable.
The functions buyAllAmountWithLeverage and sellAllAmountWithLeverage always revert because the internal _maxBorrow function requires positive liquidity, but a newly created Position contract has zero liquidity. An attacker can transfer a tiny amount of bathToken to the Position contract to trigger the revert, preventing users from opening leveraged positions.
The CToken implementation has a first depositor bug where an attacker can inflate the exchange rate by directly transferring underlying tokens, causing subsequent depositors to receive fewer shares. This allows the attacker to steal funds from depositing users and, because only one market per underlying can be created, bricks the BathHouse.
RV
Rubicon v2
High
Instant results are busy. Press Enter to search every report.
No direct matches. Search every report above, or try a bug class like IDOR or SSRF.