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 removal handlers do not validate that the amount is non-negative, and coin creation panics on negative amounts.
-
The removal loop decremented the list length before comparing it with the loop counter, so with several closed sockets not all were removed and one with a negative descriptor stayed in the list.
Seen in 1 report
-
The removal swaps the last feeder into the removed slot and pops the array but does not update the position map for the moved feeder.
Seen in 1 report
-
The removeAddress function used delete instead of properly removing an array element, leaving a zero address in the array.
Seen in 1 report
-
The removePlugin function requires the plugin to report itself as deactivated, which a malicious plugin can refuse to do.
Seen in 1 report
-
The renderer does not limit diagram complexity, so repeated nodes and long labels cause excessive computation.
Seen in 1 report
-
The rendering logic did not guard against an object referencing itself.
-
The repay function decreased total debt without guarding against underflow and allowed repaying more than a borrower owed.
Seen in 1 report
-
The repay function subtracted the full amount from the debt without checking for underflow.
Seen in 1 report
-
The report view fetched and rendered all comments in one request without pagination or size limits.
Seen in 1 report
-
The request decider does not handle multiple withdrawal requests from one transaction, causing a database foreign key violation.
-
The request handler copied the URI into a fixed-size buffer without checking its length.
Seen in 1 report
-
The request handler read a cookie value with a line-reading call without bounds or termination handling, blocking indefinitely.
Seen in 1 report
-
The request-handling code used a hash table with a predictable hash function and no protection against many keys colliding in the same bucket.
Seen in 1 report
-
The required amount is derived from a balance anyone can increase.
Seen in 1 report
-
The requirement compares the full proposal bid to the remaining pool amount instead of the current milestone amount.
Seen in 1 report
-
The reserve ID counter is never decremented or recycled when a reserve is dropped.
-
The reserve update calls the external pool without a try-catch, so any revert blocks all minting and redemption.
-
The reserves lookup does not check whether the category's submodule reserves selector is empty before calling it on each submodule.
-
The reset check compared equality against the list length instead of greater-or-equal, so a stale index was never reset.
Seen in 1 report
-
The reset password form and its back-end lacked any maximum length validation on the new password field.
Seen in 1 report
-
The resolution function required the caller-supplied task count to equal the current task count, so any task added during the dispute window made resolution revert.
Seen in 1 report
-
The resolve-any path aborts the process when a response carries more than 256 address records.
Seen in 1 report
-
The resolver processes array inputs synchronously without array size limits or query cost analysis.
-
The response object does not listen for the socket close event, so it never completes when the socket is destroyed.
-
The response parser dereferences the result of a string lookup without a null check.
Seen in 1 report
-
The response parser expanded UID-set ranges into arrays without limiting the expanded size.
Seen in 1 report
-
The response size limit is enforced only after full serialisation and large batches are allowed by default.
-
The restrict list functions did not check whether the packet helper returned null when the sequence number reached its maximum.
-
The restrict list was traversed recursively instead of iteratively.
-
The resubscribe goroutine exits when the inner subscription ends, so a later unsubscribe write to the unblock channel blocks forever.
Seen in 1 report
-
The retrieval function lacked limits on the number of digests and had no timeouts.
Seen in 1 report
-
The retrieve function passed the proxy target address instead of the actual Sablier lockup stream address as the lockup parameter to withdrawMax.
Seen in 1 report
-
The retry helper treats every failed transaction as transient, so a permanent revert never sets the completion flag.
-
The retry-after value is parsed and passed to a sleep call without an upper bound.
Seen in 1 report
-
The return value of the header parser was not checked, leaving stale values from a previous message in use.
Seen in 1 report
-
The return value of the thread attribute call is not checked before destroying the attribute.
-
The return value of the user buffer copy was checked with a test that treated the zero-length error pointer as valid.
-
The revert-message helper decodes attacker-controlled bytes without checking the declared string length against the actual data bounds.
Seen in 1 report
-
The revert-message parser decodes attacker-controlled bytes without validating offset and length fields, so malformed encoding makes the decode revert.
-
The reward calculation divides by the reward tracker's total supply without checking for zero.
-
The reward calculation does not cap the user's reward at the remaining unclaimed incentive amount, so the subtraction underflows.
-
The reward calculation does not handle a zero debt to offset, causing an underflow when subtracting a stored loss error from zero.
-
The reward calculation uses the landlord's last update time instead of the user's last toil time, causing an underflow when the plot is invalidated.
Seen in 1 report
-
The reward deposit reverts when the deposited token is not the reward token and total shares is zero.
Seen in 1 report
-
The reward distribution uses a push model, transferring tokens during every balance update, so a failing token transfer reverts the entire transaction including liquidation.
Seen in 1 report
-
The reward pool bundled all reward tokens into a single claim loop, so if any one reward token had pausable transfers and was paused, the entire claim or withdrawal reverted.
Seen in 1 report
-
The reward token list was unbounded and could not be shortened, so iterating over it in the updateReward modifier could exceed the block gas limit.
-
The reward transfer function did not cap the reward amount by the contract's current token balance, so a full withdrawal left it unable to pay and caused a revert.
Seen in 1 report
-
The ring buffer code loops forever when the buffer is full, causing a watchdog reset.
Seen in 1 report