Ubuntu OverlayFS Flaws Enable Local Privilege Escalation to Root

· Original article ↗

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

Vendors

Products

Related Articles