CVE-2022-23642 in the critical feed json
Code Injection in Sourcegraph
published 2022-02-18 4 y ago modified 2026-06-17 4 mo ago also EUVD-2022-28590
- cvss
- 8.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 74.3%
- EPSS 74.3% chance of exploitation in 30 days, percentile 99.4%
- public exploits
- 2
- Metasploit, Exploit-DB
Summary
Sourcegraph is a code search and navigation engine. Sourcegraph prior to version 3.37 is vulnerable to remote code execution in the `gitserver` service. The service acts as a git exec proxy, and fails to properly restrict calling `git config`. This allows an attacker to set the git `core.sshCommand` option, which sets git to use the specified command instead of ssh when they need to connect to a remote system. Exploitation of this vulnerability depends on how Sourcegraph is deployed. An attacker able to make HTTP requests to internal services like gitserver is able to exploit it. This issue is patched in Sourcegraph version 3.37. As a workaround, ensure that requests to gitserver are properly protected.
Patch / fix
- sourcegraph sourcegraph 3.37
Timeline
- First public exploit (Metasploit exploit/linux/http/sourcegraph_gitserver_sshcmd)
- Published
CISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- no
- Technical impact
- total
- Assessed
- 18 mo ago
Exploit prediction
74.31% chance of exploitation in the next 30 days, higher than 99.4% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- Metasploit exploit/linux/http/sourcegraph_gitserver_sshcmd Sourcegraph gitserver sshCommand RCE metasploit exploit, excellent rank, 2022-02-18
- EDB-50964 Sourcegraph Gitserver 3.36.3 - Remote Code Execution (RCE) remote, 2022-06-14
- packetstormsecurity.com http://packetstormsecurity.com/files/167506/Sourcegraph-Gitserver-3.36.3-Remote-Code-Execution.html referenced PoC, tagged "exploit" by a source, unverified
- packetstormsecurity.com http://packetstormsecurity.com/files/167741/Sourcegraph-gitserver-sshCommand-Remote-Command-Execution.html referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 2.0 | 6.0 | AV:N/AC:M/Au:S/C:P/I:P/A:P |
Affected products
- sourcegraph sourcegraph
Classification
References
-
github.com
/sourcegraph/sourcegraph/pull/30833
patch, third-party-advisory
-
github.com
/sourcegraph/sourcegraph/security/advisories/GHSA-qcmp-fx72-q8q9
patch, third-party-advisory
-
packetstormsecurity.com
/files/167506/Sourcegraph-Gitserver-3.36.3-Remote-Code-Execution.html
exploit, third-party-advisory, vdb-entry
-
packetstormsecurity.com
/files/167741/Sourcegraph-gitserver-sshCommand-Remote-Command-Execution.html
exploit, third-party-advisory, vdb-entry
Sources
- CVE List CVE-2022-23642
- NVD CVE-2022-23642
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.