Ubuntu OverlayFS Flaws Enable Local Privilege Escalation to Root

Summary
Wiz researchers disclosed two Ubuntu-specific OverlayFS flaws that can let a local user escalate privileges to root. Ubuntu released fixes; users should update affected kernels or restrict unprivileged user namespaces.
Key points
- CVE-2023-2640 and CVE-2023-32629 affect Ubuntu kernel versions identified in the article’s release matrix; the matrix is described as a work in progress.
- Exploitation requires local code execution, creation of a user namespace, and an OverlayFS mount; remote exploitation is described as improbable.
- The flaws can cause OverlayFS to copy file capabilities without properly limiting them to the user namespace, enabling a crafted executable to gain root-like privileges.
- The vulnerabilities stem from Ubuntu-specific OverlayFS changes and unsafe extended-attribute copying paths.
- Wiz reported the flaws in June 2023, and Ubuntu released fixes in July 2023.
- Users should update affected kernels; as an alternative, the article recommends restricting unprivileged user namespaces.
Article Details
- Vulnerability Types
- Local privilege escalation through improperly copied file capabilities in OverlayFS
- Affected Versions
- Ubuntu 23.04 (Lunar Lobster), kernel 6.2.0
- Ubuntu 22.10 (Kinetic Kudu), kernel 5.19.0
- Ubuntu 22.04 LTS (Jammy Jellyfish), kernels 5.19.0 and 6.2.0
- Ubuntu 20.04 LTS (Focal Fossa), kernel 5.4.0 (CVE-2023-32629)
- Ubuntu 18.04 LTS (Bionic Beaver), kernel 5.4.0 (CVE-2023-32629)
- Exploitation Status
- reported
- Exploit Availability
- public_exploit
- Patch Status
- available
- Workarounds
- Restrict unprivileged user namespace usage with `sudo sysctl -w kernel.unprivileged_userns_clone=0`.
- To persist the restriction after restart, run `echo kernel.unprivileged_userns_clone=0 | sudo tee /etc/sysctl.d/99-disable-unpriv-userns.conf`.
MITRE ATT&CK
CVE
CVE-2021-3493Ubuntu · linux kernelflow of the vulnerability is the same as a previously disclosed Linux kernel vulnerability from 2020, CVE-2021-3493, whose exploits work for the discovered vulnerability without any changes. This raises the question:CVE-2023-0386Canonical · Ubuntu linux; Debian · Debian linux; +6 moreIn early 2023, a patch was added to the Linux kernel for CVE-2023-0386, an earlier vulnerability in OverlayFS. Essentially, a threat actor could abuse OverlayFS to manipulate the kernel to copy files fromCVE-2023-2640canonical · ubantu_kernelCVE-2023-2640 and CVE-2023-32629 were found in the OverlayFS module in Ubuntu, which is a widely used Linux filesystem that became highly popular with the rise of containers as its features enable the deployment ofCVE-2023-32629canonical · ubantu_kernelCVE-2023-2640 and CVE-2023-32629 were found in the OverlayFS module in Ubuntu, which is a widely used Linux filesystem that became highly popular with the rise of containers as its features enable the deployment of
Vendors
Products
LinuxCVE-2023-2640 and CVE-2023-32629 were found in the OverlayFS module in Ubuntu, which is a widely used Linux filesystem that became highly popular with the rise of containers as its features enable the deployment ofOverlayFSCVE-2023-2640 and CVE-2023-32629 were found in the OverlayFS module in Ubuntu, which is a widely used Linux filesystem that became highly popular with the rise of containers as its features enable the deployment of
