Advanced Security #trust-boundaries #DFD #injection #least-privilege

Trust Boundaries

5 exercises — master trust boundary vocabulary: what trust boundaries are and why they matter, the crunchy-outside anti-pattern, database credential scoping, webhook signature verification, and context switching injection vulnerabilities.

0 / 5 completed
Trust boundary quick reference
  • Trust boundary — where data crosses from one trust level to another; every trust boundary crossing requires authentication, authorisation, and validation.
  • Trust levels — Internet (untrusted) → authenticated user → internal service → database. Each step up requires validation.
  • "Crunchy outside, soft inside" — anti-pattern: only validating at the perimeter. Single bypass exposes all internal services.
  • Credential scoping — separate DB users with minimum permissions per component. Frontend user ≠ admin user.
  • Webhook signatures — HMAC-SHA256 verification required even for "trusted" partners. HTTPS alone does not verify sender identity.
  • Context switching vulnerabilities — user input in SQL context → SQL injection; in HTML context → XSS; in shell → command injection. Fix: parameterise and encode for each context.
  • DFD — Data Flow Diagram. Dashed rectangles = trust boundaries. All flows crossing dashed lines need security controls.
1 / 5

A security engineer draws a system diagram and says: "I've identified several trust boundaries in this system. Can someone explain what a trust boundary is and why it matters for security design?"