Skip to content

In-depth lesson · Single-packet race attack

Typical fixes

Every point the Single-packet race attack reports back under this heading, best-backed first, each with the reports it is seen in.

Back to the lesson 1 to 28 of 28
  1. Lock the coupon row or use an atomic conditional update so only one request can mark it used.

    Seen in 4 reports
  2. Lock or restrict access to sensitive data held in memory.

    Seen in 3 reports
  3. Resolve links after the access check or prevent the target being swapped.

    Seen in 2 reports
  4. Add a database-level unique constraint on the organisation name instead of relying on a pre-check.

    Seen in 1 report
  5. Perform the at-least-one-owner check and the deletion in one atomic transaction.

    Seen in 1 report
  6. Update the attempt counter atomically so concurrent attempts cannot all read the same value.

    Seen in 1 report
  7. Use session locking or atomic database operations for email changes.

    Seen in 1 report
  8. Make the attachment count check and save a single atomic operation.

    Seen in 1 report
  9. Make the member count check and insert atomic.

    Seen in 1 report
  10. Make the user limit check and creation atomic.

    Seen in 1 report
  11. Make the already-saved check and the write atomic.

    Seen in 1 report
  12. Make the existing-review check and write atomic.

    Seen in 1 report
  13. Make the membership check and insert atomic or enforce a unique constraint.

    Seen in 1 report
  14. Make the existing-trial check and creation atomic.

    Seen in 1 report
  15. Lock or serialise the balance check and deduction.

    Seen in 1 report
  16. Lock or serialise the redemption process so a card cannot be applied twice.

    Seen in 1 report
  17. Make the eligibility check and claim-counter update atomic.

    Seen in 1 report
  18. Bind the salt to the caller so nobody else can create a well with it first.

    Seen in 1 report
  19. Validate that a transaction for a nonce came from the correct TSS address and matches expected events.

    Seen in 1 report
  20. Freeze the period-start asset checkpoint once capacity is committed.

    Seen in 1 report
  21. Add proper locking in the mux restart path so the DLCI object cannot be freed and reused.

    Seen in 1 report
  22. Reset the forced-send flag in the error-handling loop so packet length cannot underflow.

    Seen in 1 report
  23. Verify that the connecting client is the intended admin endpoint.

    Seen in 1 report
  24. Protect object lifetime so a freed object cannot be referenced by another thread.

    Seen in 1 report
  25. Protect a validated resource against change before it is used.

    Seen in 1 report
  26. Lock the checked resource so its state cannot change before use.

    Seen in 1 report
  27. Call release on the encoder before reset so destruction order cannot free frames early.

    Seen in 1 report
  28. Take an atomic snapshot or lock when reading multiple fields of shared function info during background merge.

    Seen in 1 report