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 1 to 50 of 254
  1. Replace vulnerable regular expressions with ones that do not have overlapping or ambiguous clauses, or use a linear-time matcher.

    Seen in 31 reports
  2. Check the declared decompressed length against the gossip size limit before allocating or decompressing.

    Seen in 11 reports
  3. Resolve and validate the real target path before a privileged service or installer writes a file, and refuse to follow symbolic links.

    Seen in 9 reports
  4. Restrict access to dangerous writer and logging functions.

    Seen in 8 reports
  5. Replace backtracking-prone regular expressions with linear-time parsing or bound the input length.

    Seen in 7 reports
  6. Enforce maximum lengths and validation on message, template, name, password and avatar fields.

    Seen in 7 reports
  7. Check the declared decompressed length against the documented maximum before allocating or decompressing.

    Seen in 7 reports
  8. Validate field and size values against the received buffer length before reading.

    Seen in 7 reports
  9. Rewrite vulnerable regular expressions to avoid nested quantifiers and ambiguous repetition, or bound input length before matching.

    Seen in 5 reports
  10. Validate setter inputs so divisors and multipliers cannot be zero and fees cannot exceed the base constant.

    Seen in 5 reports
  11. Bound loops over arrays and balances or process them in batches.

    Seen in 5 reports
  12. The HID crash issues were addressed with improved bounds checks.

    Seen in 5 reports
  13. Stop fetching record data the dashboard does not render, cap record sizes and add end-of-input checks to decoders.

    Seen in 5 reports
  14. Check whether a path is a symbolic link and validate the target before writing.

    Seen in 5 reports
  15. Check return values and null pointers and free allocated memory on every error path.

    Seen in 4 reports
  16. Check pointers for null and validate buffer lengths before dereferencing or freeing.

    Seen in 4 reports
  17. Cache the described sub-call and add a depth limit to the decoder.

    Seen in 4 reports
  18. Count pending handshakes against the connection limit and defer expensive key generation until the peer has sent its first message.

    Seen in 4 reports
  19. Decode opaque inner calls with the depth-limited decoder used elsewhere and require all bytes to be consumed.

    Seen in 4 reports
  20. Validate the real target path and refuse to follow links or junctions created by low-privileged users.

    Seen in 3 reports
  21. Enforce server-side maximum lengths and character validation on usernames, phone numbers and uploaded filenames.

    Seen in 3 reports
  22. Validate and limit file read operations in JSON-RPC handlers to avoid blocking on slow streams.

    Seen in 3 reports
  23. Check buffers are allocated and avoid recursion in close paths.

    Seen in 3 reports
  24. Bound retries on deterministic reverts and re-check parent validity before submitting.

    Seen in 3 reports
  25. Reserve the one-byte derivation version prefix in the default frame-size budget and add an await point in the retry loop.

    Seen in 3 reports
  26. Verify the proof-of-work seal in the sync verifier and report failures as verification errors that carry peer identity so the peer can be penalised.

    Seen in 3 reports
  27. Do not use unverified nullifier public inputs as pool identity, or verify the proof before admission.

    Seen in 3 reports
  28. Bound the mintable share supply and reserve headroom for the next fee accrual before checked addition.

    Seen in 3 reports
  29. Treat an unrepresentable share quote as zero shares and take the rejection and refund path instead of panicking.

    Seen in 3 reports
  30. Check decoded dimensions and pixel count, not just compressed size.

    Seen in 3 reports
  31. Use safeTransfer functions that handle non-standard tokens which do not return a boolean.

    Seen in 2 reports
  32. Validate that array elements and the param field are objects of the expected type before accessing them.

    Seen in 2 reports
  33. Enforce a maximum password length before hashing the input.

    Seen in 2 reports
  34. Apply the same control character validation to document.cookie as to Set-Cookie.

    Seen in 2 reports
  35. Check length and offset fields against buffer size and release memory after negotiate.

    Seen in 2 reports
  36. Bounds-check offsets from file metadata before reading.

    Seen in 2 reports
  37. Truncate long URLs before rendering on the home screen.

    Seen in 2 reports
  38. Use call instead of transfer and handle recipients that cannot receive Ether.

    Seen in 2 reports
  39. Handle reverts inside loops and paginate view functions.

    Seen in 2 reports
  40. Allow repayment or replenishment amounts to be at most the current debt or deficit.

    Seen in 2 reports
  41. Validate bid public keys, commitments and encrypted amounts at submission.

    Seen in 2 reports
  42. Do not assume a minimum creation code size and initialise arrays returned from pause functions.

    Seen in 2 reports
  43. Make the txpool affordability check include every fee that execution will charge.

    Seen in 2 reports
  44. Reserve space for the derivation prefix byte in frame sizing and add backoff to failed frame retries.

    Seen in 2 reports
  45. Cap request body size and validate field lengths before buffering, parsing or hashing.

    Seen in 2 reports
  46. Classify the over-cap rejection as permanent so the transaction is evicted and rejection-cached.

    Seen in 2 reports
  47. Apply the same content-size validation to drafts as to published posts and do not persist a draft after an error.

    Seen in 2 reports
  48. Check claimed image dimensions and cap decode memory before handing the file to the graphics library.

    Seen in 2 reports
  49. Enforce request size limits at the HTTP server and structural limits in the payload schema.

    Seen in 2 reports