CVE-2022-21687: Github.com/github/gh ost Command Injection Vulnerability
MODERATECVE-2022-21687 is a MODERATE (CVSS 6.8) command injection vulnerability (CWE-20: Improper Input Validation) affecting Github.com/github/gh ost libraries in the Go ecosystem. The issue involves command injection in gh-ost. Remediation is available by upgrading affected packages to version 1.1.3.
CVE-2022-21687 at a Glance
Security Impact
CVSS: 6.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N).
How to Fix CVE-2022-21687
To remediate this vulnerability, upgrade all affected Github.com/github/gh ost dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/github/gh-ost to 1.1.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/github/gh-ost
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-21687, inspect your project dependencies for Github.com/github/gh ost:
inspect dependencies for github.com/github/gh-ost
Analyze the terminal output to locate any version of Github.com/github/gh ost in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.3), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Github.com/github/gh ost, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-21687 Affected Github.com/github/gh ost Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/github/gh-ost
|
Go |
< 1.1.3
|
1.1.3
|
References
Frequently Asked Questions
What is CVE-2022-21687?
Which Github.com/github/gh ost versions are affected?
What version fixes CVE-2022-21687?
Is github.com/github/gh-ost affected?
What is the CVSS score of CVE-2022-21687?
What CWE is associated with CVE-2022-21687?
How can I check Go dependencies for CVE-2022-21687?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-rrp4-2xx3-mv29",
"modified" : "2022-02-07T21:07:25Z",
"published" : "2022-02-01T00:47:33Z",
"aliases" : [ "CVE-2022-21687" ],
"summary" : "Command injection in gh-ost",
"details" : "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)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/github/gh-ost"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.1.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/github/gh-ost/security/advisories/GHSA-rrp4-2xx3-mv29"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-21687"
}, {
"type" : "WEB",
"url" : "https://github.com/github/gh-ost/commit/a91ab042de013cfd8fbb633763438932d9080d8f"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/github/gh-ost"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20", "CWE-74" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-01-31T20:45:59Z",
"nvd_published_at" : "2022-02-01T12:15:00Z"
}
}