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.
Published 2022-02-18 23:15:10
Updated 2023-06-27 19:02:00
Source GitHub, Inc.
View at NVD,   CVE.org
Vulnerability category: Execute code

Exploit prediction scoring system (EPSS) score for CVE-2022-23642

93.48%
Probability of exploitation activity in the next 30 days EPSS Score History
~ 99 %
Percentile, the proportion of vulnerabilities that are scored at or less

Metasploit modules for CVE-2022-23642

  • Sourcegraph gitserver sshCommand RCE
    Disclosure Date: 2022-02-18
    First seen: 2022-12-23
    exploit/linux/http/sourcegraph_gitserver_sshcmd
    A vulnerability exists within Sourcegraph's gitserver component that allows a remote attacker to execute arbitrary OS commands by modifying the core.sshCommand value within the git configuration. This command can then be triggered on demand by executing a git push oper

CVSS scores for CVE-2022-23642

Base Score Base Severity CVSS Vector Exploitability Score Impact Score Score Source First Seen
6.0
MEDIUM AV:N/AC:M/Au:S/C:P/I:P/A:P
6.8
6.4
NIST
8.8
HIGH CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
2.8
5.9
NIST
8.8
HIGH CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
2.8
5.9
GitHub, Inc.

CWE ids for CVE-2022-23642

  • The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
    Assigned by: security-advisories@github.com (Secondary)
  • The product does not perform an authorization check when an actor attempts to access a resource or perform an action.
    Assigned by: nvd@nist.gov (Primary)

References for CVE-2022-23642

Products affected by CVE-2022-23642

This web site uses cookies for managing your session, storing preferences, website analytics and additional purposes described in our privacy policy.
By using this web site you are agreeing to CVEdetails.com terms of use!