TExcelTAD
Home › Ethical Hacking & Penetration Testing Methodology › Remediation Guidance and the Retest

Remediation Guidance and the Retest

A finding is only useful if it leads to a fix, and a fix is only trustworthy once someone has checked it. The last two steps of the methodology close that loop. Remediation is the client's work, but the tester's guidance decides how quickly and how well it is done: a recommendation that names the exact change, offers a stop-gap and says how to verify it gets done; "improve security" doesn't. The retest then repeats each finding's own verification, records the result with evidence, and catches the fixes that only moved the problem. This lesson covers both, with a retest you can run in your sandbox and a status model for the results.

Remediation guidance that works

Part Content Example (F-02, Jenkins console)
Fix the specific change that removes the cause enable Jenkins' security realm with the company SSO; remove anonymous read and the script console permission for non-administrators
Stop-gap what to do today if the fix takes time restrict port 8080 to the build administrators' VPN group at the firewall
Defence in depth changes that reduce the impact of the next similar bug move deployment credentials to short-lived tokens issued per job; give the deploy account only the rights it needs on db01
Detection how to notice exploitation meanwhile alert on script-console use and on new jobs or credential reads outside office hours
Verification the check that proves the fix (also the retest) an unauthenticated request to /script returns 403 and a login page; an administrator can still log in
Owner and effort (from the client) who and how long platform team, one day

Remediation guidance is advice, not an order: the client may choose another fix that removes the cause. The verification step stays the same, which is why it belongs in the finding.

Retest statuses

Status Meaning
Fixed the verification passes and the legitimate function still works
Partially fixed the original reproduction fails, but a variant still works (another endpoint, another host with the same image)
Not fixed the reproduction still works
Mitigated a compensating control (firewall rule, WAF rule) blocks the reproduction; the cause remains
Risk accepted the client decided not to fix, recorded with a named person, a date and a review date
Not retested out of the retest's scope or not reachable, with the reason

Regressions are a separate result: a fix that broke something (the owner can no longer read their own invoice) or reopened an earlier finding.

A retest in your sandbox

Two findings from the original test: F-11, the expired certificate on port 8443, and F-12, a directory listing that exposed an export file. Their verifications were written into the findings: the certificate must verify against the client's CA, and /exports/ must not list files while the shop's home page still works. The session runs the same two checks against the original state and against the state after the client's fixes, all on 127.0.0.1.

bash · try it yourself
check_cert() {   # finding F-11: the certificate on 8443 must verify against the lab CA
  code=$(openssl s_client -connect 127.0.0.1:8443 -servername "$1" -CAfile $SAMPLES/pki/ca.crt </dev/null 2>/dev/null \
         | grep -o 'Verify return code: [0-9]*.*' | head -n 1)
  case "$code" in "Verify return code: 0 (ok)") echo "F-11 PASS  $code";; *) echo "F-11 FAIL  $code";; esac
}
check_listing() {  # finding F-12: /exports/ must not list files; the shop page must still work
  ex=$(curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:8000/exports/)
  home=$(curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:8000/)
  if [ "$ex" != 200 ] && [ "$home" = 200 ]; then echo "F-12 PASS  /exports/ -> $ex, / -> $home"
  else echo "F-12 FAIL  /exports/ -> $ex, / -> $home"; fi
}
start() {  # $1 = certificate name, $2 = web root
  openssl s_server -accept 127.0.0.1:8443 -cert $SAMPLES/pki/$1.crt -key $SAMPLES/pki/$1.key -quiet >/dev/null 2>&1 &
  (cd "$2" && exec python3 -m http.server 8000 --bind 127.0.0.1 >/dev/null 2>&1) &
  for i in $(seq 50); do [ "$(ss -Htln | wc -l)" -ge 2 ] && break; sleep 0.1; done
}
mkdir -p before/exports after
printf '<title>Lab Shop</title>\n' | tee before/index.html > after/index.html
printf 'id,email\n' > before/exports/customers-2026-11.csv
echo "== original test (2026-12-03)"
start expired.lab.test before; check_cert expired.lab.test; check_listing; kill %1 %2; wait 2>/dev/null
echo "== retest (2027-01-14) after the client's fixes"
start lab.test after; check_cert lab.test; check_listing; kill %1 %2; wait 2>/dev/null
== original test (2026-12-03)
F-11 FAIL  Verify return code: 10 (certificate has expired)
F-12 FAIL  /exports/ -> 200, / -> 200
== retest (2027-01-14) after the client's fixes
F-11 PASS  Verify return code: 0 (ok)
F-12 PASS  /exports/ -> 404, / -> 200

Both checks fail on the original state and pass after the fixes, and the second check proves something a lazy retest would miss: the home page still returns 200, so the fix didn't simply take the web server down. The same script, kept with the report, becomes the client's regression test.

Recording retest results

The retest updates every finding's status, and the report gets a new version with a retest section. A small model of that update, with the variant check that catches partial fixes:

python · try it yourself
original = {"F-02": "Critical", "F-03": "High", "F-06": "High", "F-07": "Low", "F-11": "Medium", "F-12": "Medium"}
retest = {  # finding -> (original reproduction still works?, variants still work, legitimate use OK?, note)
    "F-02": (False, [], True, "login required; anonymous /script -> 403"),
    "F-03": (False, ["/api/v1/invoices/{id} (old API)"], True, "v2 fixed; legacy v1 endpoint still returns other users' invoices"),
    "F-06": (False, [], True, "Scans share restricted to HR group"),
    "F-07": (True, [], True, "upgrade scheduled for Q2; risk accepted by M. Do (CIO) on 2027-01-10, review 2027-07-01"),
    "F-11": (False, [], True, "valid certificate, expiry monitoring added"),
    "F-12": (False, [], False, "listing disabled, but the shop's product images now return 403"),
}

def status(works, variants, legit_ok, note):
    if works:
        return "risk accepted" if "risk accepted by" in note else "not fixed"
    if variants:
        return "partially fixed"
    return "fixed" if legit_ok else "fixed, REGRESSION"

counts = {}
for fid, sev in original.items():
    s = status(*retest[fid])
    counts[s] = counts.get(s, 0) + 1
    print(f"{fid} {sev:<8} {s:<18} {retest[fid][3]}")
print("\nretest summary:", ", ".join(f"{n} {s}" for s, n in sorted(counts.items(), key=lambda kv: -kv[1])))
F-02 Critical fixed              login required; anonymous /script -> 403
F-03 High     partially fixed    v2 fixed; legacy v1 endpoint still returns other users' invoices
F-06 High     fixed              Scans share restricted to HR group
F-07 Low      risk accepted      upgrade scheduled for Q2; risk accepted by M. Do (CIO) on 2027-01-10, review 2027-07-01
F-11 Medium   fixed              valid certificate, expiry monitoring added
F-12 Medium   fixed, REGRESSION  listing disabled, but the shop's product images now return 403

retest summary: 3 fixed, 1 partially fixed, 1 risk accepted, 1 fixed, REGRESSION

The retest is more than a list of passes. F-03 was fixed in the new API, but the old v1 endpoint (still used by an old mobile app, as the testing-methodology lesson found in its toy shop) has the same bug: partially fixed, and the variant becomes a line in the retest letter. F-12's listing is gone, but the fix blocked legitimate product images too: fixed with a regression, which the client needs to hear before customers do. F-07 is recorded as risk accepted, with the person, the date and the review date, so the acceptance can't silently become permanent.

How retests go wrong

  • Retesting only the exact request. Variants (other endpoints, other hosts built from the same image, other parameters) are where partial fixes hide. Check the root cause, not just the symptom.
  • Retesting long after the fix. Retest within the agreed window (often 30 to 90 days); the system has changed again by the next annual test.
  • Accepting "fixed" from the ticket system. The retest is evidence; a closed ticket is not.
  • New findings during the retest. Report them as new findings, not as retest results, and agree whether they are in the retest's scope.

How the loop is closed well

Agree the retest in the statement of work, keep each finding's verification as runnable checks (like the session above), give the client those checks so they can run them before the retest, and issue a retest letter or an updated report version that states each finding's final status with evidence and date.

Pitfalls

  • Generic remediation ("follow best practice", "harden the server"): name the setting, the file, the line.
  • Recommending products instead of fixes. A WAF rule is a mitigation; fixing the query is the remediation.
  • Forgetting the stop-gap. Some fixes take a release cycle; the client needs something for this week.
  • Risk acceptance without an owner and a review date.

Practice

  1. Write the full remediation guidance (fix, stop-gap, defence in depth, detection, verification) for F-06, the payroll scans readable by all staff.
  2. Extend the status() function so that a finding blocked only by a new WAF rule (the reproduction fails, but the vulnerable code is unchanged) is recorded as "mitigated".
Answers
  1. Fix: restrict the Scans share and folder to the HR group, and change the scanner's destination to the HR document system. Stop-gap: today, remove Domain Users from the share's permissions. Defence in depth: classify folders holding personal data, give each an owner and review access quarterly; retention rules for scanned documents. Detection: audit file access on the folder (event 5145) and alert on reads by non-HR accounts. Verification: listing \\files01\Scans with a non-HR test account is denied; an HR test account can still read it.
  2. Add a fifth field to each retest tuple, e.g. cause_removed, and return "mitigated" when the reproduction fails but cause_removed is false: if not works and not cause_removed: return "mitigated", placed before the other checks.

Test yourself

Which part of remediation guidance doubles as the retest?

  1. The stop-gap
  2. The verification step
  3. The owner field
  4. The references

The original IDOR request now fails, but the same bug works on the legacy v1 endpoint. What is the status?

  1. Fixed
  2. Partially fixed
  3. Not retested
  4. Risk accepted

The directory listing is gone, but the fix also blocks the shop's product images. How is it recorded?

  1. Not fixed
  2. Fixed, with a regression to report
  3. Mitigated
  4. Risk accepted

What must a risk acceptance include?

  1. Nothing
  2. A named person, a date and a review date
  3. The tester's signature only
  4. A CVSS score of 0