CVE-2022-40764 — snyk
HIGHCVE-2022-40764 is a high-severity (CVSS 7.8) OS Command Injection vulnerability in snyk. 1 public exploit or proof-of-concept reference is indexed, so weaponization risk is real. A fix is available for snyk — see the affected versions and patch details below.
Snyk CLI affected by Command Injection vulnerability
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
snyknpmsnyk-go-pluginnpmDescription
Snyk CLI before 1.996.0 allows arbitrary command execution, affecting Snyk IDE plugins and the snyk npm package. Exploitation could follow from the common practice of viewing untrusted files in the Visual Studio Code editor, for example. The original demonstration was with shell metacharacters in the vendor.json ignore field, affecting snyk-go-plugin before 1.19.1. This affects, for example, the Snyk TeamCity plugin (which does not update automatically) before 20220930.142957.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | snyk | all versions | 1.996.0npm install snyk@1.996.0 |
| 📦npm | snyk-go-plugin | all versions | 1.19.1npm install snyk-go-plugin@1.19.1 |
Affected Products
clisnykgolang clisnykResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for snyk, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update snyk to 1.996.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2022-40764 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-2022-40764 in your dependencies?
Find it across npm, including transitive dependencies.