Contextual output encoding by default, a strict CSP with nonces, and Trusted Types for the DOM.
Classify data, return less of it, and keep secrets out of logs, errors and client bundles.
Deny by default, check authorisation on the server for every request, centralise policy.
Phishing-resistant MFA, rate-limited login, short-lived sessions bound to the device.
Threat-model the feature: most bugs here are design gaps, not parser bugs.
Memory-safe languages for new code; fuzzing, sanitisers and exploit mitigations for the rest.
Secure defaults in code, configuration as reviewed code, continuous drift detection.
Never pass input to an interpreter; avoid native deserialisation; sandbox what must run.
Bound every resource: request size, time, recursion, decompression ratio, concurrency.
SameSite cookies, anti-CSRF tokens on state changes, and Fetch Metadata checks.
Model invariants explicitly, make state changes idempotent and atomic, test abuse cases.
Use vetted high-level libraries (AEAD, KMS), validate certificates, rotate keys.
Separate code from data at every parser boundary; normalise requests at the edge.
Authorise every object access against the caller; unguessable IDs are not a control.
Redirect only to allow-listed destinations or relative paths you construct.
Resolve-then-connect allow-lists, block metadata and internal ranges, IMDSv2.
Parameterised queries everywhere, least-privilege database users, no string-built SQL.
Canonicalise then check against a base directory; never build paths from raw input.
Frame-ancestors CSP, clear UI for security decisions, isolate cross-origin windows.
Sources: disclosed HackerOne reports as indexed by reddelexc/hackerone-reports (titles and links only; reports live on hackerone.com) · CISA KEV · FIRST EPSS · CVE List v5 · PayloadsAllTheThings (MIT). Imported 2026-11-15. Use payloads only on systems you are authorised to test.