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.

INFO

Published Date :

Feb. 18, 2022, 11:15 p.m.

Last Modified :

June 27, 2023, 7:01 p.m.

Remotely Exploitable :

Yes !

Impact Score :

5.9

Exploitability Score :

2.8
Public PoC/Exploit Available at Github

CVE-2022-23642 has a 8 public PoC/Exploit available at Github. Go to the Public Exploits tab to see the list.

Affected Products

The following products are affected by CVE-2022-23642 vulnerability. Even if cvefeed.io is aware of the exact versions of the products that are affected, the information is not represented in the table below.

ID Vendor Product Action
1 Sourcegraph sourcegraph
References to Advisories, Solutions, and Tools

Here, you will find a curated list of external links that provide in-depth information, practical solutions, and valuable tools related to CVE-2022-23642.

URL Resource
http://packetstormsecurity.com/files/167506/Sourcegraph-Gitserver-3.36.3-Remote-Code-Execution.html Exploit Third Party Advisory VDB Entry
http://packetstormsecurity.com/files/167741/Sourcegraph-gitserver-sshCommand-Remote-Command-Execution.html Exploit Third Party Advisory VDB Entry
https://github.com/sourcegraph/sourcegraph/pull/30833 Patch Third Party Advisory
https://github.com/sourcegraph/sourcegraph/security/advisories/GHSA-qcmp-fx72-q8q9 Patch Third Party Advisory

We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).

All CVE - PoC in GitHub

poc proofofconcept tester allcve cvegithub cvenew cvepoc cveupdate

Updated: 1 month ago
5 stars 2 fork 2 watcher
Born at : March 22, 2024, 3:58 p.m. This repo has been linked 928 different CVEs too.

None

Updated: 6 months, 2 weeks ago
1 stars 0 fork 0 watcher
Born at : March 11, 2024, 1:21 p.m. This repo has been linked 930 different CVEs too.

None

Updated: 1 year, 6 months ago
0 stars 2 fork 2 watcher
Born at : April 8, 2023, 6:19 a.m. This repo has been linked 923 different CVEs too.

None

Updated: 7 months, 2 weeks ago
20 stars 3 fork 3 watcher
Born at : Feb. 14, 2023, 6:10 p.m. This repo has been linked 921 different CVEs too.

None

Updated: 7 months, 2 weeks ago
2 stars 2 fork 2 watcher
Born at : Nov. 25, 2022, 5:43 p.m. This repo has been linked 930 different CVEs too.

PoC for Sourcegraph Gitserver < 3.37.0 RCE (CVE-2022-23642)

Python

Updated: 1 month, 2 weeks ago
7 stars 2 fork 2 watcher
Born at : June 10, 2022, 6:12 a.m. This repo has been linked 1 different CVEs too.

test 反向辣鸡数据投放 CVE-2022-23305 工具 利用 教程 Exploit POC

cve-2020-

Updated: 1 year, 10 months ago
5 stars 2 fork 2 watcher
Born at : Jan. 21, 2022, 5:07 a.m. This repo has been linked 2608 different CVEs too.

🍆 My GitHub Profile

Go

Updated: 3 weeks, 2 days ago
4 stars 6 fork 6 watcher
Born at : July 10, 2020, 10:24 a.m. This repo has been linked 6 different CVEs too.

Results are limited to the first 15 repositories due to potential performance issues.

The following list is the news that have been mention CVE-2022-23642 vulnerability anywhere in the article.

The following table lists the changes that have been made to the CVE-2022-23642 vulnerability over time.

Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.

  • CVE Modified by [email protected]

    May. 14, 2024

    Action Type Old Value New Value
  • Reanalysis by [email protected]

    Jun. 27, 2023

    Action Type Old Value New Value
    Added CWE NIST CWE-862
  • Modified Analysis by [email protected]

    Oct. 29, 2022

    Action Type Old Value New Value
    Changed Reference Type http://packetstormsecurity.com/files/167506/Sourcegraph-Gitserver-3.36.3-Remote-Code-Execution.html No Types Assigned http://packetstormsecurity.com/files/167506/Sourcegraph-Gitserver-3.36.3-Remote-Code-Execution.html Exploit, Third Party Advisory, VDB Entry
    Changed Reference Type http://packetstormsecurity.com/files/167741/Sourcegraph-gitserver-sshCommand-Remote-Command-Execution.html No Types Assigned http://packetstormsecurity.com/files/167741/Sourcegraph-gitserver-sshCommand-Remote-Command-Execution.html Exploit, Third Party Advisory, VDB Entry
  • CVE Modified by [email protected]

    Jul. 13, 2022

    Action Type Old Value New Value
    Added Reference http://packetstormsecurity.com/files/167741/Sourcegraph-gitserver-sshCommand-Remote-Command-Execution.html [No Types Assigned]
  • CVE Modified by [email protected]

    Jun. 20, 2022

    Action Type Old Value New Value
    Added Reference http://packetstormsecurity.com/files/167506/Sourcegraph-Gitserver-3.36.3-Remote-Code-Execution.html [No Types Assigned]
  • Initial Analysis by [email protected]

    Mar. 07, 2022

    Action Type Old Value New Value
    Added CVSS V2 NIST (AV:N/AC:M/Au:S/C:P/I:P/A:P)
    Added CVSS V3.1 NIST AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
    Changed Reference Type https://github.com/sourcegraph/sourcegraph/pull/30833 No Types Assigned https://github.com/sourcegraph/sourcegraph/pull/30833 Patch, Third Party Advisory
    Changed Reference Type https://github.com/sourcegraph/sourcegraph/security/advisories/GHSA-qcmp-fx72-q8q9 No Types Assigned https://github.com/sourcegraph/sourcegraph/security/advisories/GHSA-qcmp-fx72-q8q9 Patch, Third Party Advisory
    Added CPE Configuration OR *cpe:2.3:a:sourcegraph:sourcegraph:*:*:*:*:*:*:*:* versions up to (excluding) 3.37
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.
CWE - Common Weakness Enumeration

While CVE identifies specific instances of vulnerabilities, CWE categorizes the common flaws or weaknesses that can lead to vulnerabilities. CVE-2022-23642 is associated with the following CWEs:

Common Attack Pattern Enumeration and Classification (CAPEC)

Exploit Prediction

EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days.

93.56 }} 0.59%

score

0.99160

percentile

CVSS31 - Vulnerability Scoring System
Attack Vector
Attack Complexity
Privileges Required
User Interaction
Scope
Confidentiality
Integrity
Availability