Raw vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HSummary
CVE-2022-23642 is a high-severity Code Injection (CWE-94) vulnerability in Sourcegraph Sourcegraph. Its CVSS base score is 8.8 (High).
Operationally, ranked in the top 0.6% of CVEs by exploit likelihood; it is not currently listed in the CISA KEV catalog; a public proof-of-concept is referenced.
The strongest mitigations our analysis identified map to AC-3 (Access Enforcement) and SC-7 (Boundary Protection) — see the control section below for these in your framework.
Deeper analysis AI-assisted summary
Synthesised by an AI model from the NVD description and linked references — a reading aid, not an authoritative source.
Sourcegraph is a code search and navigation engine whose gitserver service prior to version 3.37 contains a remote code execution vulnerability. The service acts as a git exec proxy but does not restrict calls to git config, allowing an attacker to set the core.sshCommand option and thereby substitute an arbitrary command for ssh when git connects to a remote system. The issue is tracked as CWE-94 and CWE-862 and carries a CVSS 3.1 score of 8.8.
An attacker who can reach the gitserver HTTP endpoint—possible when internal services are not isolated—can supply a malicious configuration value and obtain code execution on the host. Exploitation therefore depends on deployment topology; the vulnerability is reachable over the network with low attack complexity and low privileges.
The flaw is fixed in Sourcegraph 3.37. The project advisory and accompanying pull request recommend upgrading or, as a workaround, ensuring that requests to gitserver are properly authenticated and firewalled. Public exploit code has been posted to Packet Storm, and the EPSS score rose sharply from a low baseline to a peak of 0.9666, indicating that exploitation interest materialized after disclosure.
OWASP Top 10 for Web (2025)
EU & UK References
- 🇪🇺 ENISA EUVD: EUVD-2022-28590
Vulnerability Data
Sourcegraph is a code search and navigation engine. Sourcegraph prior to version 3.37 is vulnerable to remote code execution in the `gitserver` service. The service acts as a git exec proxy, and fails to properly restrict calling `git config`. This…
more
allows an attacker 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. Exploitation of this vulnerability depends on how Sourcegraph is deployed. An attacker able to make HTTP requests to internal services like gitserver is able to exploit it. This issue is patched in Sourcegraph version 3.37. As a workaround, ensure that requests to gitserver are properly protected.
- CWE(s)
Related Threats
Likely ATT&CK TechniquesAI
Techniques this vulnerability likely enables, inferred from its description, weakness type, and attributed-actor tradecraft. Confidence is per-technique.
CVEs Like This One
Affected Assets
Mitigating Controls
Control response
Mitigating Controls (NIST 800-53 r5) AI
Enforces access restrictions on the gitserver HTTP endpoint so unauthorized callers cannot invoke the unrestricted git config command.
Applies boundary protection and network segmentation to block external or untrusted reachability to the internal gitserver service.
Limits the gitserver proxy to only the minimal git operations required, preventing abuse of git config to set core.sshCommand.
Mitigating Controls (NIST CSF 2.0) AI
Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.
Explicitly requires defining, enforcing, and reviewing authorizations and least privilege, directly preventing missing authorization checks.
PR.PS-06's SDLC practices directly target injection flaws via secure coding and testing (mostly), yet as a single broad outcome it leaves many code-generation specifics unaddressed (partial).
PR.DS-10 protects runtime data confidentiality/integrity but has no bearing on neutralizing externally influenced input during code generation, so neither direction shows any preventive effect.
Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI
Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.
Requiring authentication and credentials before any access occurs eliminates the absence of authorization checks that would otherwise allow an unauthenticated actor to reach protected resources.
Requiring formal authorization of every access request before rights are granted ensures that checks for required permissions are performed, preventing missing authorization checks from being introduced.
Mandatory authorization checks and central records of granted rights ensure that every access attempt is preceded by an explicit decision rather than relying on missing checks.
Segregating the approval of access rights from their implementation provides an independent check that reduces the impact of missing authorization checks in the resulting system configuration.
By requiring competent outsiders to verify that every function enforces the need-to-know principle, the control lowers the likelihood that missing authorization checks persist undetected.
Defining authorization responsibilities and reviewing risk-treatment progress throughout the project lifecycle catches missing authorization checks before the system is deployed.