Security, Privacy, and Trust in Web Systems
Trust Boundaries on the Web
Threat Modeling
Web systems operate across trust boundaries: browser, server, third-party service, user input, and external content. Security analysis begins with asset identification, attacker capabilities, and failure modes. Common threats include cross-site scripting, cross-site request forgery, injection vulnerabilities, authentication weaknesses, supply chain compromise, and insecure dependency management.
Security Building Blocks
Security Is Systemic
A secure component can still be embedded into an insecure system. Security depends on how data flows, how secrets are handled, how dependencies are updated, and how failure states are exposed.
Privacy by Design
Privacy-preserving design minimizes collection, limits retention, and makes data practices legible to users. In web applications, privacy includes tracking controls, consent architecture, data minimization, differential access, and transparent logging. Researchers are increasingly investigating privacy-preserving analytics, federated computation, and methods for reducing cross-site tracking.
What does a Content Security Policy help mitigate?
CSP can restrict where scripts and other resources may be loaded from, reducing attack surface.
Correct answer: Some forms of script injection and unwanted resource loading
What is the purpose of a CSRF token?
A CSRF token helps protect against forged requests made from an attacker-controlled site.
Correct answer: To verify that a request was intentionally made from a trusted context
Which practice best supports privacy by design?
Data minimization is a central privacy principle.
Correct answer: Collecting only the data needed for the task
Common Web Threats
Cross-Site Scripting
- Malicious script executes in a trusted origin
- Often caused by unsafe rendering or sanitization gaps
- Mitigated by encoding, sanitization, and CSP
Cross-Site Request Forgery
- Tricks a user’s browser into sending an unintended request
- Exploits ambient credentials
- Mitigated by CSRF tokens and same-site protections
Threat Modeling Workflow
-
1
Step 1: Enumerate assets, actors, and trust boundaries.
-
2
Step 2: Identify attack surfaces and data flows.
-
3
Step 3: Rank threats by impact and likelihood.
-
4
Step 4: Apply layered mitigations.
-
5
Step 5: Reassess after each architecture change.