🇰🇷 한글 설명
Sourcegraph 3.38.0 미만 버전의 gitserver 서비스에서 원격 코드 실행(RCE) 취약점이 발견되었습니다. 관리자가 Grafana 인스턴스 권한을 이용해 Gitolite의 callsignCommand를 임의로 변경함으로써 인프라에 직접 접근할 수 있습니다.
💡 쉬운 설명
Sourcegraph 관리자 권한과 Grafana 권한을 동시에 가진 사람이 시스템에 악성 명령어를 입력하여 서버를 마음대로 조종할 수 있는 문제입니다. 이를 통해 해커가 서버의 핵심 데이터와 인프라에 접근할 위험이 있습니다.
🇺🇸 원문 (English)
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 versions before 3.38.0
⚔️ 공격 벡터
Grafana 관리 권한을 이용해 Gitolite의 callsignCommand를 조작하여 원격 명령 실행
🛡️ 대응 방법
Sourcegraph를 3.38.0 버전 이상으로 업그레이드하거나 Gitolite 코드 호스트 기능을 비활성화하십시오.
🔧 검증 코드
명령어 결과에 3.38.0 미만의 버전 번호가 출력되면 취약한 상태이며, 아무것도 출력되지 않거나 3.38.0 이상이면 안전합니다.
curl -s http://<sourcegraph-url>/api/version | grep -E '"version": "3\.[0-3][0-7]\.'