This GitLab Bug Lets Any User Run Commands as Git—No Admin Needed
Michael Miller ·
Listen to this article~4 min
Security researcher Yuhang Wu published a PoC exploit for GitLab 18.11.3 that lets authenticated users run commands as git using two crafted Jupyter notebooks and a diff request—no admin rights needed.
If you're running a self-managed GitLab instance, you might want to sit down for this one. Security researcher Yuhang Wu from depthfirst just dropped a working proof-of-concept exploit that targets GitLab 18.11.3. And here's the kicker—it doesn't require admin rights, CI runner access, or even any interaction from a victim. Just an ordinary authenticated user with a few cleverly crafted files.
### What's the Bug?
The exploit chain is surprisingly simple. An attacker commits two specially crafted Jupyter notebooks to a repository, then requests their diff. That's it. No complex setup, no social engineering, no waiting for a privileged user to click something. The command execution happens as the 'git' user on the server, which means the attacker can run arbitrary commands with that level of access.
### Who's at Risk?
This vulnerability affects self-managed GitLab instances running version 18.11.3. If you're on GitLab.com (the cloud version), you're likely safe since patches are usually applied automatically. But if you host your own instance, you need to act fast. The exploit is public, and while it requires authentication, that's a low bar for most organizations.
### What Can an Attacker Do?
Once the exploit runs, the attacker can execute commands as the 'git' user. This isn't root, but it's still dangerous. They could:
- Access repositories owned by the 'git' user
- Modify or delete files within those repositories
- Potentially pivot to other systems if the GitLab server has network access
- Install backdoors or exfiltration scripts
The real danger is that this could be a stepping stone to deeper compromise. An attacker who gets command execution on your GitLab server can start probing for other vulnerabilities or misconfigurations.
### What Should You Do?
First, check your GitLab version. If you're on 18.11.3, upgrade immediately. GitLab has likely released a patch by now, so check their security advisories. If you can't upgrade right away, consider restricting access to Jupyter notebook functionality or monitoring for suspicious diff requests.
Second, review your user permissions. Even though this exploit doesn't require admin rights, limiting who can create and commit files can reduce your attack surface. Enable two-factor authentication for all users to make it harder for attackers to gain that initial authenticated access.
Third, monitor your logs. Look for unusual patterns like multiple notebook commits followed by diff requests from the same user. Early detection can stop an attacker before they cause real damage.
### The Bigger Picture
This is a reminder that even well-maintained software can have critical vulnerabilities. GitLab is a powerful tool, but its complexity means there are many potential attack vectors. The fact that this exploit chain is so simple—just two files and a diff request—makes it especially dangerous.
Security researcher Yuhang Wu deserves credit for responsibly disclosing this and publishing the PoC to push organizations to patch. But the clock is ticking. If you're running GitLab, don't wait. Update now, and make sure your security team knows about this.
Stay safe out there.