
Qualys Threat Research Unit (TRU) has recently disclosed three security bypasses in Ubuntu’s unprivileged user namespace restrictions. These bypasses could allow local attackers to gain administrative capabilities.
Ubuntu introduced unprivileged user namespace restrictions in version 23.10 and enabled them by default in 24.04. This was done to enhance security by limiting the ability of unprivileged users to gain powerful administrative privileges. However, Qualys TRU discovered three methods to bypass these restrictions.
“Each bypass allows a local attacker to create user namespaces with full administrative capabilities,” Qualys researchers stated, warning that such access enables further exploitation of kernel vulnerabilities requiring CAP_SYS_ADMIN or CAP_NET_ADMIN privileges.
User namespaces, a key Linux kernel feature, allow unprivileged users to create sandboxed environments where they can act with full root privileges inside the namespace—a feature vital to containerization and application isolation. But this also expands the attack surface, especially when paired with kernel flaws.
Ubuntu responded to this risk by introducing AppArmor-based namespace restrictions via kernel.apparmor_restrict_unprivileged_userns in version 23.10 and enabling it by default in 24.04 LTS.
As Canonical’s Alex Murray previously described: “Unprivileged user namespaces… expose additional attack surfaces within the Linux kernel. […] For Ubuntu 24.04 LTS, the use of unprivileged user namespaces is allowed, but access to any additional permissions within the namespace is denied.”
However, Qualys has found that this isolation can be undone in three ways, allowing attackers to regain those restricted capabilities.
Qualys TRU identified three ways to bypass Ubuntu’s restrictions:
- Bypass via aa-exec: The
aa-exec
tool can be used to switch to an AppArmor profile that allows the creation of user namespaces with full capabilities. - Bypass via busybox: The
busybox
shell can be used to execute commands that create user namespaces with full capabilities. - Bypass via LD_PRELOAD: A shared library can be preloaded into a program like
nautilus
to execute a shell and bypass the restrictions.
It’s important to note that these bypasses, on their own, do not grant an attacker complete control of the system. However, they can be combined with other vulnerabilities, especially in the kernel, to achieve greater access. As the report states, “These bypasses facilitate exploiting vulnerabilities in kernel components requiring powerful administrative privileges within a confined environment.”
Qualys TRU responsibly disclosed these vulnerabilities to the Ubuntu Security Team on January 15, 2025.
Ubuntu versions 24.04 and later are affected by these bypasses. Ubuntu 23.10 has the restrictions, but they are not enabled by default.
Ubuntu acknowledged the issue and posted detailed hardening steps to help admins mitigate the bypasses:
- Restrict unprivileged profile transitions:
- Enable kernel.apparmor_restrict_unprivileged_unconfined=1
- Disable permissive AppArmor profiles:
- Remove or restrict profiles for BusyBox and Nautilus:
- Use tailored bwrap profiles:
- Advanced users can restrict namespace access more granularly via bwrap profile templates.
“By combining [these measures], the security level of the system can be significantly improved,” Ubuntu noted in their guidance.