CVE-2022-23642CWE-94

Code Injection in Sourcegraph

High · published February 18, 2022

Patch now

High probability of exploitation

CVSS calls it high at 8.8. It sits in the 99.5th percentile for exploit probability.

CVSS v3.1
8.8
EPSS
74%
Percentile
99.5
In the wild
Unconfirmed
What it is

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.

The record
Technical detail
CVSS v3.1
8.8 · HIGH
Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.74310 · 99.5th percentile
Weakness
CWE-94 · Improper Control of Generation of Code ('Code Injection')
Published
2022-02-18T22:15Z
EPSS history
Timeline
  • 18 FEB 22:15Z
    Code Injection in Sourcegraph
    cvelistv5