CVE-2022-29171
JSON

6.6medium

Remote Code Execution in sourcegraph

Severity
6.6medium CVSS:3.1 by GitHub_M
Exploit likelihood
1.35% (higher than 72% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M

Description

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.

Affected

Product or packageVersionsReported by
sourcegraph sourcegraph< 3.38.0, before 3.38.0CVE List, NVD

All scores

GitHub_M6.6medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H
NVD7.2high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
NVD6.0medium CVSS:2.0AV:N/AC:M/Au:S/C:P/I:P/A:P

Classification

CWE-74CWE-94

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

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.

NVD (es)

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

References

Sources

SourceRecordLicence
CVE ListCVE-2022-29171 changed 2025-04-23CVE Terms of Use
NVDCVE-2022-29171 changed 2026-06-17Public domain