Cracking the code to secure software
summary
Explains three concrete design patterns that remove classes of security bugs: use Domain Primitives (e.g. a PhoneNumber type) to reject XSS payloads, use Entity Snapshots to make mutable orders immutable for reads and scale availability, and use a one-time subject to detect accidental leaks by throwing when sensitive values are reused. Illustrates with a real retailer bug where sending quantity = -1 became a long‑running fraud vector, and shows these patterns tighten invariants and reduce attack surface.
AI-written summary · about
chapters (27)
- 0:00Start
- 1:04What's Cracking the Code... all about?
- 3:53Case 1: Cross Site Scripting (XSS)
- 4:23Stored XSS
- 4:48Reflective XSS
- 5:37Technical Analysis
- 6:11Technical Solution
- 7:09Case 2: Buying -1 books
- 9:32But Quantity isn't an integer....
- 12:27Quantity as a Domain Primitive
- 13:45Invalid quantities are rejected
- 14:11Domain Primitives tighten your design
- 14:59We want to prevent invalid phone numbers...
- 16:36Use a Domain Primitive Instead
- 17:45Domain Primitives prevent XSS
- 21:47What we'll cover today
- 22:58CIA
- 24:50Availability and Mutable State
- 25:52Design Stereotypes in DDD
- 27:40How should we represent an Order?
- 28:51Entity Snapshots
- 30:26Order as an Entity Snapshot
- 34:10Accidental Leakage
- 35:28Evolving domain model
- 37:23Read-once Object
- 40:05Summary
- 42:12QA
