Vulnerabilities in pkg:golang/github.com/github/gh-ost

PACKAGE
Advisory Identifier: GHSA-rrp4-2xx3-mv29
Advisory Summary

CVE-2022-21687 is a MODERATE (CVSS 6.8) command injection vulnerability (CWE-20: Improper Input Validation) affecting Github.com/github/gh ost libraries in the Go ecosystem. The issue involves command injection in gh-ost. Remediation is available by upgrading affected packages to version 1.1.3.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/github/gh-ost

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/github/gh-ost. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-rrp4-2xx3-mv29 CVE-2022-21687 MODERATE Command injection in gh-ost

CVE-2022-21687 at a Glance

CVE Identifier CVE-2022-21687
GHSA Identifier GHSA-rrp4-2xx3-mv29
Severity MODERATE
CVSS v3.1 Base Score 6.8
CWE Classification CWE-20: Improper Input Validation
Affected Product Github.com/github/gh ost
Package Ecosystem Go
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:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N).

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

How to Fix CVE-2022-21687

To remediate this vulnerability, upgrade all affected Github.com/github/gh ost 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/github/gh-ost fixed: 1.1.3
Upgrade github.com/github/gh-ost to 1.1.3
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/github/gh-ost

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-21687, inspect your project dependencies for Github.com/github/gh ost:

inspect dependencies for github.com/github/gh-ost

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

Gh-ost version <= 1.1.2 allows users to inject DSN strings via the `-database` parameter. This is a low severity vulnerability as the attacker must have access to the target host or trick an administrator into executing a malicious `gh-ost` command on a host running `gh-ost`, plus network access from host running `gh-ost` to the attack's malicious MySQL server. ### Impact This issue may lead to arbitrary local file read. ### Patches Fixed in 1.1.3+. ### Workarounds None ### References - https://advisory.dw1.io/51 ### For more information If you have any questions or comments about this advisory: * Open an issue in [github/gh-ost](http://github.com/github/gh-ost)

CVE-2022-21687 Affected Github.com/github/gh ost Versions

1 component(s)
Fixed Versions:
1.1.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/github/gh-ost
Go
< 1.1.3
1.1.3

References

Frequently Asked Questions

What is CVE-2022-21687?
CVE-2022-21687 is a security vulnerability in Github.com/github/gh ost involving Command injection in gh-ost under CWE-20: Improper Input Validation.
Which Github.com/github/gh ost versions are affected?
Affected versions include releases prior to 1.1.3 across affected packages: github.com/github/gh-ost.
What version fixes CVE-2022-21687?
Upgrading to 1.1.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/github/gh-ost affected?
Yes, github.com/github/gh-ost is affected in releases prior to 1.1.3. Upgrade your dependency to 1.1.3 or later.
What is the CVSS score of CVE-2022-21687?
CVE-2022-21687 has a CVSS v3.1 base score of 6.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2022-21687?
CVE-2022-21687 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-2022-21687?
Run the dependency tree command: 'inspect dependencies for github.com/github/gh-ost'. 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-rrp4-2xx3-mv29",
  "modified" : "2022-02-07T21:07:25Z",
  "published" : "2022-02-01T00:47:33Z",
  "aliases" : [ "CVE-2022-21687" ],
  "summary" : "Command injection in gh-ost",
  "details" : "Gh-ost version <= 1.1.2 allows users to inject DSN strings via the `-database` parameter.\n\nThis is a low severity vulnerability as the attacker must have access to the target host or trick an administrator into executing a malicious `gh-ost` command on a host running `gh-ost`, plus network access from host running `gh-ost` to the attack's malicious MySQL server.\n\n### Impact\nThis issue may lead to arbitrary local file read.\n\n### Patches\nFixed in 1.1.3+.\n\n### Workarounds\nNone\n\n### References\n- https://advisory.dw1.io/51\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [github/gh-ost](http://github.com/github/gh-ost)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/github/gh-ost"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.1.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/github/gh-ost/security/advisories/GHSA-rrp4-2xx3-mv29"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-21687"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/github/gh-ost/commit/a91ab042de013cfd8fbb633763438932d9080d8f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/github/gh-ost"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20", "CWE-74" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-01-31T20:45:59Z",
    "nvd_published_at" : "2022-02-01T12:15:00Z"
  }
}