Skip to main content

CVE-2022-41943: CWE-276: Incorrect Default Permissions in sourcegraph sourcegraph

Medium
Published: Tue Nov 22 2022 (11/22/2022, 00:00:00 UTC)
Source: CVE
Vendor/Project: sourcegraph
Product: sourcegraph

Description

sourcegraph is a code intelligence platform. As a site admin it was possible to execute arbitrary commands on Gitserver when the experimental `customGitFetch` feature was enabled. This experimental feature has now been disabled by default. This issue has been patched in version 4.1.0.

AI-Powered Analysis

AILast updated: 06/22/2025, 13:24:02 UTC

Technical Analysis

CVE-2022-41943 is a vulnerability identified in Sourcegraph, a widely used code intelligence platform that assists developers in code search and navigation. The flaw stems from incorrect default permissions related to the experimental feature `customGitFetch`. When this feature was enabled, site administrators could execute arbitrary commands on the Gitserver component. This capability arises because the feature allowed elevated command execution privileges without proper access controls or permission restrictions, classified under CWE-276 (Incorrect Default Permissions). The vulnerability was addressed by disabling the experimental feature by default and patching it in Sourcegraph version 4.1.0. Prior to this fix, any Sourcegraph deployment running a version below 4.1.0 with `customGitFetch` enabled was susceptible to command injection attacks by site admins, potentially leading to unauthorized code execution on the underlying Gitserver. Notably, exploitation requires site admin privileges, which limits the attack surface to trusted users with elevated access. There are no known exploits in the wild, and the vulnerability was publicly disclosed in November 2022. The issue highlights the risks of enabling experimental features without strict permission controls, especially in platforms managing source code repositories and developer workflows.

Potential Impact

For European organizations, the impact of this vulnerability can be significant, particularly for enterprises and public sector entities that rely on Sourcegraph for code intelligence and repository management. If exploited, an attacker with site admin privileges could execute arbitrary commands on the Gitserver, potentially leading to unauthorized code manipulation, data leakage, or disruption of development pipelines. This could compromise the integrity of software supply chains, a critical concern given Europe's increasing focus on software security and supply chain resilience. Additionally, organizations in regulated industries such as finance, healthcare, and critical infrastructure could face compliance violations and reputational damage if source code integrity is undermined. Although exploitation requires site admin access, insider threats or compromised admin credentials could enable attackers to leverage this vulnerability. The absence of known active exploits reduces immediate risk, but the potential for privilege escalation and lateral movement within development environments remains a concern. Overall, the vulnerability poses a medium risk to confidentiality, integrity, and availability of code repositories and associated services in European organizations using affected Sourcegraph versions.

Mitigation Recommendations

European organizations should take the following specific mitigation steps: 1) Immediately upgrade all Sourcegraph instances to version 4.1.0 or later, where the vulnerability is patched and the `customGitFetch` feature is disabled by default. 2) Audit current configurations to ensure the experimental `customGitFetch` feature is disabled if upgrading is not immediately feasible. 3) Review and restrict site admin privileges to the minimum necessary personnel, implementing strict access controls and monitoring for unusual admin activities. 4) Implement robust credential management and multi-factor authentication for site admins to reduce the risk of credential compromise. 5) Conduct regular security assessments and penetration testing focused on development and code management platforms to detect potential misuse of elevated privileges. 6) Monitor logs and alerts from Sourcegraph and Gitserver components for suspicious command execution or access patterns indicative of exploitation attempts. 7) Educate development and security teams about the risks associated with enabling experimental features and the importance of timely patching. These targeted actions go beyond generic advice by focusing on configuration audits, privilege management, and monitoring specific to Sourcegraph's architecture.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2022-09-30T00:00:00.000Z
Cisa Enriched
true

Threat ID: 682d9846c4522896dcbf4b6e

Added to database: 5/21/2025, 9:09:26 AM

Last enriched: 6/22/2025, 1:24:02 PM

Last updated: 7/30/2025, 10:29:00 PM

Views: 13

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats