In-depth lesson · Business logic
Root causes
Every point the Business logic reports back under this heading, best-backed first, each with the reports it is seen in.
-
The remaining borrowed tokens are calculated only from the amount received before the swap, ignoring leftovers when a minimum output is set.
-
The removal approval check was only enforced while the page was published, so unpublishing bypassed the consent requirement.
Seen in 1 report
-
The removal check compares the lower bits to one value while the setter writes a different value, so the check never matches.
Seen in 1 report
-
The removal code confuses two separate index arrays and fails to update the voucher index when moving the last voucher.
Seen in 1 report
-
The removal function calls the vault's remove adapter directly without submitting the call to the timelock queue.
Seen in 1 report
-
The removal function does not verify that the supplied token is part of the user's position before deleting an entry.
Seen in 1 report
-
The removal function used the add-signer action key, so the pending action check always failed.
Seen in 1 report
-
The removal helper popped the last array element instead of swapping the target with the last element.
Seen in 1 report
-
The removal logic skipped deactivated accounts while the UI still reported success.
Seen in 1 report
-
The removal logic writes to the first vouchee entry without checking whether that entry belongs to the borrower being removed.
-
The removal loop stops at length minus one, so the final element is never removed.
Seen in 1 report
-
The removal path never submitted the remove-adapter calldata to the vault, so the timelock was unset and the call reverted.
-
The removal-on-error path used the original output filename instead of the numbered file actually created.
Seen in 1 report
-
$2,400 Medium
-
-
The remove function omits clearing the by-type mapping, leaving a stale entry that blocks re-adding.
Seen in 1 report
-
The remove-liquidity function did not accept or enforce a minimum amount out.
-
The removeCollateral function updates internal state but omits the external call to transfer the collateral out.
-
The removeCollateralToken function does not check for pending withdrawals or include the withdraw queue balance in TVL for removed tokens.
Seen in 1 report
-
The renewal check uses a logical AND between two timestamp comparisons that can never both be true.
Seen in 1 report
-
The renewal flow reuses the same active-pool verification as new protection creation, which rejects pools in LateWithinGracePeriod or Late states, instead of using a renewal-specific check that permits those states.
-
The renewal logic only verified the time, token and lending contract, but failed to validate that the renewed protection amount did not exceed the original amount.
Seen in 1 report
-
The renewal logic sets the new protection's start time to block.timestamp instead of the expired protection's end time, so the grace period is not charged.
Seen in 1 report
-
The rent collection function lacked access control and did not reject future collection times.
Seen in 1 report
-
The rental order hash omits filled amounts, so partial fills collide on one storage key.
Seen in 1 report
-
The rental type flag is not checked when processing cancellations, so one cancellation path can settle another rental type.
Seen in 1 report
-
The repay function allowed a zero-amount repayment, and the full-repayment check compared zero shares to zero debt, triggering cleanup.
-
The repay function does not check the loan maturity timestamp.
-
The repay function sent tokens to the token contract address rather than the liquidizer, so the balance was never credited while the burn counter rose.
-
The repay function subtracts the full earmarked amount rather than a proportional share of the repaid debt, unlike the burn path.
Seen in 1 report
-
The repay function updates interest rates before reducing the debt balance.
Seen in 1 report
-
The repay limit calculation applied the unutilised leverage percentage incorrectly, causing an underflow when borrow balance exceeded a threshold.
Seen in 1 report
-
The repay logic reverted when the repayment amount exceeded the remaining debt instead of capping it, and the function did not restrict who may call it.
-
The repay logic uses the user-specified amount instead of the amount actually received from the swap, unlike the deposit logic.
Seen in 1 report
-
The repay validation only checks that the on-behalf address is not zero and never verifies it owns the NFT being repaid.
Seen in 1 report
-
The repayment amount is calculated from user-supplied shares without checking the position's actual debt shares.
-
The repayment check only verifies the aToken balance is at least its starting balance, which passes trivially when the same funds are returned.
-
The repayment logic subtracted the repaid amount without checking it exceeded the remaining balance.
Seen in 1 report
-
The repayment path sends tokens directly to the vault owner using safeTransferFrom, triggering the ERC777 recipient hook where a revert blocks repayment.
-
The repayment routine unconditionally updates same-chain borrow balances without checking whether the repayment was same-chain or cross-chain.
-
The replace-owner function lacked a check that the new owner is not the zero address.
Seen in 1 report
-
The replacement function does not clear the old token's entry from the index mapping.
Seen in 1 report
-
The report endpoint accepted unlimited submissions from the same account, so one attacker could reach the configured threshold.
-
The report submission endpoint enforced no rate limit or anti-automation control.
Seen in 1 report
-
The report transfer function does not check the reporter's 2FA status against the destination program's requirements.
-
The reporting function did not claim and convert pending reward tokens first, so the reported balance excluded them.
Seen in 1 report
-
The request builder passes the route's address as the setAddr target instead of checking the connected wallet equals that address.
-
The request function authorises the share owner but never checks that the named controller consented, so an owner can enqueue into an unrelated account's private queue.
-
The request function never checked that the caller could act for the named controller, and the claim and view functions only inspected the head of the queue.
-
The request functions do not verify that the caller is authorised to act as the specified controller, so anyone can create requests for any controller address.
-
The request ID is derived only from request parameters with no nonce or sender address, making it deterministic and collidable.
Seen in 1 report
-
The request signing mechanism was implemented entirely client-side, so the algorithm could be reversed and reused.
Seen in 1 report