{"id":"CVE-2024-5138","aliases":["CVE-2024-5138","GHSA-p9v8-q5m4-pf46","GO-2024-2906"],"related":[],"kind":"vulnerability","state":"published","title":"CVE-2024-5138: snapd snapctl auth bypass","summary":"The snapctl component within snapd allows a confined snap to interact with the snapd daemon to take certain privileged actions on behalf of the snap. It was found that snapctl did not properly parse command-line arguments, allowing an unprivileged user to trigger an authorised action on behalf of the snap that would normally require administrator privileges to perform. This could possibly allow an unprivileged user to perform a denial of service or similar.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"The snapctl component within snapd allows a confined snap to interact with the snapd daemon to take certain privileged actions on behalf of the snap. It was found that snapctl did not properly parse command-line arguments, allowing an unprivileged user to trigger an authorised action on behalf of the snap that would normally require administrator privileges to perform. This could possibly allow an unprivileged user to perform a denial of service or similar.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nA 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.\n\nUnprivileged 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.\n\nOther 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.\n\n### Patches\n\nPatch: https://github.com/canonical/snapd/commit/68ee9c6aa916ab87dbfd9a26030690f2cabf1e14\nRelease: Available from Snapd 2.64\n\n### Workarounds\n\nUsers 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:\n\n```sh\nsudo snap disconnect firefox:host-hunspell\n```\n\n### References\n\nThe original bug report was made on Launchpad: https://bugs.launchpad.net/snapd/+bug/2065077\nCVE.org: https://www.cve.org/CVERecord?id=CVE-2024-5138\nCanonical: https://ubuntu.com/security/CVE-2024-5138","format":"markdown","source":"ghsa"},{"lang":"en","text":"CVE-2024-5138 in github.com/snapcore/snapd","format":"markdown","source":"go"},{"lang":"es","text":"El componente snapctl dentro de snapd permite que un complemento confinado interactúe con el daemon snapd para realizar ciertas acciones privilegiadas en nombre del complemento. Se descubrió que snapctl no analizaba adecuadamente los argumentos de la línea de comandos, lo que permitía a un usuario sin privilegios activar una acción autorizada en nombre del complemento que normalmente requeriría privilegios de administrador para realizarse. Esto posiblemente podría permitir que un usuario sin privilegios realice una denegación de servicio o algo similar.","source":"nvd"}],"published":"2024-05-31T21:02:19.979Z","modified":"2026-07-08T07:14:03.911Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H","score":8.1,"rating":"HIGH"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H","score":8.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":4,"rating":"MEDIUM"}],"cwes":["CWE-20","CWE-285"],"affected":[{"ranges":[{"type":"custom","introduced":"0","fixed":"68ee9c6aa916ab87dbfd9a26030690f2cabf1e14","status":"affected"}],"vendor":"Canonical Ltd.","product":"snapd","package":"snapd","repo":"https://github.com/snapcore/snapd","platforms":["Linux"],"source":"cvelist"},{"ranges":[{"type":"git","introduced":"0","fixed":"68ee9c6aa916ab87dbfd9a26030690f2cabf1e14","status":"affected"}],"vendor":"canonical","product":"snapd","cpe":"cpe:2.3:a:canonical:snapd:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"2.51.6","status":"affected","fixed":"2.63.1"}],"ecosystem":"Go","package":"github.com/snapcore/snapd","purl":"pkg:golang/github.com/snapcore/snapd","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.0.0-20240524114846-68ee9c6aa916"}],"ecosystem":"Go","package":"github.com/snapcore/snapd","purl":"pkg:golang/github.com/snapcore/snapd","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"github.com/snapcore/snapd","purl":"pkg:golang/github.com/snapcore/snapd","source":"go"},{"ranges":[{"status":"affected","introduced":"2.51.6","fixed":"2.63.1"}],"vendor":"canonical","product":"snapd","cpe":"cpe:2.3:a:canonical:snapd:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/snapcore/snapd/commit/68ee9c6aa916ab87dbfd9a26030690f2cabf1e14","tags":["fix","patch","x-transferred"],"sources":["cvelist","go","nvd"]},{"url":"https://bugs.launchpad.net/snapd/+bug/2065077","tags":["exploit","issue-tracking","patch","report","web","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2024-5138","tags":["advisory","issue-tracking","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/snapcore/snapd/security/advisories/GHSA-p9v8-q5m4-pf46","tags":["issue-tracking","vendor-advisory","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://github.com/canonical/snapd/security/advisories/GHSA-p9v8-q5m4-pf46","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/canonical/snapd/commit/68ee9c6aa916ab87dbfd9a26030690f2cabf1e14","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/canonical/snapd","tags":["package"],"sources":["ghsa"]},{"url":"https://ubuntu.com/security/CVE-2024-5138","tags":["web"],"sources":["ghsa"]}],"credits":["Rory McNamara from Snyk Security Labs"],"assigner":"canonical","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2024-08-07T19:03:04.672Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-5138","url":"https://www.cve.org/CVERecord?id=CVE-2024-5138","licence":"CVE Terms of Use","modified":"2024-09-06T19:48:49.508Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-p9v8-q5m4-pf46","url":"https://github.com/advisories/GHSA-p9v8-q5m4-pf46","licence":"CC-BY-4.0","modified":"2026-07-08T07:14:03.911Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2024-2906","url":"https://pkg.go.dev/vuln/GO-2024-2906","licence":"CC-BY-4.0","modified":"2026-03-03T04:51:52.766Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-5138","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-5138","licence":"Public domain","modified":"2026-06-17T08:15:16.680Z"}],"updatedAt":"2026-11-25T22:58:41.345Z","epss":{"score":0.00834,"percentile":0.58786,"date":"2026-12-01T12:00:22.000Z"}}