// For flags

CVE-2022-29171

Remote Code Execution in sourcegraph

Severity Score

7.2
*CVSS v3.1

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

0
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

-
*SSVC
Descriptions

Sourcegraph is a fast and featureful code search and navigation engine. Versions before 3.38.0 are vulnerable to Remote Code Execution in the gitserver service. The Gitolite code host integration with Phabricator allows Sourcegraph site admins to specify a `callsignCommand`, which is used to obtain the Phabricator metadata for a Gitolite repository. An administrator who is able to edit or add a Gitolite code host and has administrative access to Sourcegraph’s bundled Grafana instance can change this command arbitrarily and run it remotely. This grants direct access to the infrastructure underlying the Sourcegraph installation. The attack requires: site-admin privileges on the instance of Sourcegraph, Administrative privileges on the bundled Grafana monitoring instance, Knowledge of the gitserver IP address or DNS name (if running in Kubernetes). This can be found through Grafana. The issue is patched in version 3.38.0. You may disable Gitolite code hosts. We still highly encourage upgrading regardless of workarounds.

Sourcegraph es un motor de búsqueda y navegación de código rápido y con muchas funciones. Las versiones anteriores a la 3.38.0 son vulnerables a una ejecución de código remota en el servicio gitserver. La integración del host de código Gitolite con Phabricator permite a administradores del sitio Sourcegraph especificar un "callsignCommand", que es usado para obtener los metadatos de Phabricator para un repositorio Gitolite. Un administrador que es capaz de editar o añadir un host de código Gitolite y presenta acceso administrativo a la instancia de Grafana de Sourcegraph puede cambiar este comando arbitrariamente y ejecutarlo remotamente. Esto garantiza el acceso directo a la infraestructura subyacente a la instalación de Sourcegraph. El ataque requiere: privilegios de site-admin en la instancia de Sourcegraph, privilegios administrativos en la instancia de monitorización de Grafana, conocimiento de la dirección IP del gitserver o del nombre DNS (si es ejecutada en Kubernetes). Esto puede encontrarse mediante Grafana. El problema está parcheado en la versión 3.38.0. Puede deshabilitar los hosts de código de Gitolite. Seguimos recomendando una actualización independientemente de las mitigaciones

*Credits: N/A
CVSS Scores
Attack Vector
Network
Attack Complexity
Low
Privileges Required
High
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
Attack Vector
Network
Attack Complexity
High
Privileges Required
High
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
Attack Vector
Network
Attack Complexity
Medium
Authentication
Single
Confidentiality
Partial
Integrity
Partial
Availability
Partial
* Common Vulnerability Scoring System
SSVC
  • Decision:-
Exploitation
-
Automatable
-
Tech. Impact
-
* Organization's Worst-case Scenario
Timeline
  • 2022-04-13 CVE Reserved
  • 2022-05-05 CVE Published
  • 2024-08-03 CVE Updated
  • 2024-12-17 EPSS Updated
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
  • ---------- First Exploit
CWE
  • CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
  • CWE-94: Improper Control of Generation of Code ('Code Injection')
CAPEC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Sourcegraph
Search vendor "Sourcegraph"
Sourcegraph
Search vendor "Sourcegraph" for product "Sourcegraph"
< 3.38.0
Search vendor "Sourcegraph" for product "Sourcegraph" and version " < 3.38.0"
-
Affected