Vulnerabilities · 2022 · Sourcegraph
CVE-2022-23642
Sourcegraph vulnerability
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.
Affected products
Sourcegraph. The exact versions are in the references.
What to do now
- Check your exposureFind out whether Sourcegraph runs anywhere in your environment, including systems of suppliers.
- UpdateInstall the version in which the vendor fixed the vulnerability. The references lead to the advisory.
- Set the orderSystems that can be reached from the internet come first, then the rest.
References
- github.com/sourcegraph/sourcegraph/pull/30833 · Patch
- github.com/sourcegraph/sourcegraph/security/advisories/GHSA-qcmp-fx72-q8q9 · Patch
- packetstormsecurity.com/files/167506/Sourcegraph-Gitserver-3.36.3-Remote-Code-Execution.ht · Exploit
- packetstormsecurity.com/files/167741/Sourcegraph-gitserver-sshCommand-Remote-Command-Execu · Exploit
- nvd.nist.gov/vuln/detail/CVE-2022-23642
- cve.org/CVERecord?id=CVE-2022-23642
More vulnerabilities in Sourcegraph products
Data: CVE list and the NVD. This product uses data from the NVD API but is not endorsed or certified by the NVD.