In-depth lesson · DoS
Typical fixes
Every point the DoS reports back under this heading, best-backed first, each with the reports it is seen in.
-
Handle the case where total assets are zero while supply is non-zero, for example by burning shares on payout.
-
Return the actual weight used so unexecuted segments are refunded.
-
Require the guardian's consent before enrolling it and provide a way to release consumed slots.
-
Recycle reserve IDs when a reserve is dropped or track live reserves rather than cumulative creations.
-
Do not enable the recipient's collateral bit automatically without consent or a maximum reserve check.
Seen in 1 report
-
Paginate or bound per-user liquidation history instead of rewriting one growing vector.
Seen in 1 report
-
Enforce the maximum list size on add and preserve the invariant on remove.
Seen in 1 report
-
Cap the seizure amount to the available collateral before subtracting.
Seen in 1 report
-
Saturate the health factor to the maximum value instead of panicking on overflow.
Seen in 1 report
-
Make the transfer validation path behave consistently when called from the aToken transfer context.
Seen in 1 report
-
Account for the aggregate reward work a single liquidation can trigger when capping reward tokens.
-
Cover API paths with the access policy and add effective rate limiting at the origin.
Seen in 1 report
-
Allowlist the methods the light-client protocol may forward and bound derivation template length and junction count.
-
Block the state-building method under the safe RPC policy.
-
Keep the pool size below the per-peer gossip cache capacity or handle cache misses without overflowing the notification queue.
-
Re-validate required fields on the server and handle processing exceptions safely.
-
Range-check the expiry before converting it to a date and treat an invalid date as absent.
-
Reserve or charge the advertised tip before using it for priority.
-
Bounds-check the size before narrowing it to a signed integer.
Seen in 1 report
-
Apply the variable size check to compute shader stages as well.
Seen in 1 report
-
Confirm the loop variable is scalar before treating the loop as finite.
Seen in 1 report
-
Hold a reference or re-check the window after synchronous observer notifications.
Seen in 1 report
-
Validate dense recurrence rules on every import path and bound the number of occurrences generated.
Seen in 1 report
-
Count retained header blocks against the session memory limit.
Seen in 1 report
-
Bound the number of address records processed by resolve-any.
Seen in 1 report
-
Validate the typed array's byte length against the real buffer before use.
-
Add a correct termination condition to the NSEC type bitmap loop.
-
Chunk notification inserts and cap how many favouriters a single item can fan out to.
-
Check declared lengths against the remaining stream size and a maximum before allocating.
Seen in 1 report
-
Apply request read timeouts to QUIC streams rather than only to TCP deadlines.
Seen in 1 report
-
Enable memoisation or rewrite the grammar to avoid exponential backtracking and avoid holding a global lock during parsing.
-
Key the rate limiter on the requesting account as well as the address.
-
Verify the MAC before adding to the replay cache and give the cache an expiry.
Seen in 1 report
-
Cap the width value before allocating the output buffer.
-
Validate the client field count against the index limit before allocating stack memory.
Seen in 1 report
-
Give the file owner an override on every lock type and tie locks to the locker's account lifecycle.
-
Validate and length-limit the emoji field and strip newlines.
Seen in 1 report
-
Cap aliases per request and add query cost analysis and operation-level rate limiting.
-
Add a replay guard to the network access IPC and detach request pointers when jobs are destroyed.
Seen in 1 report
-
Use consistent size limits between parsing and reloading the cookie jar.
Seen in 1 report
-
Do not discard pending transfers whose timers have expired when they are outside the process set.
-
Limit directory recursion depth and catch recursion errors.
Seen in 1 report
-
Apply the same size limit to the encoding detection path as to other sniffing paths.
Seen in 1 report
-
Disable external entity resolution and limit entity expansion in the SVG parser.
Seen in 1 report
-
Rewrite the email regex to avoid nested or overlapping quantifiers.
-
Enforce server-side rate limits and usage quotas on the chat endpoint.
-
Remove the automatic request loop from the reset page and require user action.
Seen in 1 report
-
Reject scientific-notation strings before passing them to a big-decimal parser.
Seen in 1 report
-
Handle rendering errors around collapsed message groups and their banner gracefully.
Seen in 1 report
-
Use separate status variables for each allocation so a later success cannot mask an earlier failure.