CVE-2022-21687
Command injection in gh-ost
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- High
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- None
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
6.8
Command injection in gh-ost
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.
- Record
CVE-2022-21687- CVSS 3.1
- 6.8 Medium
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N - Weakness
- CWE-20
- Updated
- 2026-11-02
EUVDEUVD-2022-1182
6.8
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.
- Record
EUVD-2022-1182- CVSS 3.1
- 6.8 Medium
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-rrp4-2xx3-mv29
6.8
Command injection in gh-ost
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
For more information
If you have any questions or comments about this advisory:
- Open an issue in github/gh-ost
- Record
GHSA-rrp4-2xx3-mv29- CVSS 3.1
- 6.8 Medium
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N - Weakness
- CWE-20, CWE-74
- Updated
- 2026-11-02
NVD
6.8
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.
- Record
CVE-2022-21687- CVSS 3.1
- 6.8 Medium
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N - CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N - CVSS 2.0
- 4.3 Medium
AV:N/AC:M/Au:N/C:P/I:N/A:N - Weakness
- CWE-20
- Updated
- 2026-11-02
OSV
6.8
Command injection in gh-ost
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.
- Record
CVE-2022-21687- CVSS 3.1
- 6.8 Medium
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N - Updated
- 2026-11-02
OSVGHSA-rrp4-2xx3-mv29
6.8
Command injection in gh-ost
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
For more information
If you have any questions or comments about this advisory:
- Open an issue in github/gh-ost
- Record
GHSA-rrp4-2xx3-mv29- CVSS 3.1
- 6.8 Medium
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N - Weakness
- CWE-20, CWE-74
- Updated
- 2026-11-02
OSVGO-2022-0298 No score
Command injection in gh-ost in github.com/github/gh-ost
Command injection in gh-ost in github.com/github/gh-ost
- Record
GO-2022-0298- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
github.com/github/gh-ostGo |
before 1.1.3 | 1.1.3 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2022-21687 is a medium vulnerability (CVSS 6.8) in Github Gh-ost, published February 1, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.00%, the 63rd percentile. Fixed in github.com/github/gh-ost 1.1.3.
References
github.com/github/gh-ost/security/advisories/GHSA-rrp4-2xx3-mv29
github.com/github/gh-ost/commit/a91ab042de013cfd8fbb633763438932d9080d8f
nvd.nist.gov/vuln/detail/CVE-2022-21687
github.com/advisories/GHSA-rrp4-2xx3-mv29
github.com/CVEProject/cvelistV5/tree/main/cves/2022/21xxx/CVE-2022-21687.json
github.com/github/gh-ost