Summary
CVE-2024-5138: snapd snapctl auth bypass
Workarounds
Users may disconnect any instances of the mount-control interface to prevent snapd from creating such mount points. For example, the firefox snap has the host-hunspell plug, which is of type mount-control. The interface can be disconnected with:
sudo snap disconnect firefox:host-hunspell
References
The original bug report was made on Launchpad: https://bugs.launchpad.net/snapd/+bug/2065077
CVE.org: https://www.cve.org/CVERecord?id=CVE-2024-5138
Canonical: https://ubuntu.com/security/CVE-2024-5138
Impact
A snap with prior permissions to create a mount entry on the host, such as firefox, normally uses the permission from one of the per-snap hook programs. A unprivileged users cannot normally trigger that behaviour by using snap run --shell firefox followed by snapctl mount, since snapd validates the requesting user identity (root or non-root). The issue allows unprivileged users to bypass that check by crafting a malicious command line vector which confuses snapd into thinking the help message is requested.
Unprivileged user on a default installation of Ubuntu, where firefox is as provided as a snap, may cause a denial-of-service attack by repeatedly mounting hunspell database over and over and eventually exhausting system memory.
Other attacks, reliant on the same underying mechanism (mount), are possible. In all cases the snap must be installed and grated permission to perform this action (by connecting an appropriate snap interface), which requires administrative privileges. As such we are focusing on the case of default installation where an unprivileged user may exploit this behavior.
CVE-2024-5138 has a CVSS score of 4.0 (Medium). The vector is requires local access, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.63.1, 0.0.0-20240524114846-68ee9c6aa916); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Patch: https://github.com/canonical/snapd/commit/68ee9c6aa916ab87dbfd9a26030690f2cabf1e14
Release: Available from Snapd 2.64
Frequently Asked Questions
- What is CVE-2024-5138? CVE-2024-5138 is a medium-severity security vulnerability in github.com/snapcore/snapd (go), affecting versions >= 2.51.6, < 2.63.1. It is fixed in 2.63.1, 0.0.0-20240524114846-68ee9c6aa916.
- How severe is CVE-2024-5138? CVE-2024-5138 has a CVSS score of 4.0 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of github.com/snapcore/snapd are affected by CVE-2024-5138? github.com/snapcore/snapd (go) versions >= 2.51.6, < 2.63.1 is affected.
- Is there a fix for CVE-2024-5138? Yes. CVE-2024-5138 is fixed in 2.63.1, 0.0.0-20240524114846-68ee9c6aa916. Upgrade to this version or later.
- Is CVE-2024-5138 exploitable, and should I be worried? Whether CVE-2024-5138 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2024-5138 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2024-5138?
- Upgrade
github.com/snapcore/snapdto 2.63.1 or later - Upgrade
github.com/snapcore/snapdto 0.0.0-20240524114846-68ee9c6aa916 or later
- Upgrade