CVE-2024-5138: Input Validation

Published May 31, 2024
·
Updated

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.

Patches

Patch: https://github.com/canonical/snapd/commit/68ee9c6aa916ab87dbfd9a26030690f2cabf1e14 Release: Available from Snapd 2.64

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:

sh 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

Other sources

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.

MITRE

Affected Software

4 affected componentsFixes available
go/github.com/snapcore/snapd<0.0.0-20240524114846-68ee9c6aa916
0.0.0-20240524114846-68ee9c6aa916
go/github.com/snapcore/snapd>=2.51.6<2.63.1
2.63.1
debian/snapd<=2.49-1+deb11u2, <=2.57.6-1
2.66.1-22.67-1
Canonical snapd>=2.51.6<2.63.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/snapcore/snapd to a version that resolves this vulnerability.

    Fixed in 0.0.0-20240524114846-68ee9c6aa916
  2. Upgrade

    Upgrade go/github.com/snapcore/snapd to a version that resolves this vulnerability.

    Fixed in 2.63.1
  3. Upgrade

    Upgrade debian/snapd to a version that resolves this vulnerability.

    Fixed in 2.66.1-2Fixed in 2.67-1
  4. Upgrade

    Upgrade snapd to a version that resolves this vulnerability.

    Fixed in 2.64Patch 68ee9c6aa916ab87dbfd9a26030690f2cabf1e14
  5. Configuration

    Disconnect the mount-control interface instance for the firefox snap to prevent snapd from creating hunspell mount points: run `sudo snap disconnect firefox:host-hunspell`.

    snapd (snap interface) firefox:host-hunspell (mount-control interface) = disconnected

Event History

May 31, 2024
CVE Published
via MITRE·09:02 PM
Data Sourced
via MITRE·09:02 PM
Description
Data Sourced
via NVD·09:15 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:15 PM
RemedyAffected Software
Jan 16, 2025
Advisory Published
via GitHub·05:19 PM
Data Sourced
via Ubuntu·05:49 PM
RemedyDescriptionSeverityAffected Software
Data Sourced
via Launchpad·05:50 PM
Description
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-5138?

CVE-2024-5138 has a moderate severity level due to its potential to escalate privileges through improper handling of mount permissions.

2

How do I fix CVE-2024-5138?

To fix CVE-2024-5138, update to the latest version of snapd as specified in the remediation instructions for your specific package.

3

Who is affected by CVE-2024-5138?

Users of snapd versions between 2.51.6 and 2.63.1, as well as earlier versions of the package, are affected by CVE-2024-5138.

4

What is the impact of CVE-2024-5138?

The impact of CVE-2024-5138 allows unprivileged users to potentially create mount entries on the host system, leading to privilege escalation.

5

Is there a workaround for CVE-2024-5138?

There is no official workaround for CVE-2024-5138; the only resolution is to update to a patched version.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203