Capability-based security is an access control model in which a program can use a resource only by holding a capability, an unforgeable token that both names an object and carries the rights to use it. In OS security, the model replaces the question “who is this user and what does the list allow” with a simpler one: “does this process hold a valid reference to the object”.
The approach dates back to the work of Dennis and Van Horn in 1966 and shaped research systems such as Hydra, KeyKOS, EROS and the seL4 microkernel. Modern operating systems use it in hybrid form: file descriptors, FreeBSD Capsicum, Fuchsia handles and WebAssembly System Interface (WASI) all apply the same idea of authority carried by reference.
How capabilities grant authority
A capability works because possession equals permission: the kernel checks only that the token is genuine and that its rights include the requested operation. There is no global lookup of the caller identity against a per-object list. The token is usually an index into a kernel-protected table, so a process cannot fabricate or alter one; it can only receive capabilities from the kernel or from another process that already holds them.
Three properties define a sound capability system. Unforgeability means tokens are created only by the kernel or a trusted manager. Explicit delegation means authority moves only when one holder passes a capability to another, typically over interprocess communication. Attenuation means a holder can derive a weaker copy, for example a read-only capability from a read-write one, before passing it on.
The following table lists the core elements of a capability and what each contributes.
| Element | Role | Typical form |
|---|---|---|
| Object reference | Identifies the resource | Kernel object pointer or slot index |
| Rights mask | Limits allowed operations | Read, write, execute, grant bits |
| Protection mechanism | Prevents forging | Kernel table, tagged memory or cryptographic seal |
| Badge or label | Lets a server identify the sender | Integer attached at derivation |
Implementation styles in operating systems
Operating systems store and protect capabilities in three main ways, and the choice determines performance, revocation cost and hardware requirements. Partitioned designs keep tokens in kernel memory, tagged designs mark capabilities in hardware, and sparse designs rely on cryptography or large random values that are infeasible to guess.
| Style | Where tokens live | Examples | Main trade-off |
|---|---|---|---|
| Partitioned (kernel-held) | Kernel tables, user sees indices | seL4 CNodes, Unix file descriptors, Zircon handles | Every use needs a system call |
| Tagged hardware | Ordinary memory with a hidden tag bit | IBM System/38, CHERI on Arm Morello | Requires special processors |
| Sparse or cryptographic | Anywhere, protected by secrecy | Amoeba, macaroons, signed URLs | Tokens can leak if copied |
The seL4 microkernel is the most rigorous example: every kernel object, including memory, threads and interrupt lines, is reachable only through capabilities stored in capability nodes (CNodes), and its isolation properties have been formally verified down to the binary. CHERI extends conventional instruction sets with 128-bit capability pointers that carry bounds and permissions, so the processor itself enforces memory safety at pointer granularity.
Capabilities compared with access control lists
Capabilities and access control lists (ACLs) are two views of the same access matrix: an ACL stores the matrix by column, attached to each object, while a capability list stores it by row, attached to each subject. The practical difference lies in where authority is decided and how easily it can be narrowed for a single task.
| Aspect | Capability model | ACL model |
|---|---|---|
| Check performed | Is the token valid with this right | Is this identity on the object list |
| Granularity of subject | Per process or per reference | Per user or group |
| Delegation | Pass the token, optionally attenuated | Change the list, often needs owner rights |
| Confused deputy risk | Largely eliminated | Common when programs act for others |
| Revocation | Harder, needs indirection | Easy, edit the list |
| Auditing who can access | Must trace all holders | Read the list on the object |
The confused deputy problem shows why the distinction matters. A compiler service with write access to a billing log might be tricked into writing output there because it acts with its own identity. In a capability system the caller must hand the compiler a capability for the output file, so the service cannot use authority the caller never had. Mandatory access control and multilevel security answer different questions, namely system-wide policy and classification, and they are often layered on top of capability mechanisms.
The principle of least authority in practice
Capabilities make the principle of least authority (POLA) practical, because a component receives exactly the references it needs and nothing reachable by name alone. Ambient authority, such as opening any path the current user may read, disappears inside the sandbox. This is a stronger guarantee than privilege separation by user accounts, which still grants each account broad rights.
FreeBSD Capsicum illustrates the hybrid approach. A program opens the files and sockets it needs, restricts each descriptor with cap_rights_limit, then calls cap_enter to enter capability mode, after which global namespaces such as absolute paths are unavailable. Tools such as tcpdump, dhclient and gzip have been sandboxed this way with modest code changes.
The table below suggests where capability techniques fit best.
| Situation | Recommended approach | Reason |
|---|---|---|
| Parser handling untrusted input | Capsicum or similar capability mode | Limits damage from a parser exploit |
| High-assurance embedded system | seL4-based design | Verified isolation between components |
| Plugin or extension runtime | WASI or object-capability language | Host grants only chosen resources |
| Legacy desktop application | Descriptor passing plus OS hardening | Full redesign is rarely feasible |
Limitations and common misconceptions
Capability-based security is not free of cost, and several recurring misunderstandings lead to weak designs. The most important practical issue is revocation, which requires extra indirection because holders may have copied or delegated a token.
- Revocation needs design: systems use revoker objects, caretaker proxies or derivation trees, as seL4 does, to invalidate copies.
- Sparse tokens can leak: a bearer token stored in a log or URL grants its rights to anyone who reads it.
- Hybrid systems keep ambient authority: holding descriptors in Linux does not stop a process from opening new paths unless a sandbox removes that ability.
- Capabilities do not enforce confinement alone: preventing information flow between holders requires additional policy, which is why classic critiques focused on the *-property of multilevel security.
- Not the same as Linux capabilities: POSIX capabilities such as
CAP_NET_ADMINare coarse privilege flags attached to processes, not object references.
In everyday language
Think of a hotel key card. The door does not ask who you are; it simply opens for a valid card coded for that room. Capability-based security works the same way: a program can touch a file or device only if it holds a key that the system created for it.
Because every key is specific, a program can be given only the keys it really needs. If a hacker takes over that program, the attacker finds a small ring of keys instead of a master key to the whole building.
Seen in the real world
A security team maintaining a network monitoring appliance on FreeBSD worries about its packet-capture tool, which decodes hundreds of protocols and has a long history of parser bugs. They modify the tool so that it opens the capture device and the output file first, limits the output descriptor to write and seek rights, and then enters Capsicum capability mode before parsing a single packet.
Months later, a malformed packet triggers a memory corruption bug in one dissector. The exploit gains control of the process but cannot open files, create sockets or read credentials, because no capability for those resources exists inside the sandbox. The incident ends as a crash and a patch rather than a breach, which is the practical payoff of least authority.