CVE-2015-7982 — gm
Fix: aheckmann/gm@5f5c774CVE-2015-7982 is a remote code execution vulnerability in gm. A fix is available for gm — see the affected versions and patch details below.
Command Injection in gm
Real-World Exposure
gmReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects npm packages — download data is not available via public APIs for these ecosystems.
Description
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.
Recommendation
Update to version 1.21.1 or later.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | gm | all versions | 1.21.1npm install gm@1.21.1 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for gm, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update gm to 1.21.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2015-7982 is resolved across your whole dependency graph.
Workarounds
Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does.
Frequently Asked Questions
Is CVE-2015-7982 in your dependencies?
Find it across npm, including transitive dependencies.