§ 02 ·
The patterns that matter
The patterns that matter for application security are the ones that come up in the threat model, not the ones on a generic checklist. The OWASP ASVS (Application Security Verification Standard) is the most useful checklist because it is organised by threat, not by vulnerability type, but the value of ASVS is the conversation about which requirements apply, not the requirements themselves.
The patterns that recur most often in threat models for our clients.
Every input is untrusted. Every input is validated, normalised, and then either accepted or rejected. Validation is explicit (type, format, range, charset) and rejection is safe (no information leakage, no exception path that bypasses other controls).
Output encoding
Every output is encoded for the context in which it will be interpreted. HTML in HTML, JavaScript in JavaScript, SQL parameters as parameters. Encoding is the default; concatenation is the exception.
Authentication and authorisation
Every request is evaluated. Evaluation is per-request, with current evidence, against a documented model. The model is the application security analogue of the trust algorithm.
Session management
Sessions are first-class state. They have a lifetime, a renewal policy, an invalidation policy, and a logging policy. Defaults are documented and deviations are reviewed.
Cryptography
Cryptography handles confidentiality, integrity, and authentication. The choice of primitive, the choice of mode, the choice of key management, the choice of library: every one is a design decision. Decisions are made by someone who understands them, not by the default library.
Dependency management
The dependency surface is the largest attack surface. Every direct dependency is reviewed at adoption and at every major version bump. Every transitive dependency is tracked. The supply chain is the threat model.