In-depth lesson · DoS
Root causes
Every point the DoS reports back under this heading, best-backed first, each with the reports it is seen in.
-
The Content-Length value is not validated before being used in a size calculation, allowing an integer underflow that then affects a memory write.
-
The contract allows a buyout to be started with a negligible amount and prevents any concurrent buyout, so a low-value buyout locks out higher offers until it expires.
Seen in 1 report
-
The contract allows anyone to add reward tokens without restriction, and the maximum limit can be reached by adding many tokens with minimal amounts.
-
The contract allows deposits of any amount, even 1 wei, without a minimum, so an attacker can create many receipts cheaply.
-
The contract allows minting zero shares when the stake rate is low, breaking the invariant that total stakes and staked tokens are both zero or both non-zero.
Seen in 1 report
-
The contract assumes its balance only changes through its own functions, so an external transfer makes the forfeit amount exceed the declared balance.
Seen in 1 report
-
The contract attempts to request new randomness from Chainlink VRF within the same transaction as the VRF callback, violating the VRF coordinator's reentrancy guard.
-
The contract calls Chainlink's latestRoundData without error handling, so a reverting feed causes a permanent denial of service for price oracle access.
Seen in 1 report
-
The contract calls the deprecated latestRound function instead of the recommended latestRoundData, so if latestRound returns zero, subsequent arithmetic underflows.
Seen in 1 report
-
The contract caps the oracle payload at a fixed size that the required multi-signer data exceeds.
Seen in 1 report
-
The contract checks that its token balance is exactly zero after a transfer rather than checking the change in balance, so any extra tokens cause a revert.
Seen in 1 report
-
The contract does not enforce a minimum destination gas and hardcodes a relay gas value.
-
The contract does not check that the oracle price is greater than zero before using it as a denominator.
Seen in 1 report
-
Medium
-
-
The contract does not check that the remaining ETH after creator payments exceeds the minimum purchase amount before calling buyToken.
-
The contract does not check whether the token address is the special ETH placeholder before calling approve on it.
Seen in 1 report
-
The contract does not check whether the withdrawable amount is greater than zero before calling the external withdraw function, which reverts on a zero amount.
Seen in 1 report
-
The contract does not handle failed external calls inside loops, so a single revert aborts the entire batch.
Seen in 1 report
-
The contract does not limit the length of the details and image URI strings.
-
The contract does not limit the user-supplied expiration value, so adding it to the deposit timestamp can overflow.
-
The contract does not prevent totalShares from becoming zero while pendingCredit is non-zero, leading to division by zero in multiple functions.
-
The contract does not validate that the loan-to-value ratio is within safe bounds, so extreme values cause division by zero or overflow during price calculation.
-
The contract does not verify that sufficient gas remains after the inner call, so an inner out-of-gas failure is treated as a completed execution and the queued transaction is cleared.
Seen in 1 report
-
The contract enforces that new reward epochs must be strictly increasing, so any attempt to add a reward for a past epoch will revert if a later epoch has already been recorded.
Seen in 1 report
-
The contract has no upper bound on assets per order and loops over them during transfers.
Seen in 1 report
-
The contract hardcodes a gas limit of 30,000 for external calls, which may be insufficient for complex receiver logic.
Seen in 1 report
-
The contract has no maximum on shareholders, so fee distribution loops over an unbounded array.
Seen in 1 report
-
The contract iterates over an unbounded array of protections without limiting its size.
Seen in 1 report
-
The contract iterates over an unbounded per-user array on every action, and other users can inflate its length.
-
The contract lacks a function to call the manager's allowHandler method, so the handlerCan mapping is never set and the modifier always reverts.
-
The contract lets the recipient be changed at any time and does not check whether that address is blacklisted by the quote token before transferring margin during liquidation.
-
The contract loops over the entire queue, so gas cost grows with queue length.
Seen in 1 report
-
The contract recalculates the curated pool count by iterating over an unbounded array instead of maintaining a separate counter.
Seen in 1 report
-
The contract records the requested transfer amount instead of the actual balance difference, so its recorded balance can exceed the real one.
Seen in 1 report
-
The contract requires an exact equality between its asset balance and a user-supplied maximum amount, which an attacker can trivially change by sending a small amount of the asset.
Seen in 1 report
-
Medium
-
-
The contract requires exact equality with the marketplace nonce, which is incremented even for skipped contract orders.
-
The contract sends funds directly to the lender during closing, and the lender can revert the transfer.
Seen in 1 report
-
The contract sends its ETH balance to the fee burner even when no pool uses ETH, causing a require statement to fail.
Seen in 1 report
-
The contract sends funds directly to each beneficiary in a loop, so a single beneficiary that reverts on receipt causes the entire distribution transaction to fail.
Seen in 1 report
-
The contract trusts a user-supplied market address and only redeems the amount transferred, without verifying that the market is legitimate or that the redemption succeeded.
Seen in 1 report
-
The contract unconditionally attempts to transfer surplus tokens to the borrower during position closure, without handling the case where the borrower is blacklisted and the transfer reverts.
Seen in 1 report
-
The contract unconditionally repays residual debt without checking whether any debt remains.
Seen in 1 report
-
The contract uses a high gas limit for every creator recipient instead of only when a single recipient needs it, allowing multiple recipients to each consume the full limit.
Seen in 1 report
-
The contract uses a strict equality check between its balance and a caller-supplied parameter.
Seen in 1 report
-
The contract uses an assert to check that its yield share balance is zero after a swap, but does not account for pre-existing yield shares.
Seen in 1 report
-
The contract uses an exact equality check on the received token balance instead of allowing a minimum amount, so normal slippage causes reverts.
Seen in 1 report
-
The contract uses its actual token balance as an internal accounting value, which could be changed by anyone via a direct transfer.
-
The contract uses safeTransfer, which for ERC777 tokens triggers a callback the recipient can revert.
-
The contract uses a fixed-size PDA for storage and never frees space when positions are withdrawn, so repeated deposits exhaust the available space.
Seen in 1 report
-
The contract uses a high-level call that automatically copies all returned data into memory without limiting its size.
Seen in 1 report
-
The contract uses a push strategy, sending Ether to all bidders in a loop within the claim function, so a single malicious bidder can cause the entire transaction to revert.