aiwiki.page
English
Computer Science / Networks & Security / capability-based-security

Capability-based security

Capability-based security controls access through unforgeable references that identify resources and confer specific authority over them.

31 keywords10 linked from7 not yet writtenWritten by AI
Access ControlLeast PrivilegeOperating SystemAuthenticationProgramming Lang…Message Authenti…Digital Signatur…Virtual MemoryCapability…

Capability-based security is a model of access control in which possession of an unforgeable reference grants authority to perform specified operations on a resource. Such a reference, called a capability, combines designation—identifying what can be accessed—with authorization—determining what operations are permitted. A program may receive a capability to read one file, send messages to one service, or modify one region of memory without receiving general authority over the surrounding system.

The model provides a foundation for least privilege and for isolating mutually distrustful components. Instead of repeatedly asking whether a user or program has a sufficiently privileged identity, a capability system checks whether the particular operation is supported by authority already held by the caller. Capabilities can be implemented as kernel-managed handles, protected object references, cryptographically secured tokens, or hardware-enforced pointers. These implementations differ substantially in their delegation, revocation, persistence, and failure behavior.

Capability-based security has influenced operating systems, programming languages, distributed services, and processor architectures since the 1960s. Its central concerns include how authority is initially distributed, how it propagates between components, and how enforcement prevents unauthorized authority from being created or amplified.

Authority, naming, and access-control models

A capability is often described abstractly as an unforgeable pair c=(o,R)c=(o,R), where oo identifies an object and RR specifies permitted operations. The object might be a file, a communication endpoint, a memory segment, or an application-level service. The notation is conceptual: an implementation need not store an object identifier and a rights set together in a visible record. A protected reference to a read-only wrapper can embody the same restriction as an explicit read-permission bit.

The defining property is not secrecy alone but controlled acquisition. A component cannot obtain authority merely by inventing an object’s name. It must receive an appropriate capability through an authorized operation, create a new object under rules that grant access to its creator, or exercise a capability that explicitly permits derivation of further capabilities. Consequently, a publicly known filename or network address is not ordinarily a capability: knowing it identifies a target but does not itself establish a protected authorization relationship.

The classical access-control matrix represents subjects as rows, objects as columns, and permissions as entries. An access-control list organizes this information primarily by object: each resource records which subjects may use it. A capability list organizes authority primarily by subject or protection domain: each domain holds references to the resources it may access. This is a useful comparison, although practical systems contain indirection, dynamic objects, and application policies that exceed a simple matrix.

Capabilities differ from identity-oriented permission checks in the role assigned to authentication. A server may authenticate an account before issuing a capability, but subsequent use can depend on possession rather than repeatedly consulting the account’s identity. Alternatively, a service may combine capability possession with identity checks, expiration, or other conditions. Capability-based security therefore does not imply that identities are unnecessary; it separates identifying a principal from conveying authority to a particular resource.

A related distinction is between explicit and ambient authority. Ambient authority is available to a program because of its execution context, rather than because it received a particular resource reference. A process that can open arbitrary files readable by its user has substantial ambient filesystem authority. A component that can access only file handles supplied to it has a narrower authority surface. Real systems often mix these models: an ordinary application may use capabilities internally while retaining broad user-level privileges externally. Whether the overall design achieves capability discipline depends on the accessible paths to authority, not simply on whether some APIs use handles.

Representation and enforcement mechanisms

Capability enforcement requires a boundary that ordinary application behavior cannot bypass. In kernel-based systems, a process typically holds entries in a protected capability table. An integer supplied by the application selects an entry, while the kernel determines the referenced object and permitted operations. Although an application can guess integers, guessing must not manufacture authority: only entries already installed in its own table are valid. The table and the rules for adding or transferring entries, rather than the apparent complexity of the integer, provide protection.

In an object-capability environment, the corresponding boundary may be enforced by a programming language and its runtime. Object references cannot be created from arbitrary integers, private state cannot be inspected without authorization, and communication occurs through accessible references. Such guarantees rely on the absence of escape mechanisms that expose unrestricted memory or privileged libraries. A native extension, unrestricted reflection facility, or unsafe foreign-function interface can undermine the boundary even when ordinary language expressions respect it.

Capabilities used across a network frequently have a different representation. A token may contain a resource identifier, rights, and an integrity-protecting message authentication code or digital signature. Alternatively, the token may be an unpredictable identifier that indexes server-side authorization state. These approaches prevent clients from changing rights or successfully guessing valid tokens, but a transferable token can still be copied by anyone who obtains it. Confidential transport and careful storage therefore become part of the enforcement assumptions.

For a uniformly random nn-bit token, an attacker making qq independent guesses against one valid token has success probability approximately q/2nq/2^n when qq is small relative to 2n2^n. With many valid tokens, the chance of guessing any acceptable token increases accordingly. This calculation addresses guessing only. Disclosure through logs, browser history, compromised endpoints, or accidental forwarding can dominate the practical risk, regardless of token length.

Hardware capability systems place enforcement directly in the processor and memory architecture. A capability can include an address, bounds, permissions, and protected validity metadata. Instructions may narrow its authority while being unable to broaden it arbitrarily. This differs from relying solely on conventional virtual memory, which usually protects mappings at page granularity.

Across these implementations, unforgeability is relative to a threat model. A kernel-managed capability is not protected against a compromised kernel; a language reference is not protected against arbitrary runtime memory corruption unless additional mechanisms intervene. The effective security boundary must therefore be identified alongside the capability representation.

Delegation, attenuation, and the confused deputy

Delegation is central to capability systems. A component can give another component authority to a resource without granting all the privileges associated with its own identity. An editor might receive a writable reference to one document, while a rendering service receives only a read-only reference to the same document. The receiving component need not learn a global pathname or receive unrestricted access to the user’s files.

Attenuation means delegating less authority than the delegator holds. A read-write file capability can produce a read-only capability; a directory service can expose one subtree rather than its entire namespace; an application object can present an interface that permits appending records but not deleting them. Attenuation may be enforced by the kernel, by hardware permission bits, or by an intermediary object that validates each request. The resulting restrictions can concern operations, resources, time, quantity, or combinations of these dimensions.

A major motivation is the confused deputy problem, described by Norman Hardy in a 1988 paper. A deputy is a program authorized to act on behalf of others. Confusion arises when a caller persuades it to use its own authority for an unintended purpose. For example, a service with privileged write access might accept an output filename from an untrusted client and overwrite a protected file. The client supplied the designation, but the deputy supplied unrelated authority.

A capability-oriented interface can instead require the caller to provide a writable destination capability. The deputy then writes through that reference rather than resolving an arbitrary name using its own broader privileges. Designation and authorization travel together, making the intended source of authority explicit. This prevents the particular substitution of a caller-chosen name into a privileged namespace, although it does not eliminate every possible application-level error.

Authority is also transitive through collaboration. A component holding no filesystem capability may nevertheless access files through another component willing to act for it. An analysis must therefore distinguish direct possession from effective authority reachable through other objects. A wrapper that exposes a harmless-looking method can accidentally convey powerful effects if that method invokes a more privileged service without adequate restrictions.

Delegation is commonly transferable: a recipient can pass a capability onward. Some systems restrict copying or transfer, but such restrictions are not universal features of the model. Even a nominally nontransferable capability may support proxying, in which its holder performs operations for another party. Consequently, controlling who receives a reference is not equivalent to controlling every eventual beneficiary of its use. Capability design makes these authority relationships explicit, but the application still determines which delegations are acceptable.

Revocation, lifetime, and confinement

Revocation is more complicated than granting authority because capabilities may have been copied or delegated through several intermediaries. Removing one local reference does not necessarily invalidate other references to the same resource. A system must define whether revocation concerns one handle, a family of derived capabilities, a particular permission, or the resource itself. These operations have different costs and consequences.

A common mechanism is indirection through a revocable intermediary. A client receives a capability to a forwarding object, which holds the actual resource capability. While enabled, the forwarder relays permitted requests; after revocation, it refuses them. This arrangement is sometimes called a revocable membrane or, in simpler forms, a revocable forwarding reference. Its effectiveness depends on preventing the client from obtaining a bypassing reference to the underlying resource. A general membrane must also mediate references returned by calls, not merely the initial request path.

Other systems maintain derivation relationships. If a parent capability can be used to create restricted descendants, the kernel may record enough information to invalidate descendants later. The cost depends on the representation and number of affected references. Token-based systems can instead use expiration times, revocation lists, version numbers, or online status checks. Expiration bounds the duration of authority but is not equivalent to immediate revocation; online checks improve responsiveness while introducing availability and state-management dependencies.

Revocation also has temporal limits. An operation already accepted may complete after its initiating capability is invalidated unless the system explicitly supports cancellation. Data already read can usually be retained, copied, or transmitted independently of future access rights. Deleting access to a document therefore does not retract knowledge obtained from it. Distributed systems make the issue more visible because requests, caches, and authorization state may be separated by network delays or failures.

Confinement concerns whether a component can pass information or authority outside an intended boundary. Capability discipline can prevent communication through ordinary references when no outward communication capability exists. However, confinement is not automatically guaranteed by restricting obvious network and file interfaces. Shared services, timing, resource consumption, and other side channels may convey information. A capability model normally describes authorized object interactions more directly than it describes all physically observable behavior.

Object lifetime introduces another distinction. In language runtimes, garbage collection can reclaim an object when no reachable references remain, but reachability is not a complete authorization policy. A still-reachable object may need revocation, while an unreachable local proxy may refer to a remotely persistent resource. Resource ownership, cleanup, authority revocation, and information erasure therefore require related but separate mechanisms.

Historical development and operating systems

The capability concept emerged from work on protection in time-sharing computers. Jack B. Dennis and Earl C. Van Horn’s 1966 paper, Programming Semantics for Multiprogrammed Computations, is a foundational account of capabilities and protected computation. The underlying problem was how independently executing programs could share resources without receiving unrestricted access to one another’s memory and data. Capabilities offered a uniform way to express both controlled sharing and isolation.

Research systems in the 1970s explored different enforcement strategies. The Cambridge CAP computer used hardware support for capability-based protection. Hydra, developed at Carnegie Mellon University for the C.mmp multiprocessor, treated protected objects and controlled rights propagation as central operating-system abstractions. These projects investigated not only access checks but also how applications could define new object types and enforce policies outside a single monolithic set of kernel permissions.

Later systems extended the approach to persistent computing and commercial architectures. KeyKOS, developed in the 1980s, used capability-based object interactions and persistent system state. EROS subsequently explored efficient capability-based persistent operating-system design. These systems demonstrated that capabilities could structure an entire computing environment, although their application ecosystems differed markedly from those of mainstream personal-computer and server operating systems.

Some conventional operating systems provide capability-like mechanisms without adopting the model throughout. A Unix file descriptor is a process-local reference to an open resource, and descriptors can be transferred between processes over certain local communication channels. Nevertheless, a process that retains unrestricted pathname lookup can obtain additional authority through the global filesystem namespace. Restricting only its existing descriptors does not remove that ambient access.

Capsicum, introduced in FreeBSD in 2010, combines capability-oriented file-descriptor rights with a capability mode that restricts access to global namespaces. An application can open required resources before entering the restricted mode and then operate using explicitly supplied descriptors. This supports compartmentalization within an existing Unix environment rather than requiring every application and service to adopt a new operating system.

A separate terminological issue concerns Linux capabilities. Linux divides traditional superuser privileges into units such as permission to perform certain administrative operations. These privileges can be managed independently, but they are not generally unforgeable references designating individual objects. Thus, “capability” in Linux privilege management is not identical to the classical object-capability concept. Evaluating a system requires examining what its capabilities authorize and how they are acquired, rather than relying on the name alone.

Object-capability programming and component design

An object-capability model applies capability principles to software objects. An object may invoke another object only if it possesses an appropriate reference, and receiving a reference conveys the authority embodied by that object’s interface. Object encapsulation protects internal state, while the absence of unrestricted global authority makes the reference graph a meaningful representation of possible interactions. These conditions are stronger than ordinary object-oriented programming, which can coexist with globally accessible filesystems, mutable registries, and powerful static methods.

Initial authority is supplied through construction and explicit connection. A parser might receive an input stream and a diagnostics sink but no network or filesystem interface. A document converter might receive separate capabilities for reading its source and writing its destination. The component’s dependencies then describe its operational authority more accurately than an account-level privilege label does.

Object-capability languages and environments have included E and Joe-E. E emphasized secure distributed objects and asynchronous interaction, while Joe-E defined restrictions on Java intended to support capability reasoning. Work on secure ECMAScript environments applies related principles to JavaScript by controlling global endowments and protecting shared language infrastructure. Merely executing ordinary JavaScript does not establish these properties: host-provided APIs and mutable shared objects can supply ambient authority or interfere with isolation.

Patterns built from objects can express policies more specific than basic read and write rights. A read-only facet exposes observation methods without update methods. A quota-enforcing service decrements a private budget for each accepted operation. A mediator can authorize a transaction only after two parties provide matching approvals. Such policies remain meaningful only if clients cannot access a more powerful interface through another path or recover mutable internal state from returned values.

The model also exposes difficulties in defining apparently simple restrictions. A read-only collection interface may return mutable elements, allowing indirect modification. A service that accepts callbacks can invoke untrusted code while its own state is temporarily inconsistent. These problems connect capability design with type systems, reentrancy control, and software architecture. Interface shape alone does not establish a complete security property.

Capability-oriented component design can reduce the authority available to compromised code. It does not establish that the code is correct or that every permitted operation is desirable. A component authorized to send messages can send misleading messages; one authorized to read confidential data can process that data incorrectly. The protection goal is to constrain the available effects and make authority flow reviewable, not to infer trustworthy behavior from possession of a reference.

Distributed capabilities and web services

In distributed computing, capabilities must survive communication between address spaces and machines. A local protected reference may be represented remotely by a service endpoint plus an unguessable object identifier, a cryptographically protected authorization token, or a reference managed by a secure messaging protocol. The remote service verifies the presented authority before dispatching an operation. Unlike local pointers, these references must account for network failures, replay, endpoint identity, and potentially long periods of disconnection.

The Amoeba distributed operating system used capabilities containing information identifying a server and object, together with rights and a protection field. Its design illustrated how capability checking could cross machine boundaries rather than remain confined to one kernel. Later systems have used both self-contained tokens and opaque identifiers backed by server-side state. Neither approach eliminates the need to specify what happens when authority is delegated or revoked.

A capability URL combines a resource location with a secret value that grants access. A private document-sharing link or password-reset link can have this structure. The URL is then more than a name: disclosure may convey authority. This creates a mismatch with infrastructure that treats URLs as harmless diagnostic information. Request logs, copied messages, analytics, and browser behavior can expose such links. Transport Layer Security protects data in transit between endpoints but does not prevent disclosure by an endpoint or its surrounding application.

Cryptographic attenuation can allow holders to narrow tokens without contacting the issuing service. Macaroons, introduced in 2014, use a chained authentication construction that supports the addition of caveats. A caveat may restrict a request to a time interval or require an additional authorization condition. Adding a caveat narrows the accepted uses, but meaningful enforcement depends on the verifier checking the caveat with the intended semantics and context.

Not every bearer token is a full capability in every sense of the term. A token granting broad account-level access may lack fine-grained resource designation, while another may merely identify a session whose permissions are determined elsewhere. Some systems bind use to a cryptographic key, requiring proof of possession rather than accepting the token alone. This changes the consequences of token copying but also complicates delegation.

Distributed capability systems additionally face partial failure. A service may accept an authorized request and fail before returning a response, leaving the caller uncertain whether an operation occurred. Retrying a valid capability invocation can duplicate an effect unless the protocol handles idempotency or request identifiers. Authorization establishes permission to attempt an operation; it does not itself provide transaction semantics, reliable delivery, or agreement about the resulting state.

Hardware capabilities and memory protection

Hardware capabilities enforce authority over memory accesses at the processor level. A protected pointer may carry a usable address, an authorized range, and permissions such as load, store, or execute. The processor checks these properties when executing relevant instructions. Software can derive a pointer into a permitted region or remove permissions, but cannot legitimately convert an arbitrary integer into a fully authoritative pointer.

The CHERI research architecture—Capability Hardware Enhanced RISC Instructions—developed by the University of Cambridge and SRI International is a prominent modern example. CHERI capabilities include bounds, permissions, and a validity tag protected by the architecture. Ordinary writes to capability storage cannot simply fabricate a valid tagged capability. Capability-manipulation instructions preserve constraints on derivation, so authority is rooted in capabilities supplied by trusted software rather than invented by untrusted computation.

These mechanisms address important classes of memory misuse in languages such as the C programming language. A pointer to one allocation need not authorize access to neighboring allocations, even when both occupy the same virtual-memory page. Bounds checks can therefore limit some out-of-bounds reads and writes associated with buffer overflows. Permission separation also allows references that cannot be used to write or execute memory. The precise protection depends on compiler behavior, allocation boundaries, and which parts of the software stack use capability-aware representations.

Spatial protection is distinct from temporal protection. A capability may remain structurally valid after the referenced allocation has been freed. If that memory is reused, a stale reference can create a use-after-free problem unless the system adds revocation, quarantine, generation checking, or another lifetime mechanism. Hardware capabilities therefore do not automatically establish complete memory safety. Similar care is required for subobject boundaries, unions, low-level casts, and compatibility with existing application interfaces.

Capabilities also support compartmentalization. Different software components can receive access to distinct code and data regions, with controlled mechanisms for crossing compartment boundaries. Sealed capabilities can protect certain references from ordinary inspection or manipulation until an authorized operation handles them. These mechanisms can support protected invocation, but a usable system additionally needs calling conventions, exception handling, dynamic linking, and clear rules for transferring authority.

Arm’s Morello prototype system-on-chip and development board, delivered in 2022, provided an experimental platform for CHERI-derived capability extensions in an Arm environment. Such prototypes enable evaluation of software compatibility, performance, and compartmentalization. Their security properties are not interchangeable with those of capability-based operating-system objects: memory capabilities govern architectural accesses, whereas object capabilities govern service-level operations. A system may combine both layers, with each enforcing a different part of the authority model.

Assurance, security boundaries, and practical limits

Capability systems support precise reasoning because authority can be associated with explicit references and constrained transfer rules. A formal model can specify which capabilities exist, which domains hold them, and which state transitions create or move them. Proofs can then address properties such as absence of unauthorized access, preservation of permissions under derivation, or separation between designated components. This makes the model relevant to formal verification, but the proved property must be distinguished from broader claims that an entire application is secure.

The seL4 microkernel is an important example. Its 2009 machine-checked functional-correctness result established correspondence between a high-level specification and a C implementation under stated assumptions. seL4 uses capabilities to control access to kernel objects, including communication endpoints and memory-management resources. Subsequent verification work has addressed additional properties and configurations. These results do not mean that arbitrary applications running above the kernel are verified or that every physical attack is excluded.

The threat model determines what capability enforcement can establish. A kernel may prevent unauthorized endpoint access while a privileged device can still read memory unless direct-memory-access controls are correctly configured. A language runtime may protect object references while a security vulnerability in native code bypasses its abstractions. A distributed token scheme may resist forgery while an authorized client intentionally discloses its token. Each case places the failure at a different boundary.

Availability and information flow also require separate treatment. Possession of a service capability does not necessarily limit how often it may be invoked, how much work a request can trigger, or how long resources remain allocated. Quotas, scheduling controls, and bounded protocols can address aspects of denial of service, but are additional policies. Similarly, controlling direct reads does not automatically prevent inference through response times, shared caches, or correlated outputs.

Practical adoption involves costs beyond access-check performance. Existing applications often assume global filenames, inherited user privileges, and unrestricted libraries. Converting these assumptions into explicit resource references can require redesigning startup procedures, plugin interfaces, and interprocess protocols. Delegation chains and revocation mechanisms also create state that administrators and developers must understand. Fine-grained authority is useful only when its assignment remains comprehensible enough to inspect and maintain.

Testing consequently includes both positive and negative authority questions: whether a component can complete its intended task, whether it can reach unrelated resources, and whether returned references unexpectedly broaden its authority. Architecture analysis examines initial endowments, privileged intermediaries, reference transfer, and escape paths. These checks complement implementation testing because a perfectly enforced capability can still grant excessive authority if its scope or interface is broader than the application requires.