Three security bypasses were discovered in Ubuntu Linux’s user namespace restrictions, potentially allowing local attackers to gain administrative privileges. The vulnerabilities, found in Ubuntu versions 23.10 and 24.04, allow unprivileged users to create namespaces with full administrative capabilities. These issues can be exploited in combination with kernel vulnerabilities, posing a significant risk to system security despite not granting full control of the system.
The bypass methods discovered by Qualys include exploiting the aa-exec tool, which runs programs under specific AppArmor profiles.
By using permissive profiles such as trinity, chrome, or flatpak, attackers can create user namespaces with elevated privileges. Another bypass method involves using the busybox shell, which is installed by default on Ubuntu and allows unrestricted user namespace creation via a shell.
A third technique leverages the LD_PRELOAD environment variable, which allows attackers to inject custom shared libraries into trusted processes. By injecting a shell into programs like Nautilus, which has a permissive AppArmor profile, attackers can bypass restrictions and gain privileged access within a user namespace.
These bypasses could be highly dangerous when combined with kernel-related vulnerabilities requiring administrative privileges.
Canonical, the organization behind Ubuntu, acknowledged the findings but did not classify them as vulnerabilities. They are working on improving AppArmor protections through future updates. In the meantime, administrators are advised to implement various hardening steps, such as enabling kernel restrictions to block aa-exec abuse, disabling broad AppArmor profiles, and applying stricter profiles to reduce the risk of attacks exploiting these bypasses.