Hacking — Always check out the Images
GitLab did not strip EXIF metadata, including latitude and longitude, from images uploaded to public areas such as profile pictures and forums. An attacker could download these images and extract the location data, potentially revealing the uploader's home address.
My report: https://hackerone.com/reports/446238
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.
Context
The write-up describes the general pattern: websites with public profile pages containing images, or better, forums where images can be posted. The scenario at issue is a website that publicly shares images and serves them back to visitors. If the platform serves the file back with its original Exif metadata intact, then data the uploader never intended to publish, such as the latitude and longitude where the photo was taken, becomes public.
Exif is a metadata format used primarily on JPEG images. It can store the camera model, the date and time the photo was taken, copyright information, and the latitude and longitude of the location where the photo was taken. Many modern smartphones attach latitude and longitude by default to images taken through their native camera apps, unless the user changes the setting.
Setup
The write-up does not describe a particular account setup, tooling or version. The precondition is simply a website with public profile pages containing images, or better, forums where images can be posted. The tester needs a JPEG image with Exif latitude and longitude data attached, and the ability to upload it to those spots and then download it again, both while authenticated as the uploader and while unauthenticated or authenticated on a different account.
Finding it
The privacy risk arises when a website has a way to publicly share images, via profile pictures, forum posts and similar, and does not strip the Exif metadata from images shared on that platform. Most smartphone users do not realise they are sharing the location data for a photo. Combined with a platform that does not strip the metadata, this can disclose the uploader's exact home location, or other data they may not want to share such as the phone model.
The test is straightforward: prepare a JPEG with Exif longitudinal and latitudinal data attached, upload it to the public spots, then redownload it. If the redownloaded file still contains the Exif metadata, you have likely found a vulnerability.
Exploitation
Step 1: Prepare an image with location metadata
Create a JPEG image with Exif latitude and longitude data attached. The write-up does not include the tooling or commands used to embed the metadata.
Step 2: Upload it to public image locations
Upload the prepared JPEG to the places where images are publicly shared: profile pictures, forum posts, and similar spots.
Step 3: Redownload the image
Download the image back from the site. If the redownloaded file still contains the Exif metadata, the platform is not stripping it.
Step 4: Check access conditions
When redownloading, always attempt to do so while unauthenticated, or authenticated on a different account, to see whether the metadata is reproducible without being logged in as the uploader. This rules out the case where the original image with metadata is only accessible to the uploader.
Step 5: Rule out partial stripping
Check whether the site strips latitude and longitude but not other data. This is somewhat common, because copyright data may need to be preserved for legal reasons, and no other data beyond latitude and longitude really gives away possibly sensitive information. If neither this exception nor the uploader-only exception applies, you have likely found a vulnerability.
Step 6: Check the original image, not a resized copy
If you do not initially see the metadata, make sure you are viewing the original image. If you right click and open the profile picture in a new tab, there will often be URL parameters or other modifiers changing the size, quality and so on. Try removing all of these modifiers and downloading that image.
Root cause
The mistake is in how the platform handles uploaded images: it serves them back without stripping Exif metadata, so the location and device data attached by the uploader's camera remains in the publicly downloadable file. The write-up does not describe the server-side implementation.
Impact
An attacker, or any visitor, can download a publicly shared image and read the Exif metadata inside it. Under the conditions described, this can disclose the uploader's exact home location, or other data they may not want to share such as the phone model. The severity increases when the place where images are uploaded is obviously a place for images of the home. For example, a forum topic for home decor images would increase the chances that the latitude and longitude are the home locations of the uploaders, and therefore increase the amount of sensitive information disclosed.
Some images attached to reviews may not qualify, because the image host or review integration may be third-party.
GitLab eventually rolled out a patch, although it took a while. As GitLab specified in the summary, they are aware of tricks to bypass Exif metadata stripping and are working to remediate these, but they do not consider this impactful enough for a valid report. This is likely because the information disclosure comes from the uploader's own end, so it would make no sense for an uploader to bypass the stripping and leak their own information.
Fix
GitLab rolled out a patch, although it took a while. GitLab also stated that it is aware of tricks to bypass Exif metadata stripping and is working to remediate these.
Variants to test
- Profile pictures: upload a JPEG with Exif latitude and longitude, then download it unauthenticated. A positive result is the same coordinates still present in the downloaded file.
- Forum posts and attachments: upload the image to a forum thread and fetch it from a different account. A positive result is the metadata surviving the round trip.
- Review images: check images attached to reviews, keeping in mind that some may not qualify because the image host or review integration is third-party. A positive result is metadata still present in the downloaded image.
- Resized image URLs: take the image URL, remove size and quality modifiers, and download the original. A positive result is metadata present once the URL modifiers are removed.
- Home-related content: look for topics where users would post images of their home, such as home decor. A positive result is location metadata on those images, which raises the severity.
What happened, in plain words
The write-up describes websites where people have public profile pages with images, or forums where images can be posted. When a site publicly shares an uploaded JPEG, it stores it and serves it back to visitors.
Many phones and cameras quietly attach extra information to every photo they take. This hidden information is called Exif metadata. It can include the camera model, the date and time the photo was taken, copyright details, and even the latitude and longitude of where the photo was taken. On many modern smartphones this location data is added by default, unless the owner changes a setting.
If a website hands that image back to visitors without removing the hidden information, then anyone who downloads the picture can read where it was taken. For a photo taken at home, that can mean the uploader's exact home location is exposed, along with details like the phone model. The researcher's tip is simple: always check images for Exif metadata, especially latitude and longitude, on profile pictures and anywhere else images can be shared publicly.
The researcher reported this to GitLab through HackerOne, a platform where security researchers report bugs to companies. GitLab eventually released a fix, although it took a while. GitLab also said it knows about tricks that can get around its Exif stripping and is working on those, but it does not consider this issue serious enough to count as a valid report. The likely reason is that the leak comes from the uploader's own side: it would make no sense for an uploader to deliberately bypass the stripping and leak their own information.
The background you need
What Exif metadata is
Think of a photo as a parcel. The picture itself is what you see, but the parcel can have a label stuck to it with extra details: who sent it, when, and from where. Exif is that label for image files, mostly JPEGs. It is a standard way of storing information inside the file itself, not in a separate database or web page.
Typical Exif fields include:
- the camera or phone model;
- the date and time the photo was taken;
- copyright information;
- the latitude and longitude of the place where the photo was taken.
Because the data lives inside the file, it travels with the file wherever it goes. If a website stores the file as it received it and serves it back unchanged, the label goes with it.
Why this is a privacy problem
Most people do not know their phone is recording their location in every photo. If a site lets people share images publicly, through profile pictures, forum posts and similar, and does not strip the Exif data, then a stranger can download the image and read the coordinates. That can reveal the uploader's exact home location, or other details they never meant to share, such as the phone model.
What the test looks like
The idea is to act like a normal user, but with a photo you prepared yourself. You put location data into a JPEG, upload it to the public spots on the site, download it again, and look at whether the location data survived the round trip. If it did, the site is not stripping the metadata, and you have likely found a vulnerability.
Step by step
Step 1: Prepare an image with location metadata
Create a JPEG image that has Exif latitude and longitude data attached. The report does not say which tools or commands were used to embed the metadata, so there is no code to show here. What matters is that the file contains coordinates you can recognise later, so you can tell whether they are still there after the upload and download.
Why this step: you need a known marker. If you upload a photo with no location data, you cannot tell whether the site stripped anything, because there was nothing to strip.
Step 2: Upload it to public image locations
Upload the prepared JPEG to the places where images are shared publicly: profile pictures, forum posts, and similar spots.
Why this step: the problem only exists where other people can see the image. A private image that only you can open does not expose your location to anyone else.
Step 3: Redownload the image
Download the image back from the site. If the downloaded file still contains the Exif metadata, the platform is not stripping it.
Why this step: uploading alone proves nothing. The question is what the site hands back to visitors. Downloading the file and inspecting it answers that question directly.
Step 4: Check access conditions
When you redownload, always try it while logged out, or while logged in to a different account. You want to see whether the metadata can be reproduced without being logged in as the uploader.
Why this step: there is an exception to the whole finding. If the original image with metadata is only accessible to the uploader, then no one else can read the location, and there is no disclosure. Testing from another account or while logged out rules that case out.
Step 5: Rule out partial stripping
Check whether the site strips latitude and longitude but keeps other data. This is somewhat common, because copyright data may need to be preserved for legal reasons, and no other data beyond latitude and longitude really gives away possibly sensitive information.
Why this step: a site that removes the coordinates has dealt with the privacy risk, even if the camera model or copyright line remains. You should not report a partial result as a full one.
If neither this exception nor the uploader-only exception applies, you have likely found a vulnerability.
Step 6: Check the original image, not a resized copy
If you do not see the metadata at first, make sure you are looking at the original image. If you right click and open the profile picture in a new tab, there will often be URL parameters or other modifiers that change the size, quality and so on. Try removing all of these modifiers and downloading that image.
Why this step: many sites generate smaller or lower-quality copies for display. Those copies may have been processed and stripped, while the original file still carries the metadata. Looking only at the resized version can make you miss the problem, or make you think a site is safe when it is not.
Why it happens
The mistake is in how the platform handles uploaded images: it serves them back without stripping the Exif metadata, so the location and device data attached by the uploader's camera stays in the publicly downloadable file. The report does not describe how GitLab implements this on its servers.
What someone can do with it
Any visitor can download a publicly shared image and read the Exif metadata inside it. Under the conditions described, this can reveal the uploader's exact home location, or other data they may not want to share, such as the phone model.
The severity goes up when the place where images are uploaded is obviously a place for pictures of the home. For example, a forum topic for home decor images would make it more likely that the coordinates are the uploaders' home locations, and therefore increase the amount of sensitive information disclosed.
Some images attached to reviews may not qualify, because the image host or the review integration may belong to a third party.
The fix and GitLab's position
GitLab eventually rolled out a patch, although it took a while. GitLab also stated that it is aware of tricks to bypass Exif metadata stripping and is working to remediate these, but it does not consider this impactful enough for a valid report. The likely reason is that the information disclosure comes from the uploader's own end, so it would make no sense for an uploader to bypass the stripping and leak their own information.
Other places to try the same test
- Profile pictures: upload a JPEG with Exif latitude and longitude, then download it while logged out. A positive result is the same coordinates still present in the downloaded file.
- Forum posts and attachments: upload the image to a forum thread and fetch it from a different account. A positive result is the metadata surviving the round trip.
- Review images: check images attached to reviews, keeping in mind that some may not qualify because the image host or review integration is third-party. A positive result is metadata still present in the downloaded image.
- Resized image URLs: take the image URL, remove size and quality modifiers, and download the original. A positive result is metadata present once the URL modifiers are removed.
- Home-related content: look for topics where users would post images of their home, such as home decor. A positive result is location metadata on those images, which raises the severity.
Glossary
- Exif metadata: hidden information stored inside an image file, such as camera model, date and time, copyright, and the latitude and longitude where the photo was taken.
- JPEG: a common image file format, and the format where Exif metadata is most often found.
- Latitude and longitude: the pair of numbers that describes a point on the Earth's surface, in other words a location.
- Metadata: data about data, extra details stored alongside the main content rather than in it.
- Vulnerability: a weakness in a website or system that lets someone do something the owners did not intend, such as reading private information.
- Information disclosure: a vulnerability class where data that should stay private becomes visible to people who should not see it.
- Profile picture: the image a user chooses to represent their account on a public profile page.
- Forum post: a message on a discussion board on a website, which can include attached images.
- Authenticated: logged in, meaning the site knows which account is making the request.
- Unauthenticated: not logged in, meaning anyone, including a stranger, can make the request.
- URL parameter: the part of a web address after a question mark that passes extra settings, such as an image size or quality.
- Modifier: a value in an image URL that changes how the image is produced, for example its size or quality.
- Third party: a company or service other than the one running the site you are testing.
- Patch: a change to software that fixes a problem.
- Severity: how serious a vulnerability is judged to be, usually based on how much harm it could cause.
- HackerOne: a platform where security researchers report vulnerabilities to companies and companies respond.
- Bypass: a way of getting around a protection, such as a filter that is meant to remove metadata.