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.
-
Lock the coupon row or use an atomic conditional update so only one request can mark it used.
Seen in 4 reports
-
Lock or restrict access to sensitive data held in memory.
Seen in 3 reports
-
Resolve links after the access check or prevent the target being swapped.
-
Add a database-level unique constraint on the organisation name instead of relying on a pre-check.
Seen in 1 report
-
Perform the at-least-one-owner check and the deletion in one atomic transaction.
Seen in 1 report
-
Update the attempt counter atomically so concurrent attempts cannot all read the same value.
Seen in 1 report
-
Use session locking or atomic database operations for email changes.
Seen in 1 report
-
Make the attachment count check and save a single atomic operation.
Seen in 1 report
-
Make the member count check and insert atomic.
Seen in 1 report
-
Make the user limit check and creation atomic.
Seen in 1 report
-
Make the already-saved check and the write atomic.
-
Make the existing-review check and write atomic.
Seen in 1 report
-
Make the membership check and insert atomic or enforce a unique constraint.
Seen in 1 report
-
Make the existing-trial check and creation atomic.
-
Lock or serialise the balance check and deduction.
Seen in 1 report
-
Lock or serialise the redemption process so a card cannot be applied twice.
Seen in 1 report
-
Make the eligibility check and claim-counter update atomic.
Seen in 1 report
-
Bind the salt to the caller so nobody else can create a well with it first.
Seen in 1 report
-
Validate that a transaction for a nonce came from the correct TSS address and matches expected events.
Seen in 1 report
-
Freeze the period-start asset checkpoint once capacity is committed.
-
Add proper locking in the mux restart path so the DLCI object cannot be freed and reused.
-
Reset the forced-send flag in the error-handling loop so packet length cannot underflow.
-
Verify that the connecting client is the intended admin endpoint.
Seen in 1 report
-
Protect object lifetime so a freed object cannot be referenced by another thread.
Seen in 1 report
-
Protect a validated resource against change before it is used.
Seen in 1 report
-
Lock the checked resource so its state cannot change before use.
Seen in 1 report
-
Call release on the encoder before reset so destruction order cannot free frames early.
Seen in 1 report
-
Take an atomic snapshot or lock when reading multiple fields of shared function info during background merge.
Seen in 1 report