Goal Reached Thanks to every supporter β€” we hit 100%!

Goal: 1000 CNY Β· Raised: 1000 CNY

100.0%

CVE-2022-23642 β€” AI Deep Analysis Summary

CVSS 8.8 Β· High

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.…

Q2Root Cause? (CWE/Flaw)

πŸ›‘οΈ **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.…

Q6Is there a public Exp? (PoC/Wild Exploitation)

πŸ”“ **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.

Q8Is it fixed officially? (Patch/Mitigation)

βœ… **Fixed**: **Yes**. <br>🩹 **Patch**: Upgrade to Sourcegraph **v3.37.0** or later. <br>πŸ”— **Ref**: GitHub Advisory GHSA-qcmp-fx72-q8q9 and PR #30833.

Q9What if no patch? (Workaround)

🚧 **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.…

Q10Is it urgent? (Priority Suggestion)

πŸ”₯ **Urgency**: **HIGH**. <br>⚑ **Priority**: Immediate patching required if gitserver is exposed. CVSS Score is **High** (9.8). RCE risk is severe. Do not ignore!