Three New Security Bypasses Discovered In Ubuntu’s Unprivileged User Namespace Restrictions

Share:

The Qualys Threat Research Unit (TRU) identified 3 security bypasses in Ubuntu’s unprivileged user namespace restrictions. These vulnerabilities, discovered in Jan 2025, allow local attackers to create user namespaces with administrative privileges. Specifically, these vulnerabilities exploit weaknesses in the kernel components responsible for managing namespaces, creating avenues for unauthorized users to gain elevated permissions that are typically restricted. While these bypasses do not immediately lead to full system takeover, they become dangerous when combined with other kernel-related vulnerabilities.

Severity Level: High

SECURITY BYPASSES OVERVIEW & TECHNICAL DETAILS

The security bypasses discovered by Qualys TRU are related to the user namespace restrictions in Ubuntu, which are designed to prevent unprivileged users from acquiring full administrative rights within Linux namespaces. These restrictions were introduced in Ubuntu 23.10 but only enabled by default in Ubuntu 24.04. Despite these efforts, the Qualys TRU researchers identified three distinct methods through which attackers could bypass these protections.

AFFECTED VERSIONS: Ubuntu versions 24.04 and later, as well as version 23.10

The three bypasses in question involve:

  1. Bypass via aa-exec: An unprivileged local attacker can use the aa-exec tool, which is installed by default on Ubuntu, to bypass the unprivileged user namespace restrictions. By using this tool, attackers can transition to one of the pre-configured AppArmor profiles (such as trinity, chrome, or flatpak), which do allow the creation of user namespaces with full administrative capabilities. This allows attackers to escalate their privileges within a namespace, bypassing the restrictions set by Ubuntu’s default configuration.
  2. Bypass via busybox: The busybox utility, which is installed by default on both Ubuntu Server and Ubuntu Desktop, is another tool that allows unprivileged local attackers to bypass the user namespace restrictions. Its AppArmor profile permits the creation of user namespaces with full administrative rights. By executing the unshare command through the busybox shell, attackers can gain full administrative capabilities within the user namespace.
  3. Bypass via LD_PRELOAD: Another method of bypassing the user namespace restrictions involves using the LD_PRELOAD environment variable to inject a custom library into programs with AppArmor profiles that allow user namespace creation (e.g., nautilus). The attacker can then trigger the execution of a shell within the program, leading to the creation of a user namespace with full administrative privileges.

MITIGATIONS

  1. To mitigate the bypasses that leverage unconfined AppArmor profiles (such as the use of aa-exec), it is recommended to enable the kernel.apparmor_restrict_unprivileged_unconfined sysctl. This setting ensures that processes running with unprivileged and unconfined profiles cannot transition to more favorable profiles that allow the creation of user namespaces with full administrative capabilities.
  2. To address the bypasses through programs like busybox and nautilus, which have broad AppArmor profiles allowing the creation of user namespaces, consider removing or restricting these profiles. Disabling these profiles for applications that don’t require the ability to create user namespaces reduces the attack surface.
  3. For applications like nautilus, which require user namespace functionality, it is recommended to use a more restrictive and purpose-built bwrap profile to allow the creation of user namespaces for specific use cases without exposing unnecessary security risks.
  4. As part of a long-term strategy, keep monitoring and updating AppArmor profiles to tighten restrictions further. As new vulnerabilities and attack methods are discovered, continuously refining AppArmor rules can significantly reduce the potential for bypasses.
  5. Where possible, disable or prevent the creation of user namespaces for applications that do not explicitly require them. This minimizes the chances of bypassing user namespace restrictions.

SOURCES:

  • https://www.bleepingcomputer.com/news/security/new-ubuntu-linux-security-bypasses-require-manual-mitigations/
  • https://blog.qualys.com/vulnerabilities-threat-research/2025/03/27/qualys-tru-discovers-three-bypasses-of-ubuntu-unprivileged-user-namespace-restrictions
  • https://www.qualys.com/2025/three-bypasses-of-Ubuntu-unprivileged-user-namespace-restrictions.txt
  • https://discourse.ubuntu.com/t/understanding-apparmor-user-namespace-restriction/58007

Enjoyed reading this Threat Intelligence Advisory? Stay updated with our latest exclusive content by following us on Twitter and LinkedIn.

Ampcus Cyber
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.