Skip to content
Vulnerability Intelligence

CVE-2022-23642

HighPublic exploit

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.

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

Exploited in the wild

No known

Not in a known-exploited catalog

Public exploit code

Available

Proof-of-concept or weaponized module

Get the full CVE-2022-23642 brief as a PDF

Every affected product and fixed release, exploitation status and a first 24 hours response checklist, emailed within minutes.

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 ('Code Injection')
  • CWE-862 Missing Authorization

References

1 more references in the full CVE brief

FAQ

Common Questions.

Is CVE-2022-23642 Running On Your Attack Surface?

Brandefense maps vulnerabilities like this one to your internet-facing assets and tells you exactly where to patch.

Request A Demo