Skip to content
Emerging threatsHigh

CVE-2022-23642Sourcegraph Code Injection

Sourcegraph prior to version 3.37 is vulnerable to remote code execution in the gitserver service.

Published Feb 18, 2022 · Updated Apr 22, 2025

Key Facts

Patch immediately
  • CVE-2022-23642 is a high-severity vulnerability (CVSS 8.8 v3.1) affecting Sourcegraph.
  • It is not listed in any known-exploited vulnerabilities catalog. Public exploit code is available.
  • EPSS estimates a 74% probability of exploitation in the next 30 days.
  • Fixed versions are available, including Sourcegraph 3.37.
  • Brandefense priority: patch immediately, because it is very likely to be exploited soon.

Scores

CVSS v3.1

8.8

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

EPSS (30-day exploit likelihood)

74%

Higher than 99.4% of all scored CVEs

Exploit maturity

Weaponized

ATLAS score

61/100

Publication score, see How it works

Exploitation Verdict

KEV listed

Not listed

Federal due date

None

No federal due date

Ransomware use

Not reported

Attributed actors

None named

Exploit & Defence Guidance

Exploit maturity

Weaponized

Public exploit code

4

Proof-of-concept links

In-the-wild evidence

0

Reports of active use

Description

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

2 affected entries in total
ProductAffected versionsFixed in
SourcegraphSourcegraph< 3.373.37

Patched Releases

Sourcegraph

3.37

Timeline

  1. Publicly disclosed

    Feb 18, 2022

  2. Last updated

    Apr 22, 2025

Weakness Type

  • CWE-94 Improper Control of Generation of Code
  • CWE-862 Missing Authorization

FAQ

Common Questions.

Is CVE-2022-23642 On Your Attack Surface?

Brandefense matches it against the products discovered on your perimeter and opens a finding the day a CVE like this is listed.

Request A Demo

Figures as of Dec 4, 2026. Compiled by Brandefense technologies from public vulnerability catalogs; scoring as described in How it works.

To report an error, contact Brandefense.