{"answers":{"affected":"3 open source packages ship an affected version, including github.com/github/gh-ost. It affects 1 product.","exploited":"There is no known exploitation of CVE-2022-21687 in the wild and no public exploit code.","fix":"Upgrade github.com/github/gh-ost to 1.1.3 or later.","what":"CVE-2022-21687 is a medium-severity command injection vulnerability in n/a, published on 1 Feb 2022. An attacker needs administrator access to exploit it, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2022-21687 and fix it if it is affected.\n\nWhat it is: CVE-2022-21687 is a medium-severity command injection vulnerability in n/a, published on 1 Feb 2022. An attacker needs administrator access to exploit it, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2022-21687 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- github.com/github/gh-ost (Go): affected all versions; fixed in 1.1.3\n- github.com/github/gh-ost (Go): affected all versions; fixed in 1.1.3\n- github.com/github/gh-ost (Go): affected all versions; fixed in 1.1.3\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2022-21687/ (Markdown: https://insights.sbomify.com/CVE-2022-21687/index.md)","id":"CVE-2022-21687","markdown":"https://insights.sbomify.com/CVE-2022-21687/index.md","name":"CVE-2022-21687","record":{"aliases":["GHSA-rrp4-2xx3-mv29","GO-2022-0298"],"analysis":{"component_type":"developer_tool","fix_type":"upgrade","impacts":["data_read"],"network_reachable":"yes","non_default_config":false,"product_category":"MySQL schema migration tool","requires_auth":"high_privilege","summary":"Attackers can read arbitrary files by exploiting unsanitized input in the database parameter of gh-ost, requiring host access or social engineering.","user_interaction":"not_required","vuln_class":"command_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"gh-ost","vendor":"github"}],"cvss":{"score":6.8,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N","version":"3.1"},"cwes":[{"id":"CWE-20","name":"Improper Input Validation"}],"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.","ecosystems":["Go"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Command injection in gh-ost","id":"CVE-2022-21687","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Go","product":null,"products":[],"type":"command_injection","year":"2022"},"n_packages":3,"n_references":2,"next":{"headline":"Out-of-bounds Read in Onionshare","id":"CVE-2022-21688"},"packages":[{"ecosystem":"Go","fixed":["1.1.3"],"introduced":["0"],"last_affected":[],"package":"github.com/github/gh-ost","purl":null,"source":"GHSA-rrp4-2xx3-mv29"},{"ecosystem":"Go","fixed":["1.1.3"],"introduced":["0"],"last_affected":[],"package":"github.com/github/gh-ost","purl":"pkg:golang/github.com/github/gh-ost","source":"GHSA-rrp4-2xx3-mv29"},{"ecosystem":"Go","fixed":["1.1.3"],"introduced":["0"],"last_affected":[],"package":"github.com/github/gh-ost","purl":"pkg:golang/github.com/github/gh-ost","source":"GO-2022-0298"}],"prev":{"headline":"Server Side Twig Template Injection in PrestaShop","id":"CVE-2022-21686"},"products":["n/a"],"published":"2022-02-01","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"Go Vulnerability Database","prefix":"GO"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-05-05","vendors":["n/a"]},"summary":"Attackers can read arbitrary files by exploiting unsanitized input in the database parameter of gh-ost, requiring host access or social engineering.","url":"https://insights.sbomify.com/CVE-2022-21687/"}