Least Common Mechanism
You'll learn why minimizing shared resources between users is critical for preventing privilege escalation and covert channels.
What Is Least Common Mechanism?
The Least Common Mechanism principle states that you should minimize the amount of functionality and resources shared between different users or privilege levels. When users share mechanisms—like files, memory, communication channels, or system processes—vulnerabilities in those shared components can affect all users and create opportunities for attackers to escalate privileges or leak information.
Think of it like apartment buildings: if every tenant shares a single mailbox, one person could read everyone's mail. Individual mailboxes (separate mechanisms) protect privacy better than one shared mechanism.
Why This Matters
Shared mechanisms create trust dependencies you may not intend:
- Covert channels: Users can communicate through shared resources in unintended ways (timing attacks, storage-based signaling)
- Privilege escalation: A low-privilege user exploiting a shared component might affect high-privilege users
- Information leakage: Shared caches, memory, or temporary files can leak data between security contexts
- Cascade failures: A compromise in the shared mechanism affects all users simultaneously
Practical Application
Instead of:
- Single shared database connection pool for all users regardless of privilege
- Shared temporary directory accessible to all processes
- One service account for multiple applications
Prefer:
- Connection pools isolated by user role or tenant
- User-specific temporary directories with proper permissions
- Dedicated service accounts per application with minimal necessary privileges
This aligns with Separation of Privilege (lesson 2631) and Defense-in-Depth (lesson 2654)—reducing shared attack surface limits blast radius when breaches occur.
Key Takeaway: Minimize shared mechanisms between users and privilege levels; isolation prevents one user's actions from compromising another's security or privacy.