![]() |
|
Study on Command Injection in GitLab Community and Enterprise Edition 11.11 - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45) +--- Forum: Grayhat • Purple Team • Hybrid Security (https://hackforums.net/forumdisplay.php?fid=449) +---- Forum: Beginner Hacking (https://hackforums.net/forumdisplay.php?fid=4) +----- Forum: Hacking Tutorials (https://hackforums.net/forumdisplay.php?fid=47) +----- Thread: Study on Command Injection in GitLab Community and Enterprise Edition 11.11 (/showthread.php?tid=6102031) |
Study on Command Injection in GitLab Community and Enterprise Edition 11.11 - Bri4n0ps - Aug 11, 2020 Study on Gitlab's SSRF vulnerability allowing RCE by authenticated users (CVE-2019-12430) Server Side Request Forgery And Cross Application Scripting SSRF is Server Side Request Forgery. This issue occurs when an application sends requests over the internet to an attacker-controlled location. Attackers have many uses for such functionality, including:
stats sizes / HTTP/1.1 User-Agent: curl/7.29.0 Host: localhost:11212 Accept: / The first line is a valid memcached command. The following lines will be ignored. Even if the following lines weren't ignored, it makes no difference since the attack has already completed. This request can be sent to a memcached server with a curl request: `curl -X "stats sizes" localhost:11211`. Gitlab vulnerable to SSRF & CAS A vulnerability in gitlab was publicised earlier this year (2019) by "@nyangawa of Chaitin Tech". This vulnerability affects the "import project by repo URL" functinality of gitlab. The import project by repo URL is by design, vulnerable to SSRF. Gitlab attempts to mitigate this by blacklisting certain URL patterns including `127.0.0.1`, localhost, and others. An IPv6 format was not blacklisted though, and requests to `[0:0:0:0:0:ffff:127.0.0.1]` are permitted. Gitlab uses redis rather than memcached, so an attacker would specify the port `6379`. The developers of redis are aware of attacks like this. Therefore, if redis sees the `Host:` header, it recognises that the request is an HTTP request and drops the connection. Fortunately for attackers, gitlab supports the `git://` protocol, which is not detected. Now that attackers are capable of inserting arbitrary content into the redis server, it is trivial for attackers to run any code on the gitlab server. One such method is to queue a `GitlabShellWorker` task with the attacker-controlled commands. Notes
|