This is a summary of the AI-generated 10-question deep analysis. The full version (longer answers, follow-up Q&A, related CVEs) requires login. Read the full analysis β
Q1What is this vulnerability? (Essence + Consequences)
π¨ **Essence**: Sourcegraph allows attackers to inject arbitrary commands via `git` config. <br>π₯ **Consequences**: Remote Code Execution (RCE). Attackers can run bash commands on the server.β¦
π‘οΈ **Root Cause**: CWE-94 (Code Injection). <br>π **Flaw**: Lack of restriction on `git` config execution. The `core.sshCommand` option is not sanitized, allowing arbitrary bash commands to be passed via HTTP arguments.
Q3Who is affected? (Versions/Components)
π¦ **Affected**: Sourcegraph **Gitserver** service. <br>π **Versions**: Prior to **v3.37.0** (e.g., v3.36.3). <br>π’ **Vendor**: Sourcegraph Inc.
Q4What can hackers do? (Privileges/Data)
π **Privileges**: Full RCE on the gitserver host. <br>π **Data**: Complete compromise of the server. Attackers can read/write files, install backdoors, and pivot to other internal systems.
Q5Is exploitation threshold high? (Auth/Config)
β οΈ **Threshold**: Medium. <br>π **Auth**: Requires **Low Privileges** (PR:L). <br>π **Config**: Attacker must be able to send HTTP requests to the internal `gitserver` service.β¦
π **Exploit**: **Yes**. <br>π **PoC**: Publicly available on GitHub (Altelus1/CVE-2022-23642). <br>π **Status**: Tested on v3.36.3. PacketStorm links also exist.
Q7How to self-check? (Features/Scanning)
π **Self-Check**: <br>1. Check Sourcegraph version (< 3.37.0). <br>2. Verify if `gitserver` is exposed to untrusted networks. <br>3. Scan for HTTP requests manipulating `core.sshCommand` in git configs.
π§ **Workaround**: <br>1. **Isolate**: Ensure `gitserver` is **not** accessible from untrusted networks. <br>2. **Restrict**: Block HTTP requests to the gitserver endpoint from external IPs. <br>3.β¦
π₯ **Urgency**: **HIGH**. <br>β‘ **Priority**: Immediate patching required if gitserver is exposed. CVSS Score is **High** (9.8). RCE risk is severe. Do not ignore!