5.6Medium

CVE-2024-5300AppArmor Base Profile Misconfiguration in snapd Permits Confined Snaps Unauthorized Access to Hashed Passwords via systemd-userdbd

snapd; Canonical Ubuntu 26.04 LTS; Canonical Ubuntu 24.04 LTS; Canonical Ubuntu 22.04 LTS Published: (4 months ago)

Description

An access control bypass and information disclosure vulnerability exists in the base AppArmor security profile configuration of Canonical snapd. The abstraction rules located in /etc/apparmor.d/abstractions/nss-systemd (inherited via ) inadvertently permit strictly confined snap applications, which lack the privileged account-control interface, to interact directly with the io.systemd.Multiplexer and io.systemd.NameServiceSwitch UNIX domain sockets under /run/systemd/userdb/. On systems where the systemd-userdbd service is installed and operational, the service fails to distinguish between an unconfined root user on the host system and a restricted root user running within a snap application's sandbox (such as a daemon or configuration hook). Because systemd-userdbd returns "complete" user records—including sensitive hashed user passwords from /etc/shadow—when queried by a process running as root, a compromised or malicious strictly confined snap executing code as root can successfully query the Varlink interface to retrieve all system password hashes, bypassing intended snap sandbox restrictions. This issue is mitigated by the fact that systemd-userdbd is not installed by default on standard Ubuntu deployments.

Weakness (CWE): CWE-212

Data: CVE.org, NVD, CISA KEV, FIRST EPSS, Ubuntu. Published as the sources state it, in English.

Affected products and versions

VendorProductVersions
Canonical Ubuntu 16.04 LTS fixed 2.61.4ubuntu0.16.04.1+esm3
Canonical Ubuntu 18.04 LTS fixed 2.61.4ubuntu0.18.04.1+esm3
Canonical Ubuntu 20.04 LTS fixed 2.67.1+20.04ubuntu1~esm2
Canonical Ubuntu 22.04 LTS fixed 2.76+ubuntu22.04.1
Canonical Ubuntu 24.04 LTS fixed 2.76+ubuntu24.04.1
Canonical Ubuntu 26.04 LTS fixed 2.76+ubuntu26.04.3
— snapd < 2.76.1

References and patches