CVE-2024-1724: Github.com/snapcore/snapd Snapd Failed To Restrict Writes Vulnerability

MODERATE
Advisory Identifier: GHSA-4mh8-9689-38vr
CVSS 6.3
CWE-732
Published
Advisory Summary

CVE-2024-1724 is a MODERATE (CVSS 6.3) snapd failed to restrict writes vulnerability (CWE-732: Incorrect Permission Assignment for Critical Resource) affecting Github.com/snapcore/snapd libraries in the Go ecosystem. The issue involves snapd failed to restrict writes to the $home/bin path. Remediation is available by upgrading affected packages to version 2.62.

CVE-2024-1724 at a Glance

CVE Identifier CVE-2024-1724
GHSA Identifier GHSA-4mh8-9689-38vr
Severity MODERATE
CVSS v3.1 Base Score 6.3
CWE Classification CWE-732: Incorrect Permission Assignment for Critical Resource
Affected Product Github.com/snapcore/snapd
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:L).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2024-1724

To remediate this vulnerability, upgrade all affected Github.com/snapcore/snapd dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/snapcore/snapd fixed: 2.62
Upgrade github.com/snapcore/snapd to 2.62
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/snapcore/snapd

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-1724, inspect your project dependencies for Github.com/snapcore/snapd:

inspect dependencies for github.com/snapcore/snapd

Analyze the terminal output to locate any version of Github.com/snapcore/snapd in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.62), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-732: Incorrect Permission Assignment for Critical Resource, where the product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors. In Github.com/snapcore/snapd, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

In snapd versions prior to 2.62, when using AppArmor for enforcement of sandbox permissions, snapd failed to restrict writes to the $HOME/bin path. In Ubuntu, when this path exists, it is automatically added to the users PATH. An attacker who could convince a user to install a malicious snap which used the 'home' plug could use this vulnerability to install arbitrary scripts into the users PATH which may then be run by the user outside of the expected snap sandbox and hence allow them to escape confinement.

CVE-2024-1724 Affected Github.com/snapcore/snapd Versions

1 component(s)
Fixed Versions:
2.62
Product / Package Ecosystem Affected Versions Fixed Version
github.com/snapcore/snapd
Go
< 2.62
2.62

References

Frequently Asked Questions

What is CVE-2024-1724?
CVE-2024-1724 is a security vulnerability in Github.com/snapcore/snapd involving snapd failed to restrict writes to the $HOME/bin path under CWE-732: Incorrect Permission Assignment for Critical Resource.
Which Github.com/snapcore/snapd versions are affected?
Affected versions include releases prior to 2.62 across affected packages: github.com/snapcore/snapd.
What version fixes CVE-2024-1724?
Upgrading to 2.62 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/snapcore/snapd affected?
Yes, github.com/snapcore/snapd is affected in releases prior to 2.62. Upgrade your dependency to 2.62 or later.
What is the CVSS score of CVE-2024-1724?
CVE-2024-1724 has a CVSS v3.1 base score of 6.3 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:L.
What CWE is associated with CVE-2024-1724?
CVE-2024-1724 is classified under CWE-732: Incorrect Permission Assignment for Critical Resource (The product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors.).
How can I check Go dependencies for CVE-2024-1724?
Run the dependency tree command: 'inspect dependencies for github.com/snapcore/snapd'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4mh8-9689-38vr",
  "modified" : "2024-08-07T15:10:52Z",
  "published" : "2024-07-25T21:31:20Z",
  "aliases" : [ "CVE-2024-1724" ],
  "summary" : "snapd failed to restrict writes to the $HOME/bin path",
  "details" : "In snapd versions prior to 2.62, when using AppArmor for enforcement of sandbox permissions, snapd failed to restrict writes to the $HOME/bin path. In Ubuntu, when this path exists, it is automatically added to the users PATH. An attacker who could convince a user to install a malicious snap which used the 'home' plug could use this vulnerability to install arbitrary scripts into the users PATH which may then be run by the user outside of the expected snap sandbox and hence allow them to escape confinement.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/snapcore/snapd"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.62"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-1724"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/snapcore/snapd/pull/13689"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/snapcore/snapd/commit/aa191f97713de8dc3ce3ac818539f0b976eb8ef6"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/snapcore/snapd"
  }, {
    "type" : "WEB",
    "url" : "https://gld.mcphail.uk/posts/explaining-cve-2024-1724"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2024-3007"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-732" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-07-26T21:34:22Z",
    "nvd_published_at" : "2024-07-25T19:15:09Z"
  }
}