Detect GitLab SSRF via Import Feature (CVE-2021-39935) in Splunk
CVE-2021-39935 is a Server-Side Request Forgery (SSRF) vulnerability in GitLab Community and Enterprise Editions. An attacker can abuse GitLab's project import or integration features to cause the server to issue arbitrary HTTP requests to internal network resources, enabling reconnaissance, metadata service access, and potential lateral movement within cloud-hosted or on-premises GitLab deployments. This vulnerability is listed in the CISA Known Exploited Vulnerabilities catalog.
MITRE ATT&CK
SPL Detection Query
index=web OR index=proxy sourcetype IN ("access_combined", "nginx:access", "iis", "pan:traffic")
| search (uri_path="*/api/v4/projects*" OR uri_path="*/import*" OR uri_path="*/integrations*")
| eval ssrf_indicator=if(match(uri_query, "(169\.254\.169\.254|metadata\.google\.internal|100\.100\.100\.200|localhost|127\\.|10\\.|192\.168\\.|172\\.(1[6-9]|2[0-9]|3[01])\\.)"), 1, 0)
| where ssrf_indicator=1
| stats count min(_time) as first_seen max(_time) as last_seen values(uri_path) as paths values(uri_query) as queries by src_ip, dest_ip, http_method, status
| sort -count Detects SSRF-indicative requests to GitLab API import and integration endpoints that reference internal or cloud metadata IP ranges.
Data Sources
Required Sourcetypes
False Positives & Tuning
- Internal CI/CD webhooks targeting RFC-1918 addresses for automated build triggers
- Legitimate vulnerability scanners running against the GitLab instance
- GitLab mirror configurations importing from private network repositories
Other platforms for CVE-2021-39935
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1SSRF via GitLab Project Import URL — Cloud Metadata
Expected signal: Outbound network connection from GitLab server process to 169.254.169.254:80; HTTP GET request logged in GitLab production.log with import_url parameter containing metadata IP
- Test 2SSRF via GitLab Webhook Integration — Internal Host
Expected signal: Network connection attempt from GitLab process to 192.168.1.1:6379; webhook creation logged in GitLab audit log with attacker-supplied internal URL
- Test 3SSRF via GitLab External Issue Tracker Integration — GCP Metadata
Expected signal: DNS lookup for metadata.google.internal followed by HTTP GET from GitLab server; integration update recorded in GitLab application log
Unlock Pro Content
Get the full detection package for CVE-2021-39935 including response playbook, investigation guide, and atomic red team tests.