lessons/remediation.md

Lesson 17 of 18

Priority and fixes that stick

A finding only matters once it is fixed, and the fix has to address the cause, not the symptom.

Remember: Prioritise by exposure, preconditions, impact and controls. Fix the cause, add a test, then turn the lesson into a guardrail.

Two skills matter here: deciding how urgent a problem is, and writing a fix that covers the whole class of bug, not only the one endpoint you looked at.

Prioritise by context, not by score alone

  • Exposure: internet-facing, or internal only?
  • Preconditions: anonymous, any authenticated user, or an administrator?
  • Impact: money moved, personal data exposed, or availability lost?
  • Compensating controls: a WAF rule, a rate limit, active monitoring?

Fix the cause, then the class

Fix this endpoint, then remove the pattern from the codebase: a shared data-access function, a Semgrep or CodeQL rule that flags the sink, and a test that sends the attack and expects a rejection.

Pushback from engineering

Do not just say no. Explain the business risk, propose a quick fix or a compensating control, and if the owner still wants to ship, record a risk acceptance with a named owner and a deadline for the fix.

A good remediation ends with a test that fails before the fix and passes after it.

Questions to ask yourself

  1. What would make this P1 instead of P3?
  2. Which other endpoints use the same pattern?
  3. What test would fail before the fix and pass after?