CVE-2022-23642 in the critical feed json
Code Injection in Sourcegraph
published 4y ago modified 4mo 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 and 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
Is CVE-2022-23642 in your stack? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerTimeline
- 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
- last yr.
Exploit prediction
74.31% chance of exploitation in the next 30 days, higher than 99.4% of all scored CVEs (FIRST EPSS, 2026-11-09).
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 Intel 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.