Remote Code Execution (RCE) Affecting github.com/sourcegraph/sourcegraph/cmd/gitserver/server package, versions <3.37.0-rc.1


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Mature
EPSS
96.46% (100th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Remote Code Execution (RCE) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-GOLANG-GITHUBCOMSOURCEGRAPHSOURCEGRAPHCMDGITSERVERSERVER-2407257
  • published20 Feb 2022
  • disclosed20 Feb 2022
  • creditdavid-sandy

Introduced: 20 Feb 2022

CVE-2022-23642  (opens in a new tab)
CWE-94  (opens in a new tab)

How to fix?

Upgrade github.com/sourcegraph/sourcegraph/cmd/gitserver/server to version 3.37.0-rc.1 or higher.

Overview

Affected versions of this package are vulnerable to Remote Code Execution (RCE) in the gitserver service, which fails to properly restrict calling git config. It allows attackers 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.

References

CVSS Scores

version 3.1