CVE-2015-7982: Gm Command Injection Vulnerability
CRITICALCVE-2015-7982 is a CRITICAL command injection vulnerability (CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')) affecting Gm libraries in the npm ecosystem. The issue involves command injection in gm. Remediation is available by upgrading affected packages to version 1.21.1.
CVE-2015-7982 at a Glance
How to Fix CVE-2015-7982
To remediate this vulnerability, upgrade all affected Gm dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install gm@1.21.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls gm
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2015-7982, inspect your project dependencies using npm:
npm ls gm
Analyze the terminal output to locate any version of Gm in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.21.1), your application is affected.
Note: The npm ls gm command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection'), where the product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. In Gm, 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-2015-7982 Affected Gm Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
gm
|
npm |
< 1.21.1
|
1.21.1
|
References
Frequently Asked Questions
What is CVE-2015-7982?
Which Gm versions are affected?
What version fixes CVE-2015-7982?
Is gm affected?
What CWE is associated with CVE-2015-7982?
How can I check npm dependencies for CVE-2015-7982?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pjh3-jv7w-9jpr",
"modified" : "2021-09-23T21:23:47Z",
"published" : "2020-09-01T15:18:55Z",
"aliases" : [ "CVE-2015-7982" ],
"summary" : "Command Injection in gm",
"details" : "Versions of `gm` prior to 1.21.1 are affected by a command injection vulnerability. The vulnerability is triggered when user input is passed into `gm.compare()`, which fails to sanitize input correctly before calling the graphics magic binary.\n\n\n## Recommendation\n\nUpdate to version 1.21.1 or later.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "gm"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.21.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.20.0"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2015-7982"
}, {
"type" : "WEB",
"url" : "https://github.com/aheckmann/gm/commit/5f5c77490aa84ed313405c88905eb4566135be31"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/aheckmann/gm"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/54"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-77" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2020-08-31T18:09:27Z",
"nvd_published_at" : null
}
}