Impact & Risk Analysis
- Severity: High
- CIS Benchmark: CIS 5.26
- Impact: Privilege Escalation. By default, a process inside a container can elevate its privileges by executing “setuid” (suid) or “setgid” binaries (like
sudoorpasswd). If an attacker compromises an application, they can exploit these privileged binaries to gain root access. Setting theno_new_privbit ensures that the process and its children cannot gain any additional privileges, even if they run a suid binary.
Common Misconfiguration
Running containers without theno-new-privileges security option. By default, new privileges are not restricted, allowing processes to potentially escalate their access level.
Vulnerable Example
Secure Example
Audit Procedure
Run the following command to inspect the security options:- Result: Check the output for
no-new-privileges. - Fail: If the output does not contain
no-new-privileges. - Pass: If the list includes
no-new-privileges.
Remediation
You should start your container with theno-new-privileges option. This prevents LSMs (like SELinux) and standard kernel mechanisms from allowing processes to acquire new privileges via suid/sgid bits.
