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 code cleared the expected origin timestamp before rejecting a packet with a zero origin timestamp, resetting the nonce.
Seen in 1 report
-
The code compares the return value of mint and redeem to an error constant, but those functions return the amount minted or redeemed.
Seen in 1 report
-
Medium
-
-
The code did not check that the transfer amount was greater than zero before calling safeTransfer, and some ERC20 tokens revert on zero-value transfers.
Seen in 1 report
-
The code did not check whether a string search function returned null before using the result as a pointer.
Seen in 1 report
-
The code did not check whether the authorization string was null before using it as a hash table key.
Seen in 1 report
-
The code does not check that assets to mint after the relayer fee are above zero, nor that the epoch total value locked is non-zero before the withdraw preview.
Seen in 1 report
-
The code does not check that the slope is large enough before subtracting the change.
Seen in 1 report
-
The code does not check whether a pointer returned while parsing the URI header is null before using it.
-
The code does not check whether the base64 decode returned null before using the result.
Seen in 1 report
-
The code does not check whether the number of enabled multisig wallets is zero before dividing by that count.
-
The code does not check whether the total weight is zero before dividing, so a zero total weight causes a division-by-zero revert.
Seen in 1 report
-
The code does not enforce a maximum size for the access list in typed transactions.
-
The code does not handle the broken-pipe signal, so sending to a closed socket terminates the process.
Seen in 1 report
-
The code failed to check for a null pointer before using it.
-
The code failed to check whether the memory allocation returned null before using the pointer in a copy.
Seen in 1 report
-
The code failed to verify the buffer was non-empty after removing the wrapped client key, leading to an assertion failure later.
Seen in 1 report
-
The code handling the Content-Type header does not check that a pointer is valid before using it, leading to a null dereference.
-
The code indexes into a withdrawal credentials slice without first checking its length.
Seen in 1 report
-
The code only searches locked balances to determine the withdrawal epoch and does not first check whether the sum of unlockable tokens and the contract's CVX balance already covers the requested amount.
-
The code parses the client's registered redirect URI without checking that the database field exists, and the resulting exception is uncaught.
-
The code reads the entire Chart.yaml file into memory without a size limit.
Seen in 1 report
-
The code returns early on certain EVM errors without adding consumed gas to the gas meter, and the dispatch path charges no gas upfront.
-
The code stores the round count within the current phase instead of the cumulative total across phases.
Seen in 1 report
-
The code subtracts a parsed length from the remaining packet length without checking it fits, so the subtraction wraps to a huge value used as a copy size.
Seen in 1 report
-
The code subtracts six from RDLENGTH without checking it was at least six, causing an integer underflow and out-of-bounds heap access.
Seen in 1 report
-
The code subtracts a constant from a pointer difference without checking it is large enough, producing a huge unsigned length.
Seen in 1 report
-
The code subtracts a negative change without checking that the delegatee's current votes cover the decrease.
Seen in 1 report
-
The code takes the first value from the client-controlled forwarding header instead of the source IP from the request context.
Seen in 1 report
-
The code treats all destroyed statuses alike and unconditionally deletes the account instead of handling destroyed-and-recreated by wiping storage and reinserting.
Seen in 1 report
-
The code treats the return value of the formatted print as bytes actually written, but it returns the length that would have been written.
Seen in 1 report
-
The code unconditionally adds the event name to the filtered set even when filter parsing failed, and cleanup skips removal because the matcher ID is -1.
Seen in 1 report
-
The code unconditionally calls the plugin withdrawal even when the amount or plugin balance is zero, without checking if a withdrawal was needed.
Seen in 1 report
-
The code updates lien.last to the current timestamp even for expired liens, causing a subtraction underflow when calculating the slope because end minus lien.last becomes negative.
Seen in 1 report
-
The code uses an uninitialised buffer index (initialised to 0xffff) to access packet data when an IP header error triggers an ICMP error message before the index is properly set.
Seen in 1 report
-
The code uses the bath token balance as a condition to call the max borrow function, which requires positive liquidity a new position does not have.
Seen in 1 report
-
The collateral factor doubles as an acceptance flag, so zero causes division by zero.
Seen in 1 report
-
The collateral token array has no cap and no removal mechanism, so functions that iterate over it grow in gas cost.
Seen in 1 report
-
Medium
-
-
The combined value field is not range checked before arithmetic, so a large value overflows and aborts the whole batch.
Seen in 1 report
-
The command returns early without unlocking a global semaphore when the request lacks a parameter, causing a deadlock.
Seen in 1 report
-
The commit function does not handle reverts from individual market update calls.
-
The compiler only rejects redo when there is no enclosing loop, so a redo inside a rescue body generates a backward jump to the handler's own error instruction.
Seen in 1 report
-
The compiler unwraps the memory location of constant Bytes and String variables during code generation, losing the location needed later.
Seen in 1 report
-
The complexity multiplier returns zero whenever an iid or iids argument is present.
Seen in 1 report
-
The compression offset check only prevents double indirection, not self-reference, so the name recurses infinitely.
Seen in 1 report
-
The configuration function does not properly validate or restrict access to the protobuffer message, allowing any device on the local network to change critical network settings.
Seen in 1 report
-
The confirm-change function iterates over all pending staking changes without a cap.
-
The confirmation function accepts an empty list and is callable by anyone, so an attacker can set the pending time to its maximum.
Seen in 1 report
-
The connection gater adds entries on every dial attempt but the error and success paths do not remove all of them.
-
The connection path size is not validated to be non-zero, leading to a call through a null function pointer.
-
The constructor never increases the pool's observation cardinality, leaving the default of one, which is too low for a 30-minute TWAP.