Skip to content

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.

Back to the lesson 5,101 to 5,150 of 5,700
  1. The supply exchange price was multiplied by an amplified rate that was only correct at the initial price, so the price compounded on an already-grown value.

    Seen in 1 report
  2. The supply function did not add the market to the user's account, so the collateral was ignored during borrow checks.

    Seen in 1 report
  3. The supply function read the exchange rate before accruing interest, so it used a stale value.

    Seen in 1 report
  4. The support form accepted an email address from the client without verifying the requester owned that account, and deletion requests were processed without an ownership check.

    Seen in 1 report
  5. The support reference ID was predictable, based on organisation and case ID, and not sufficiently random.

    Seen in 1 report
  6. The support workflow for username changes did not verify the request came from the account's registered email and did not notify the original address.

    Seen in 1 report
  7. The support workflow trusted an email address supplied in an unauthenticated chat without verifying ownership before deleting the account.

    Seen in 1 report
  8. The survival ratio divided two exponentials of the weight instead of exponentiating the weight delta, so it could underflow to zero.

    Seen in 1 report
  9. The swap call used the original transfer amount instead of the amount actually received after the fee.

    Seen in 1 report
  10. The swap calls during position decrease passed a minimum output amount of zero and the final output was not checked against the user's requested minimum.

    Seen in 1 report
  11. The swap compared the actual balance including accrued fees against a reserve that excluded them.

    Seen in 1 report
  12. The swap computed adjusted balances with a fee formula but never transferred or deducted the fee.

    Seen in 1 report
  13. The swap deadline was hardcoded to the current block timestamp instead of being supplied by the user.

    Seen in 1 report
  14. The swap denominator grew faster than the numerator once the input exceeded the reserve.

    Seen in 1 report
  15. The swap fee was calculated on the cash amount out rather than on the amount out divided by one minus the fee.

    Seen in 1 report
  16. The swap fee was not charged to the depositor but spread across all vault users.

    Seen in 1 report
  17. The swap function did not check that the two base tokens differed, and the price update used cached state, causing drift on a self-swap.

    Seen in 1 report
  18. The swap function hardcoded the minimum output amount to zero, removing slippage protection.

    Seen in 1 report
  19. The swap function performed an arbitrary call to a router address supplied by the executor without validating it.

    Seen in 1 report
  20. The swap function required the new token not to already exist, but anyone could add a whitelisted token to the rewards array via notifyRewardAmount.

    Seen in 1 report
  21. The swap helper derived its minimum output from a single contract-wide slippage setting rather than a per-call user-supplied limit.

    Seen in 1 report
  22. The swap maths returned the selected target bin position even when output rounded to zero, so the cursor advanced while balances, fees and deltas stayed at zero.

    Seen in 1 report
  23. The swap output amount was used as the loan amount without subtracting the flash loan fee, so the loan plus fee exceeded what was available to repay.

    Seen in 1 report
  24. The swap path always included WETH as an intermediate hop even when the input or output was already WETH.

    Seen in 1 report
  25. The swap path minted and marked collateral without calling the reserve-count and minimum-first-deposit checks that supply and borrow perform.

    Seen in 1 report
  26. The swap price limit was set to the absolute extreme, so the swap could consume all liquidity and leave unused ETH with no refund path.

    Seen in 1 report
  27. The swap priced one token as fixed at one dollar while using the other token's oracle price.

    Seen in 1 report
  28. The swap used the maximum price limit and enforced no minimum output amount.

    Seen in 1 report
  29. The swap validation was called unconditionally even when the input amount was zero and no swap would occur.

    Seen in 1 report
  30. The swap was called without a minimum output amount, so the contract accepted any exchange rate.

    Seen in 1 report
  31. The sync function recomputed an account's locked collateral but failed to update the global total-locked variable.

    Seen in 1 report
  32. The sync function updated reserves without minting or burning LP tokens, breaking the invariant between reserves and total supply.

    Seen in 1 report
  33. The sync functions never wrote the newly calculated price back to the stored previous price array.

    Seen in 1 report
  34. The synth mint and burn exchange rate was read straight from pool reserves, which a single transaction could move.

    Seen in 1 report
  35. The synthetic cross price used floor division of two 8-decimal oracle prices, truncating a small true ratio to a tiny integer.

    Seen in 1 report
  36. The system aborted the cross-chain transaction when the revert transaction failed, with no fallback to return funds.

    Seen in 1 report
  37. The system allowed removal of all emails from an account without preventing the last email from being deleted, while registration checks still saw the email as taken.

    Seen in 1 report
  38. The system contracts did not increment the deployment nonce of a newly created contract before its constructor ran, as required by EIP-161.

    Seen in 1 report
  39. The system did not block usernames that correspond to reserved RFC2142 email addresses, allowing users to claim them.

    Seen in 1 report
  40. The system did not check for username conflicts when generating usernames from email addresses during OAuth sign-up.

    Seen in 1 report
  41. The system did not handle the case where a user is blocked by an event admin after being invited, leaving the RSVP stuck.

    Seen in 1 report
  42. The system only supported username-based login and the password reset email did not remind the user of their username, leaving no recovery path.

    Seen in 1 report
  43. The system retried failed webhook deliveries and sent a notification for each failure without rate-limiting or deduplicating the alerts.

    Seen in 1 report
  44. The tag removal logic for page reviews errored when the tagged user tried to remove themselves.

    Seen in 1 report
  45. The take and bucketTake result structures never assigned the borrower's remaining collateral before returning.

    Seen in 1 report
  46. The take function truncated fractional collateral without adjusting the debt paid.

    Seen in 1 report
  47. The takeover function validated only the token amount and not the virtual or reserved Ether, so the cost of takeover could be bypassed.

    Seen in 1 report
  48. The tally read live token balances at processing time rather than a snapshot taken when the epoch ended.

    Seen in 1 report
  49. The target raise did not reset the auction start time, so price curves continued from where they left off.

    Seen in 1 report
  50. The target utilisation was an unweighted average collateralisation ratio, so one borrower with negligible debt could skew the rate.

    Seen in 1 report