Skip to content

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.

Back to the lesson 51 to 100 of 254
  1. Add recursion depth limits and stack-overrun checks to geometry parsers.

    Seen in 2 reports
  2. Bound server-supplied counts and lengths before using them as array or stack allocation sizes.

    Seen in 2 reports
  3. Check size and offset fields against buffer bounds and guard against integer overflow before allocation.

    Seen in 2 reports
  4. Limit image dimensions and total pixel count before processing.

    Seen in 2 reports
  5. Fix the removal loop so it does not skip entries and never leaves a negative descriptor in the list.

    Seen in 1 report
  6. Add a recursion depth limit and loop detection when following compression pointers.

    Seen in 1 report
  7. Enforce an overall timeout on webhook deliveries and limit the size of responses that are buffered or stored.

    Seen in 1 report
  8. Assign vault identifiers in the protocol rather than letting users choose them, or use a commit-reveal scheme.

    Seen in 1 report
  9. Include a unique salt or deployer address in the CREATE2 salt so that addresses cannot be pre-occupied.

    Seen in 1 report
  10. Do not enforce a hard maximum balance in the deposit function, or allow deposits to exceed the limit temporarily.

    Seen in 1 report
  11. Cap the size of the activeTransactionBlocks array and avoid O(n) removal loops.

    Seen in 1 report
  12. Cap the shared NFT array and provide a way to remove entries without requiring a successful transfer.

    Seen in 1 report
  13. Check for integer overflow when adding a skip length to the index in generated unmarshalling code.

    Seen in 1 report
  14. Reject non-SIP URIs in SIP headers and check for NULL scheme pointers before dereferencing.

    Seen in 1 report
  15. Validate and limit the array index provided in the multipart map.

    Seen in 1 report
  16. Validate that the tag name is a non-null string before saving it, and handle null gracefully in the front-end.

    Seen in 1 report
  17. Validate the target path when following a directory junction.

    Seen in 1 report
  18. Validate the proposal type string and reject null proposed values at creation time.

    Seen in 1 report
  19. Maintain a separate counter for the curated pool count instead of iterating over an unbounded array.

    Seen in 1 report
  20. Handle insufficient balances per protocol instead of reverting the entire batch.

    Seen in 1 report
  21. Use safeIncreaseAllowance instead of safeApprove when changing a non-zero allowance.

    Seen in 1 report
  22. Properly encode special characters in branch names when constructing URLs.

    Seen in 1 report
  23. Safely encode URL characters before storing them in the cache.

    Seen in 1 report
  24. Deploy and initialize proxy contracts in the same transaction.

    Seen in 1 report
  25. Initialize implementation contracts or disable their initializers.

    Seen in 1 report
  26. Wrap the URL constructor in a try/catch and validate leading slashes.

    Seen in 1 report
  27. Validate the Content-Length header to prevent excessive memory allocation.

    Seen in 1 report
  28. Use a keyed hash function and disallow duplicate keys in the hash table.

    Seen in 1 report
  29. Lower the rate limit threshold for the add comment endpoint.

    Seen in 1 report
  30. Properly validate uploaded file content type and content, and do not serve SVG files from user uploads.

    Seen in 1 report
  31. Do not assert that the contract's LP token balance is zero after redemption; account for donations.

    Seen in 1 report
  32. Do not assert that the contract's yield share balance is zero after a swap; account for pre-existing shares.

    Seen in 1 report
  33. Fix the race condition in Pluton syscall handling to prevent reboots.

    Seen in 1 report
  34. Scale the weight ratio consistently with the base used in the pow calculation to prevent overflow.

    Seen in 1 report
  35. Declare the array with the correct length or use a dynamic array.

    Seen in 1 report
  36. Pass the underlying token address instead of the LP token address to the router's update function.

    Seen in 1 report
  37. Set a session status on every created session and make cleanup remove sessions with unset status.

    Seen in 1 report
  38. Validate and limit filename length before file handling and URL operations.

    Seen in 1 report
  39. Enforce a limit on the actual data read, not just the declared uncompressed size.

    Seen in 1 report
  40. Do not pass user-controlled parameters to dynamic method invocation.

    Seen in 1 report
  41. Validate and cap integer values read from HTTP headers before allocating or looping.

    Seen in 1 report
  42. Verify packet length against the minimum before subtracting.

    Seen in 1 report
  43. Validate Vendor ID payloads before dereferencing pointers.

    Seen in 1 report
  44. Add access control to approve functions.

    Seen in 1 report
  45. Handle share previews that round to zero.

    Seen in 1 report
  46. Allow a previous round's price when the current round is outside the epoch window.

    Seen in 1 report
  47. Check whether the borrowed amount exceeds the cap before subtracting.

    Seen in 1 report
  48. Limit gas forwarded to receiver hooks.

    Seen in 1 report