Guide

How to verify a security fix actually closed the vulnerability

Updated

Replay the attack. A fix is verified when the exact request that reproduced the vulnerability no longer returns the vulnerable response, run against the fixed build in a fresh environment, with the same accounts and the same data. A passing scanner, a green CI check or a code review are not that test.

Why a clean scan is not verification

Scanners and linters prove that a pattern is absent. Vulnerabilities usually survive that. Three cases cover most of it:

  • The check moved instead of closing. The button is hidden, the route still answers, and the attacker was never using the button.
  • One sibling route was fixed. /api/invoices/1003 is guarded and /api/invoices/1003/export is not.
  • The fix only holds for the tested role. The member role is fixed, the invited-guest role still reads the record.

Each of those passes a diff review and a rule-based scan. Each fails a replay.

The six things a real retest pins down

  1. The request. Method, path, headers, body and session. Store it verbatim, not a description of it.
  2. The identity. Which account sent it. An access-control finding needs two accounts in different tenants, or two roles in the same tenant.
  3. The vulnerable response. The status and the field that proved the bug — the other customer's invoice number, the admin JSON, the token.
  4. A fresh environment. New build, clean state, no warm cache and no leftover session from the fix attempt. A retest in the environment where you debugged the fix can pass because of the debugging.
  5. A control. If you can, run the same request against the previous build and confirm it still fails there. That separates "the fix worked" from "the test was wrong".
  6. The negative result. Write down what a fixed response looks like: which status, which body, which redirect. Otherwise "it did not come back" is the whole record.

Doing it by hand

It takes an afternoon per finding and it is worth learning once:

Replay as the other tenant
# alice holds the token; invoice 1003 belongs to bob
curl -sS -i https://staging.example.com/api/invoices/1003 \
  -H "Authorization: Bearer $ALICE_TOKEN" \
  -o fixed.txt

# same request against the pre-fix build
curl -sS -i https://staging-prev.example.com/api/invoices/1003 \
  -H "Authorization: Bearer $ALICE_TOKEN" \
  -o control.txt

diff control.txt fixed.txt

Read the status line first. A 403 or a 404 on the fixed build against a 200 on the control is the result you want. A 200 on both, with the body changed, is not fixed — it is redacted, and redaction usually means the record was still fetched and then filtered.

Putting the retest in the pipeline

  • Keep the reproduction as a script per finding, not as a document. A script reruns; a document rots.
  • Run it against the preview deployment for the pull request, not against staging. Staging drifts.
  • Fail the job on the vulnerable status code, and print the control result next to it so a broken test is obvious.
  • Retire the script only when the endpoint is gone, not when the ticket is closed.

The awkward part is not the request, it is the environment and the accounts. That is exactly what Offense automates: a disposable sandbox per run, test accounts supplied by you, the attack replayed after the fix in a clean sandbox, and the report kept outside it.

Where this stops

A retest in a sandbox proves the bug is closed in the environment you tested, with the data and configuration you gave it. It does not prove the production tenant configuration is the same. Say which environment you verified in, in the ticket, so nobody later assumes the other one.

Offense is waitlisted, so if you want to run this today, do it by hand with the commands above or with any HTTP client you already trust. The free dependency workflow in /install is a different check and does not verify application fixes.

Written by Offense Research. Correct something? Email us. Something out of date? Email imran@offenseresearch.com.