Skip to content
Heist/ feed
Back to feed
Medium

Command injection in gh-ost

Type: advisorySources: OSV

gh-ost is a triggerless online schema migration solution for MySQL. Versions prior to 1.1.3 are subject to an arbitrary file read vulnerability. 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. The `-database` parameter does not properly sanitize user input which can lead to arbitrary file reads.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2022-21687
Confirmed fixed CVEs
Not specified
Updated in this feed
5 Nov 2026, 02:08 UTC · Revision 1

Source evidence

Command injection in gh-ost

core-osv · Original source

Published 1 Feb 2022, 11:56 UTC

gh-ost is a triggerless online schema migration solution for MySQL. Versions prior to 1.1.3 are subject to an arbitrary file read vulnerability. 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. The `-database` parameter does not properly sanitize user input which can lead to arbitrary file reads.

osv:CVE-2022-21687
Complete source record
{
  "id": "b77a17e7f4d644bd67b6bbcf8071ff1e108537df0c8c77f5375befde17c994fa",
  "url": "https://osv.dev/vulnerability/CVE-2022-21687",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Command injection in gh-ost",
    "summary": "gh-ost is a triggerless online schema migration solution for MySQL. Versions prior to 1.1.3 are subject to an arbitrary file read vulnerability. 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. The `-database` parameter does not properly sanitize user input which can lead to arbitrary file reads.",
    "evidence": "osv:CVE-2022-21687",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2022-21687",
      "aliases": [
        "CVE-2022-21687",
        "GHSA-rrp4-2xx3-mv29",
        "GO-2022-0298"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/github/gh-ost",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "627c3c7aaf1d9ba0db29b5829d67e401bbedccda"
                },
                {
                  "fixed": "a91ab042de013cfd8fbb633763438932d9080d8f"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:github:gh-ost:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "1.1.3"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "a91ab042de013cfd8fbb633763438932d9080d8f"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v1.1.2",
            "v1.1.1",
            "revert-pr-915",
            "v1.1.0",
            "v1.0.50-beta",
            "v1.0.49",
            "v1.0.48",
            "v1.0.47",
            "v1.0.46",
            "v1.0.45",
            "v1.0.44",
            "v1.0.42",
            "v1.0.40",
            "v1.0.35",
            "v1.0.36",
            "v1.0.34",
            "v1.0.32",
            "v1.0.30",
            "v1.0.28",
            "v1.0.21",
            "v1.0.20",
            "v1.0.17",
            "v1.0.14",
            "v1.0.13",
            "v1.0.11",
            "v1.0.10",
            "v1.0.9",
            "v1.0.8",
            "v1.0.6",
            "v1.0.2",
            "v1.0.1",
            "v0.9.9",
            "v0.9.8",
            "v0.9.7",
            "v0.9.6",
            "v0.9.2",
            "v0.8.8",
            "v0.8.7",
            "v0.8.5",
            "v0.8.4",
            "v0.8.3",
            "v0.8.2",
            "v0.7.16",
            "v0.7.2",
            "v0.7.1",
            "v0.7"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-21687.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:41.989132367Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/21xxx/CVE-2022-21687.json",
        "https://github.com/github/gh-ost/security/advisories/GHSA-rrp4-2xx3-mv29",
        "https://nvd.nist.gov/vuln/detail/CVE-2022-21687",
        "https://github.com/github/gh-ost/commit/a91ab042de013cfd8fbb633763438932d9080d8f"
      ],
      "provider_metadata": {
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/21xxx/CVE-2022-21687.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-21687",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 509375,
  "published_at": "2022-02-01T11:56:17+00:00"
}