{"id":"CVE-2022-21687","aliases":["CVE-2022-21687","GHSA-rrp4-2xx3-mv29","GO-2022-0298"],"related":[],"kind":"vulnerability","state":"published","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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"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)","format":"markdown","source":"ghsa"},{"lang":"en","text":"Command injection in gh-ost in github.com/github/gh-ost","format":"markdown","source":"go"},{"lang":"es","text":"gh-ost es una solución de migración de esquemas en línea sin disparador para MySQL. Las versiones anteriores a 1.1.3 están sujetas a una vulnerabilidad de lectura arbitraria de archivos. El atacante debe tener acceso al host de destino o engañar a un administrador para que ejecute un comando gh-ost malicioso en un host que ejecute gh-ost, además de tener acceso a la red desde el host que ejecuta gh-ost al servidor MySQL malicioso del ataque. El parámetro \"-database\" no sanea apropiadamente la entrada del usuario, lo que puede conllevar a lecturas arbitrarias de archivos","source":"nvd"}],"published":"2022-02-01T00:47:33.000Z","modified":"2026-09-10T03:49:17.096Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N","score":6.8,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N","score":6.8,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N","score":6.8,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:P/I:N/A:N","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-20","CWE-74"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.1.3"}],"ecosystem":"Go","package":"github.com/github/gh-ost","purl":"pkg:golang/github.com/github/gh-ost","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.1.3"}],"ecosystem":"Go","package":"github.com/github/gh-ost","purl":"pkg:golang/github.com/github/gh-ost","source":"go"},{"ranges":[{"status":"affected","fixed":"1.1.3"}],"vendor":"github","product":"gh-ost","cpe":"cpe:2.3:a:github:gh-ost:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/github/gh-ost/security/advisories/GHSA-rrp4-2xx3-mv29","tags":["advisory","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/github/gh-ost/commit/a91ab042de013cfd8fbb633763438932d9080d8f","tags":["fix","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-21687","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/github/gh-ost","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-04-25T15:46:27.953Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-21687","url":"https://www.cve.org/CVERecord?id=CVE-2022-21687","licence":"CVE Terms of Use","modified":"2025-05-05T16:34:00.348Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-rrp4-2xx3-mv29","url":"https://github.com/advisories/GHSA-rrp4-2xx3-mv29","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:17.096Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2022-0298","url":"https://pkg.go.dev/vuln/GO-2022-0298","licence":"CC-BY-4.0","modified":"2026-03-03T04:49:38.894Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-21687","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-21687","licence":"Public domain","modified":"2026-06-17T04:26:45.853Z"}],"updatedAt":"2026-11-25T22:58:09.454Z","epss":{"score":0.01036,"percentile":0.64843,"date":"2026-12-01T12:00:22.000Z"}}