Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. github.com/snapcore/snapd
  4. ›
  5. CVE-2024-5138

CVE-2024-5138: CVE-2024-5138: snapd snapctl auth bypass

January 16, 2025

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.

References

  • bugs.launchpad.net/snapd/+bug/2065077
  • github.com/advisories/GHSA-p9v8-q5m4-pf46
  • github.com/canonical/snapd
  • github.com/canonical/snapd/commit/68ee9c6aa916ab87dbfd9a26030690f2cabf1e14
  • github.com/canonical/snapd/security/advisories/GHSA-p9v8-q5m4-pf46
  • nvd.nist.gov/vuln/detail/CVE-2024-5138
  • ubuntu.com/security/CVE-2024-5138
  • www.cve.org/CVERecord?id=CVE-2024-5138

Code Behaviors & Features

Detect and mitigate CVE-2024-5138 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 0.0.0-20240524114846-68ee9c6aa916, all versions starting from 2.51.6 before 2.63.1

Fixed versions

  • 2.63.1
  • 0.0.0-20240524114846-68ee9c6aa916

Solution

Upgrade to versions 0.0.0-20240524114846-68ee9c6aa916, 2.63.1 or above.

Impact 8.1 HIGH

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-285: Improper Authorization

Source file

go/github.com/snapcore/snapd/CVE-2024-5138.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:58 +0000.