File Capabilities Narrow Root, but the Wrong Executable Can Widen It
Linux file capabilities let an executable receive a subset of root's powers without running as root. Instead of setting the setuid bit on a binary, an administrator can grant CAP_NET_BIND_SERVICE or another capability to the file. The kernel stores the capability set in a security.capability extended attribute and applies it during execve .
The model is narrower than full root, but it creates a direct relationship between a file and a privilege. A writable or replaceable executable with a powerful capability can become a privilege-escalation path. The risk is greater when a package upgrade, backup restore or deployment tool preserves the extended attribute on a file that is no longer reviewed.
Understand the sets
A process has permitted, effective and inheritable capability sets. File capabilities describe what an executable can add during execution.…