CVE-2024-29068: Github.com/snapcore/snapd Snapd Failed To Properly Check Vulnerability

MODERATE
Advisory Identifier: GHSA-64jh-cjwc-w8q6
CVSS 5.8
CWE-20
Published
Advisory Summary

CVE-2024-29068 is a MODERATE (CVSS 5.8) snapd failed to properly check vulnerability (CWE-20: Improper Input Validation) affecting Github.com/snapcore/snapd libraries in the Go ecosystem. The issue involves snapd failed to properly check the file type when extracting a snap. Remediation is available by upgrading affected packages to version 2.62.

CVE-2024-29068 at a Glance

CVE Identifier CVE-2024-29068
GHSA Identifier GHSA-64jh-cjwc-w8q6
Severity MODERATE
CVSS v3.1 Base Score 5.8
CWE Classification CWE-20: Improper Input Validation
Affected Product Github.com/snapcore/snapd
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.8

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

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

How to Fix CVE-2024-29068

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-29068, 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. 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, snapd failed to properly check the file type when extracting a snap. The snap format is a squashfs file-system image and so can contain files that are non-regular files (such as pipes or sockets etc). Various file entries within the snap squashfs image (such as icons etc) are directly read by snapd when it is extracted. An attacker who could convince a user to install a malicious snap which contained non-regular files at these paths could then cause snapd to block indefinitely trying to read from such files and cause a denial of service.

CVE-2024-29068 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-29068?
CVE-2024-29068 is a security vulnerability in Github.com/snapcore/snapd involving snapd failed to properly check the file type when extracting a snap under CWE-20: Improper Input Validation.
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-29068?
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-29068?
CVE-2024-29068 has a CVSS v3.1 base score of 5.8 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:H/I:N/A:H.
What CWE is associated with CVE-2024-29068?
CVE-2024-29068 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Go dependencies for CVE-2024-29068?
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-64jh-cjwc-w8q6",
  "modified" : "2024-08-26T19:19:52Z",
  "published" : "2024-07-25T21:31:20Z",
  "aliases" : [ "CVE-2024-29068" ],
  "summary" : "snapd failed to properly check the file type when extracting a snap",
  "details" : "In snapd versions prior to 2.62, snapd failed to properly check the file type when extracting a snap. The snap format is a squashfs file-system image and so can contain files that are non-regular files (such as pipes or sockets etc). Various file entries within the snap squashfs image (such as icons etc) are directly read by snapd when it is extracted. An attacker who could convince a user to install a malicious snap which contained non-regular files at these paths could then cause snapd to block indefinitely trying to read from such files and cause a denial of service.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:H/I:N/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:H/AT:N/PR:N/UI:P/VC:H/VI:N/VA:H/SC:N/SI:N/SA:N"
  } ],
  "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-29068"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/snapcore/snapd/pull/13682"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/snapcore/snapd/commit/b66fee81606a1c05f965a876ccbaf44174194063"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/snapcore/snapd"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2024-3008"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-07-26T21:32:48Z",
    "nvd_published_at" : "2024-07-25T20:15:04Z"
  }
}