# CVE-2024-5300: Missing authorization in Ubuntu 16.04 LTS

> Malicious snaps can bypass sandbox restrictions to read system password hashes via systemd-userdbd if the service is installed.

- **Severity:** Medium 5.6 (`CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 21 Jul 2026
- **Updated:** 22 Jul 2026
- **Also known as:** DEBIAN-CVE-2024-5300, GHSA-px3v-8ppp-543h, RHSA-2026:29009, UBUNTU-CVE-2024-5300

## What is CVE-2024-5300?

CVE-2024-5300 is a medium-severity missing authorization vulnerability in Canonical Ubuntu 16.04 LTS, published on 21 Jul 2026. It can only be exploited from the same machine or local network, with no action from the victim.

### Official 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-212 (Improper Removal of Sensitive Information Before Storage or Transfer)

## Which versions are affected by CVE-2024-5300?


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `systemd` | Red Hat:hummingbird:1 | All versions | 0:261-2.hum1 |
| `systemd-boot-unsigned` | Red Hat:hummingbird:1 | All versions | 0:261-2.hum1 |
| `systemd-container` | Red Hat:hummingbird:1 | All versions | 0:261-2.hum1 |
| `systemd-devel` | Red Hat:hummingbird:1 | All versions | 0:261-2.hum1 |
| `systemd-journal-remote` | Red Hat:hummingbird:1 | All versions | 0:261-2.hum1 |
| `systemd-libs` | Red Hat:hummingbird:1 | All versions | 0:261-2.hum1 |
| `systemd-networkd` | Red Hat:hummingbird:1 | All versions | 0:261-2.hum1 |
| `systemd-networkd-defaults` | Red Hat:hummingbird:1 | All versions | 0:261-2.hum1 |
| `systemd-oomd-defaults` | Red Hat:hummingbird:1 | All versions | 0:261-2.hum1 |
| `systemd-pam` | Red Hat:hummingbird:1 | All versions | 0:261-2.hum1 |
| `systemd-resolved` | Red Hat:hummingbird:1 | All versions | 0:261-2.hum1 |
| `systemd-rpm-macros` | Red Hat:hummingbird:1 | All versions | 0:261-2.hum1 |
| `systemd-shared` | Red Hat:hummingbird:1 | All versions | 0:261-2.hum1 |
| `systemd-standalone-repart` | Red Hat:hummingbird:1 | All versions | 0:261-2.hum1 |
| `systemd-standalone-shutdown` | Red Hat:hummingbird:1 | All versions | 0:261-2.hum1 |
| `systemd-standalone-sysusers` | Red Hat:hummingbird:1 | All versions | 0:261-2.hum1 |
| `systemd-standalone-tmpfiles` | Red Hat:hummingbird:1 | All versions | 0:261-2.hum1 |
| `systemd-sysusers` | Red Hat:hummingbird:1 | All versions | 0:261-2.hum1 |
| `systemd-tests` | Red Hat:hummingbird:1 | All versions | 0:261-2.hum1 |
| `systemd-udev` | Red Hat:hummingbird:1 | All versions | 0:261-2.hum1 |
| `systemd-ukify` | Red Hat:hummingbird:1 | All versions | 0:261-2.hum1 |

## How do I fix CVE-2024-5300?

Apply the vendor's patch.

## Is CVE-2024-5300 being exploited?

There is no known exploitation of CVE-2024-5300 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-5300 and fix it if it is affected.

What it is: CVE-2024-5300 is a medium-severity missing authorization vulnerability in Canonical Ubuntu 16.04 LTS, published on 21 Jul 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-5300 in the wild and no public exploit code.

Affected product: Canonical Ubuntu 16.04 LTS. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-5300/ (Markdown: https://insights.sbomify.com/CVE-2024-5300/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-5300
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-5300
- OSV: https://osv.dev/vulnerability/CVE-2024-5300

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-5300/
Summaries are generated and may contain mistakes; the official description above is the record.
