vendor:
Sourcegraph Gitserver
by:
Altelus
9.8
CVSS
CRITICAL
Remote Code Execution (RCE)
78
CWE
Product Name: Sourcegraph Gitserver
Affected Version From: 3.36.3
Affected Version To: 3.37.0
Patch Exists: YES
Related CWE: CVE-2022-23642
CPE: sourcegraph/server:3.36.3
Platforms Tested: Linux
2022
Sourcegraph Gitserver 3.36.3 – Remote Code Execution (RCE)
Sourcegraph prior to 3.37.0 has a remote code execution vulnerability on its gitserver service. This is due to lack of restriction on git config execution thus 'core.sshCommand' can be passed on the HTTP arguments which can contain arbitrary bash commands. Note that this is only possible if gitserver is exposed to the attacker. This is tested on Sourcegraph 3.36.3
Mitigation:
Restrict access to the gitserver service and ensure that it is not exposed to the attacker.