CVE-2020-27348: Snapcraft Snapcraft Access Restriction Bypass Vulnerability

MODERATE
Advisory Identifier: GHSA-qxm5-vx5j-pp6w
CVSS 6.8
CWE-427
Published
Advisory Summary

CVE-2020-27348 is a MODERATE (CVSS 6.8) snapcraft access restriction bypass vulnerability (CWE-427: Uncontrolled Search Path Element) affecting Snapcraft libraries in the PyPI ecosystem. The issue involves snapcraft access restriction bypass. Remediation is available by upgrading affected packages to version 4.4.4.

CVE-2020-27348 at a Glance

CVE Identifier CVE-2020-27348
GHSA Identifier GHSA-qxm5-vx5j-pp6w
Severity MODERATE
CVSS v3.1 Base Score 6.8
CWE Classification CWE-427: Uncontrolled Search Path Element
Affected Product Snapcraft
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.8

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:R/S:U/C:H/I:H/A:L).

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

How to Fix CVE-2020-27348

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

snapcraft fixed: 4.4.4
pip install snapcraft>=4.4.4
Verify Direct and Transitive Dependencies

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

pip show snapcraft

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2020-27348, inspect your installed packages using pip:

pip show snapcraft

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

Note: The pip show snapcraft command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-427: Uncontrolled Search Path Element, where the product uses a fixed or controlled search path to find resources, but one or more locations in that path can be under the control of unintended actors. In Snapcraft, 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 some conditions, a snap package built by snapcraft includes the current directory in `LD_LIBRARY_PATH`, allowing a malicious snap to gain code execution within the context of another snap if both plug the home interface or similar. This issue affects snapcraft versions prior to 4.4.4, prior to 2.43.1+16.04.1, and prior to 2.43.1+18.04.1.

CVE-2020-27348 Affected Snapcraft Versions

1 component(s)
Fixed Versions:
4.4.4
Product / Package Ecosystem Affected Versions Fixed Version
snapcraft
PyPI
< 4.4.4
4.4.4

References

Frequently Asked Questions

What is CVE-2020-27348?
CVE-2020-27348 is a security vulnerability in Snapcraft involving snapcraft Access Restriction Bypass under CWE-427: Uncontrolled Search Path Element.
Which Snapcraft versions are affected?
Affected versions include releases prior to 4.4.4 across affected packages: snapcraft.
What version fixes CVE-2020-27348?
Upgrading to 4.4.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is snapcraft affected?
Yes, snapcraft is affected in releases prior to 4.4.4. Upgrade your dependency to 4.4.4 or later.
What is the CVSS score of CVE-2020-27348?
CVE-2020-27348 has a CVSS v3.1 base score of 6.8 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:L.
What CWE is associated with CVE-2020-27348?
CVE-2020-27348 is classified under CWE-427: Uncontrolled Search Path Element (The product uses a fixed or controlled search path to find resources, but one or more locations in that path can be under the control of unintended actors.).
How can I check PyPI dependencies for CVE-2020-27348?
Run the dependency tree command: 'pip show snapcraft'. 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-qxm5-vx5j-pp6w",
  "modified" : "2024-10-23T18:48:17Z",
  "published" : "2022-05-24T17:35:23Z",
  "aliases" : [ "CVE-2020-27348" ],
  "summary" : "snapcraft Access Restriction Bypass",
  "details" : "In some conditions, a snap package built by snapcraft includes the current directory in `LD_LIBRARY_PATH`, allowing a malicious snap to gain code execution within the context of another snap if both plug the home interface or similar. This issue affects snapcraft versions prior to 4.4.4, prior to 2.43.1+16.04.1, and prior to 2.43.1+18.04.1.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "snapcraft"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.4.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-27348"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/snapcore/snapcraft/pull/3345"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/snapcore/snapcraft/commit/a0ceca9d531a34c979251030ed67b5fa2abfdd9a"
  }, {
    "type" : "WEB",
    "url" : "https://bugs.launchpad.net/bugs/1901572"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/snapcraft/PYSEC-2020-109.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/snapcore/snapcraft"
  }, {
    "type" : "WEB",
    "url" : "https://usn.ubuntu.com/usn/usn-4661-1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-427" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-22T22:57:14Z",
    "nvd_published_at" : "2020-12-04T03:15:00Z"
  }
}