CVE-2017-17831: Github.com/git lfs/git lfs GitHub Git LFS Arbitrary Command Vulnerability

HIGH
Advisory Identifier: GHSA-w4xh-w33p-4v29
CVSS 8.8
CWE-20
Published
Advisory Summary

CVE-2017-17831 is a HIGH (CVSS 8.8) github git lfs arbitrary command vulnerability (CWE-20: Improper Input Validation) affecting Github.com/git lfs/git lfs libraries in the Go ecosystem. The issue involves github git lfs arbitrary command execution vulnerability. Remediation is available by upgrading affected packages to version 2.1.1-0.20170519163204-f913f5f9c7c6.

CVE-2017-17831 at a Glance

CVE Identifier CVE-2017-17831
GHSA Identifier GHSA-w4xh-w33p-4v29
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-20: Improper Input Validation
Affected Product Github.com/git lfs/git lfs
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.8

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

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

How to Fix CVE-2017-17831

To remediate this vulnerability, upgrade all affected Github.com/git lfs/git lfs 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/git-lfs/git-lfs fixed: 2.1.1-0.20170519163204-f913f5f9c7c6
Upgrade github.com/git-lfs/git-lfs to 2.1.1-0.20170519163204-f913f5f9c7c6
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/git-lfs/git-lfs

How to Check if You Are Affected

To determine whether your application is affected by CVE-2017-17831, inspect your project dependencies for Github.com/git lfs/git lfs:

inspect dependencies for github.com/git-lfs/git-lfs

Analyze the terminal output to locate any version of Github.com/git lfs/git lfs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.1-0.20170519163204-f913f5f9c7c6), 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/git lfs/git lfs, 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

GitHub Git LFS before 2.1.1 allows remote attackers to execute arbitrary commands via an ssh URL with an initial dash character in the hostname, located on a `url =` line in a `.lfsconfig` file within a repository. ### Specific Go Packages Affected github.com/git-lfs/git-lfs/lfsapi

CVE-2017-17831 Affected Github.com/git lfs/git lfs Versions

1 component(s)
Fixed Versions:
2.1.1-0.20170519163204-f913f5f9c7c6
Product / Package Ecosystem Affected Versions Fixed Version
github.com/git-lfs/git-lfs
Go
< 2.1.1-0.20170519163204-f913f5f9c7c6
2.1.1-0.20170519163204-f913f5f9c7c6

References

Frequently Asked Questions

What is CVE-2017-17831?
CVE-2017-17831 is a security vulnerability in Github.com/git lfs/git lfs involving GitHub Git LFS Arbitrary command execution vulnerability under CWE-20: Improper Input Validation.
Which Github.com/git lfs/git lfs versions are affected?
Affected versions include releases prior to 2.1.1-0.20170519163204-f913f5f9c7c6 across affected packages: github.com/git-lfs/git-lfs.
What version fixes CVE-2017-17831?
Upgrading to 2.1.1-0.20170519163204-f913f5f9c7c6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/git-lfs/git-lfs affected?
Yes, github.com/git-lfs/git-lfs is affected in releases prior to 2.1.1-0.20170519163204-f913f5f9c7c6. Upgrade your dependency to 2.1.1-0.20170519163204-f913f5f9c7c6 or later.
What is the CVSS score of CVE-2017-17831?
CVE-2017-17831 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2017-17831?
CVE-2017-17831 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-2017-17831?
Run the dependency tree command: 'inspect dependencies for github.com/git-lfs/git-lfs'. 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-w4xh-w33p-4v29",
  "modified" : "2024-05-20T19:55:20Z",
  "published" : "2022-05-14T00:55:16Z",
  "aliases" : [ "CVE-2017-17831" ],
  "summary" : "GitHub Git LFS Arbitrary command execution vulnerability",
  "details" : "GitHub Git LFS before 2.1.1 allows remote attackers to execute arbitrary commands via an ssh URL with an initial dash character in the hostname, located on a `url =` line in a `.lfsconfig` file within a repository.\n### Specific Go Packages Affected\ngithub.com/git-lfs/git-lfs/lfsapi",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/git-lfs/git-lfs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.1.1-0.20170519163204-f913f5f9c7c6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-17831"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/git-lfs/git-lfs/pull/2241"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/git-lfs/git-lfs/pull/2242"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/git-lfs/git-lfs/commit/f913f5f9c7c6d1301785fdf9884a2942d59cdf19"
  }, {
    "type" : "WEB",
    "url" : "https://confluence.atlassian.com/sourcetreekb/sourcetree-security-advisory-2018-01-24-942834324.html"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/git-lfs/git-lfs"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/git-lfs/git-lfs/releases/tag/v2.1.1"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2021-0073"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20200227131639/http://www.securityfocus.com/bid/102926"
  }, {
    "type" : "WEB",
    "url" : "http://blog.recurity-labs.com/2017-08-10/scm-vulns"
  }, {
    "type" : "WEB",
    "url" : "http://www.securityfocus.com/bid/102926"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-02-08T00:28:40Z",
    "nvd_published_at" : "2017-12-21T06:29:00Z"
  }
}