Affected products
GitLab passed user-uploaded images to its embedded ExifTool before authentication, and a crafted DjVu file could make ExifTool execute arbitrary commands. An unauthenticated remote attacker could run commands as the git user.
attackerkb.com
Published on attackerkb.com
On April 14, 2021, GitLab published a security release to address CVE-2021-22205, a critical remote code execution vulnerability in the service’s web interface. At the time, GitLab described the issue as an authenticated vulnerability that was the result of passing user-provided images to the service’s embedded…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the upload handler invoked ExifTool on user-supplied files before authentication, and the bundled ExifTool version was vulnerable to command injection via DjVu files.
Impact
An unauthenticated attacker could execute arbitrary commands as the git user, leading to full compromise of the GitLab server.
What the attacker needed
Network access to GitLab; no authentication needed
How it was found
- Create a malicious DjVu image that embeds a command for ExifTool to execute.
- Send the image in a multipart POST request to any path on the GitLab server.
- The server processes the image with ExifTool before authentication, running the embedded command.
- The attacker receives a reverse shell as the git user.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
GitLab is a website for managing code. It used a tool called ExifTool to read metadata from uploaded images, but it did this before checking who was uploading. A specially crafted image could trick ExifTool into running commands on the server, letting an attacker take control without logging in.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.