CVE-2019-15741
📋 TL;DR
This vulnerability in GitLab Omnibus allows local attackers to escalate privileges through an unsafe interaction with logrotate. Attackers can gain root access by exploiting improper permissions or symlink handling in log rotation processes. Affects GitLab Omnibus installations from version 7.4 through 12.2.1.
💻 Affected Systems
- GitLab Omnibus
📦 What is this software?
Omnibus by Gitlab
Omnibus by Gitlab
Omnibus by Gitlab
⚠️ Risk & Real-World Impact
Worst Case
Full root compromise of the GitLab server, allowing complete system takeover, data theft, and lateral movement within the network.
Likely Case
Local privilege escalation to root, enabling attackers to install backdoors, modify configurations, and access sensitive GitLab data.
If Mitigated
Limited impact with proper access controls, but still poses risk if attackers gain initial low-privilege access.
🎯 Exploit Status
Exploit requires local access but is straightforward to execute. Multiple public exploit scripts and detailed write-ups exist.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: GitLab Omnibus 12.2.3 and later
Vendor Advisory: https://about.gitlab.com/2019/08/29/security-release-gitlab-12-dot-2-dot-3-released/
Restart Required: Yes
Instructions:
1. Backup your GitLab data. 2. Update GitLab Omnibus to version 12.2.3 or later using 'sudo apt-get update && sudo apt-get install gitlab-ce' (Debian/Ubuntu) or 'sudo yum update gitlab-ce' (RHEL/CentOS). 3. Run 'sudo gitlab-ctl reconfigure'. 4. Restart GitLab services.
🔧 Temporary Workarounds
Manual logrotate configuration hardening
linuxModify logrotate configurations to use secure permissions and avoid symlink attacks
sudo chmod 640 /etc/logrotate.d/gitlab
sudo chown root:root /etc/logrotate.d/gitlab
sudo chmod 750 /var/log/gitlab
🧯 If You Can't Patch
- Restrict local user access to GitLab servers to only necessary administrators
- Implement strict file integrity monitoring on logrotate configurations and GitLab log directories
🔍 How to Verify
Check if Vulnerable:
Check GitLab version with 'sudo gitlab-rake gitlab:env:info | grep Version' and verify if between 7.4 and 12.2.1 inclusive
Check Version:
sudo gitlab-rake gitlab:env:info | grep Version
Verify Fix Applied:
Confirm version is 12.2.3 or later with 'sudo gitlab-rake gitlab:env:info | grep Version'
📡 Detection & Monitoring
Log Indicators:
- Unusual logrotate activity, permission changes in /var/log/gitlab, unexpected root shell sessions
Network Indicators:
- Sudden outbound connections from GitLab server after local user login
SIEM Query:
process_name:"logrotate" AND parent_process_name:"gitlab" AND (command_line:"chmod" OR command_line:"chown")
🔗 References
- http://packetstormsecurity.com/files/154734/GitLab-Omnibus-12.2.1-Logrotate-Privilege-Escalation.html
- http://seclists.org/fulldisclosure/2019/Oct/7
- https://about.gitlab.com/2019/08/29/security-release-gitlab-12-dot-2-dot-3-released/
- https://gitlab.com/gitlab-org/omnibus-gitlab/issues/4380
- http://packetstormsecurity.com/files/154734/GitLab-Omnibus-12.2.1-Logrotate-Privilege-Escalation.html
- http://seclists.org/fulldisclosure/2019/Oct/7
- https://about.gitlab.com/2019/08/29/security-release-gitlab-12-dot-2-dot-3-released/
- https://gitlab.com/gitlab-org/omnibus-gitlab/issues/4380