Debugging security Without Losing Your Mind — Architecture article on security

Debugging security Without Losing Your Mind

A repeatable process for isolating the cause, with the tools that actually help. Includes a short worked example you can paste in.

Everything here assumes a single document and a single user. Both assumptions break eventually, and the resulting failures are interesting because they are the same shape as the original problem, only larger.

The thing nobody tells you about security is that the specification is short and the implementation history is not. Every behaviour you rely on was added for a reason that no longer applies to your code.

Start with the smallest thing that could possibly work. Not because it is the final answer, but because it gives you something to measure against, and measuring is how you find out whether the clever version is worth it.