IDOR with Geolocation data not stripped from images
Uploaded profile images retained EXIF metadata including geolocation, and an IDOR in the image URL allowed one user to view another user's image. An attacker could then extract the victim's location and camera details.
Originally disclosed on HackerOne
- Fixed in 41 hours
- Paid in 15 hours
- Disclosed after 32 days
Vulnerable URL :- ████
Vulnerability Discription: When an image is taken using a smartphone or camera certain metadata fields are often attached to it. These fields could include the model of the camera, the time it was taken, whether the flash was used, the shutter speed, focal length, light value and even the location. In Inturn, while uploading the image as a profile picture, the exif data is not stripped from images. The exif data in images contains sensitive data like Geoloacation, latitude, longitude, etc. Also it contains the camera information and other details.
And your website vulnerable to image IDOR which allows attacker to see other users images and retrive data using tool.
Tools Used: exiftool.
Steps TO reproduce:
Use 2 accounts in two browser
Download images from here
https://github.com/ianare/exif-samples/tree/master/jpg/gps
1)In 1st account in network user can upload files just upload the image their and open image link in new tab.
new tab that image url like
██████████
2)In second account do same things and that url like down
█████
-
Change 1st account Url parameter value to 2nd acoount Url parameter(see poc for it).
-
now image will shows up copy that url again and paste it to image data retrival website
http://exif.regex.info/exif.cgi
- and see sensitive data exposed.
Impact
- By this the attacker tracks your location and use it for personal things.
- Sensitive data exposed.
Context
IRCCloud is a web based IRC client. The feature involved here is the profile picture upload: a user uploads an image in the network settings and the application stores it and serves it back through a URL that contains an identifier for the image.
The report describes a single attack that relies on two weaknesses. The first is that the uploaded image keeps its EXIF metadata, including GPS coordinates. The second is an insecure direct object reference (IDOR) on the image URL, which lets one user reach another user's uploaded image. Neither problem alone gives an attacker much, but together they let an attacker pull a victim's photo and read the location where it was taken.
The vulnerable URL is redacted in the report, so the exact endpoint is not shown.
Setup
To reproduce the issue the researcher needed:
- Two accounts, each open in a separate browser.
- Sample images with GPS EXIF data, taken from a public sample set:
https://github.com/ianare/exif-samples/tree/master/jpg/gps
exiftool, used to inspect the metadata.- A third party EXIF viewer at
http://exif.regex.info/exif.cgi, used to read the metadata from a URL rather than a local file.
No special role or privilege is required. Any user who can upload a profile picture is enough.
Finding it
The researcher starts from a general observation about photography: images taken with a smartphone or camera often carry metadata fields such as the camera model, the time the picture was taken, whether the flash fired, the shutter speed, the focal length, the light value and the location. When the image is uploaded as a profile picture, the application does not strip this EXIF data, so the sensitive fields, geolocation, latitude and longitude among them, stay in the stored file.
On its own that is only a privacy leak to whoever can download the image. The second observation makes it exploitable: the image URLs are vulnerable to an IDOR, so an attacker can view other users' images and retrieve their data with a tool. The report does not describe how the identifier in the URL is constructed, only that changing it reaches another user's image.
Exploitation
Step 1: upload an image in the first account
In the first account, in the network settings, upload one of the sample images and then open the image link in a new tab. The resulting image URL looks like this (redacted in the report):
Step 2: upload an image in the second account
Do the same in the second account. Its image URL looks like this (redacted in the report):
The report says to change a URL parameter value from the first account to the second account's value.
Step 3: swap the parameter
Take the URL from the first account and replace its parameter value with the value from the second account's URL. The report refers to a proof of concept for the exact change but does not include it, so the precise parameter name and format are not shown here.
Step 4: confirm the image is served
After the swap the image from the other account is displayed. After the swap the image from the other account is displayed, which the report treats as the IDOR.
Step 5: read the metadata
Copy the working URL and submit it to the online EXIF viewer:
http://exif.regex.info/exif.cgi
The viewer fetches the image and parses its EXIF block, exposing the sensitive fields, including the geolocation, latitude and longitude, along with the camera information and other details. The same data can be read locally with exiftool, which the researcher lists as the tool used.
Root cause
Two failures line up:
- EXIF data is not stripped on upload. The application does not strip EXIF data on upload, so the metadata, GPS position included, stays in the stored image. A profile picture pipeline that re-encodes the image, or explicitly removes the EXIF block, would have removed the sensitive data before it was ever stored.
- The image URL is an insecure direct object reference. The image is addressed by an identifier in the URL, and the server returns the image for any identifier supplied, without checking that the authenticated user is entitled to it. The report does not say whether the identifier is sequential, guessable or otherwise enumerable, only that substituting one account's value for another's works.
That assumption fails as soon as one identifier is known or can be derived.
Impact
The researcher lists two consequences:
- An attacker can track the victim's location and use it for personal purposes.
- Sensitive data is exposed.
The exposure depends on the uploaded image actually carrying GPS EXIF data, which is common for photos taken with a smartphone but not guaranteed. Within those conditions, the combination of the IDOR and the retained metadata turns a profile picture into a location disclosure.
Fix
Based on the two root causes, the changes needed are:
- Strip EXIF metadata from uploaded images, for example by re-encoding them server side, so that GPS and camera details never reach storage or clients.
- Enforce an authorisation check on the image endpoint: resolve the identifier to its owner and confirm that the requesting user is allowed to see that image, rather than serving any image for any identifier.
Variants to test
- Other upload surfaces. Try the same substitution on avatars, attachments, banners and any other user supplied image. A positive result is another user's image returned for an identifier you do not own.
- Identifier enumeration. If the image identifier is numeric or otherwise predictable, walk neighbouring values and check whether images from other accounts come back. A positive result is a run of valid images belonging to unrelated users.
- Metadata on other file types. Check whether documents, PDFs and videos keep author, GPS or device metadata after upload. A positive result is metadata from the original file visible in the downloaded object.
- Thumbnails and derived sizes. Request resized or cached variants of the image URL with a substituted identifier. A positive result is a derivative that still serves another user's image, sometimes with the metadata intact.
- Unauthenticated access. Repeat the substituted request without a session. A positive result is the image returned to an anonymous client.
Hunting notes
This class of bug hides where user supplied files are addressed by an identifier in a URL and served back without an ownership check: profile pictures, attachments, exported reports, generated PDFs. During recon, upload an image yourself, note the URL shape, and look for a parameter that looks like a record ID rather than an opaque token. If it is a small integer, the endpoint is worth testing with a second account.
The metadata half is easy to miss because it is invisible in the browser. Download your own uploaded image and run exiftool on it, or point an online EXIF viewer at the URL, to see whether the original metadata survived the upload pipeline.
The researcher demonstrated the chain with two accounts, a substituted identifier that returned the other account's image, and metadata read through a public EXIF viewer.
What happened, in plain words
IRCCloud is a website that lets people connect to IRC, an old chat system, from a normal browser. One of its features lets you upload an image in the network settings, and the site stores it and gives it back through a web address (a URL) that contains an identifier for that image.
Two separate weaknesses were found in that feature, and they only become serious when combined.
The first is about hidden information inside photo files. When a phone or a camera takes a picture, it usually writes extra details into the file alongside the pixels: the camera model, the date and time, whether the flash fired, the shutter speed, the focal length, the light value, and often the exact place on Earth where the photo was taken. This bundle of extra details is called EXIF metadata. It is invisible when you look at the picture in a browser, but it travels with the file. IRCCloud did not remove this metadata when it accepted the uploaded image, so the location and camera details stayed inside the stored image.
The second weakness is called an insecure direct object reference, or IDOR. In plain terms: the site hands out each image at an address that contains an identifier, and the server returns whatever image matches the identifier you ask for, without checking that the image actually belongs to you. Imagine a hotel where every room key is just the room number written on a card, and the front desk never checks whether the number is your room. If you know or guess another number, you get into that room.
Neither problem is dramatic alone. Metadata that nobody can reach is just a privacy detail. An image you can reach but that contains no location is just a photo. Together, they let an attacker fetch another person's profile picture and read the place where it was taken.
The report redacts the vulnerable URL, so the exact address of the feature is not shown here.
Setting up the test
To reproduce the issue the researcher needed a small set of things:
- Two accounts, each open in a separate browser. Two accounts are needed because the whole point is to show that one user can reach the other user's image. Two separate browsers keep the two logged-in sessions apart, since a browser normally holds one login per site at a time.
- Sample images that already contain GPS data in their metadata, taken from a public collection of test images:
https://github.com/ianare/exif-samples/tree/master/jpg/gps
This is a folder on GitHub, a site where people publish code and files. The folder holds JPEG photos that were deliberately made with location data inside them, so you do not need a phone of your own to test. Using a known sample also makes the test repeatable: anyone can download the same file and expect the same result.
exiftool, a free command-line program whose only job is to read and write the metadata inside files. It is used to inspect what is hidden in an image.- A third-party EXIF viewer at
http://exif.regex.info/exif.cgi. This is a website that takes a link to an image, downloads the image itself, and shows you the metadata it finds. It is useful here because the image lives on IRCCloud's server, not on the researcher's computer, so pointing a viewer at the URL is quicker than downloading the file first.
No special role or privilege is required. Any ordinary user who is allowed to upload a profile picture is enough to try this.
Finding it
The researcher starts from a general fact about photography: pictures taken with a smartphone or a camera often carry metadata fields such as the camera model, the time the picture was taken, whether the flash fired, the shutter speed, the focal length, the light value and the location. When such an image is uploaded as a profile picture, IRCCloud does not strip this EXIF data, so the sensitive fields, geolocation, latitude and longitude among them, remain in the stored file.
On its own that is only a privacy leak to whoever can download the image. The second observation is what makes it exploitable: the image URLs are vulnerable to an IDOR, so an attacker can view other users' images and retrieve their data with a tool. The report does not describe how the identifier in the URL is built, only that changing it reaches another user's image.
Carrying out the attack
Step 1: upload an image in the first account
In the first account, in the network settings, upload one of the sample images, then open the image link in a new tab. The resulting image URL looks like this (redacted in the report):
Why this step: you need a real image on the server to look at. Opening the link in a new tab shows you the address the site uses to serve that image, which is the thing you are going to tamper with. A URL is just the address of a page or file on the web; the part after a question mark or slash that identifies a specific item is often called a parameter.
Step 2: upload an image in the second account
Do the same in the second account. Its image URL looks like this (redacted in the report):
Why this step: you now have two addresses that are almost identical, one for each account. The report says to change a URL parameter value from the first account to the second account's value.
Step 3: swap the parameter
Take the URL from the first account and replace its parameter value with the value from the second account's URL. The report refers to a proof of concept for the exact change but does not include it, so the precise parameter name and format are not shown here.
Why this step: this is the actual test. If the server checked ownership, asking for the second account's image while logged in as the first account would be refused. If it only looks at the identifier, it will happily hand over the image.
Step 4: confirm the image is served
After the swap the image from the other account is displayed. After the swap the image from the other account is displayed, which the report treats as the IDOR.
Why this step matters: seeing the other account's picture appear is the proof. Without it, you only have a suspicion about how the site works.
Step 5: read the metadata
Copy the working URL and submit it to the online EXIF viewer:
http://exif.regex.info/exif.cgi
Why this step: the metadata is invisible in the browser, so you need a tool that opens the file and lists the hidden fields. The viewer fetches the image from the URL and parses its EXIF block, exposing the sensitive fields, including the geolocation, latitude and longitude, along with the camera information and other details. The same data can be read locally with exiftool, which the researcher lists as the tool used.
Why it worked
Two failures line up:
- EXIF data is not stripped on upload. The application does not strip EXIF data on upload, so the metadata, GPS position included, stays in the stored image. A profile picture pipeline that re-encodes the image, or explicitly removes the EXIF block, would have removed the sensitive data before it was ever stored. Re-encoding means opening the picture and saving it again in a fresh file, which keeps the pixels but drops the extra details.
- The image URL is an insecure direct object reference. The image is addressed by an identifier in the URL, and the server returns the image for any identifier supplied, without checking that the logged-in user is entitled to it. The report does not say whether the identifier is sequential, guessable or otherwise enumerable, only that substituting one account's value for another's works.
That assumption fails as soon as one identifier is known or can be worked out.
Impact
The researcher lists two consequences:
- An attacker can track the victim's location and use it for personal purposes.
- Sensitive data is exposed.
The exposure depends on the uploaded image actually carrying GPS EXIF data, which is common for photos taken with a smartphone but not guaranteed. Within those conditions, the combination of the IDOR and the retained metadata turns a profile picture into a location disclosure.
The fix
Based on the two root causes, the changes needed are:
- Strip EXIF metadata from uploaded images, for example by re-encoding them on the server, so that GPS and camera details never reach storage or clients.
- Enforce an authorisation check on the image endpoint: look up who owns the identifier and confirm that the requesting user is allowed to see that image, rather than serving any image for any identifier.
Other places to try the same idea
- Other upload surfaces. Try the same substitution on avatars, attachments, banners and any other user supplied image. A positive result is another user's image returned for an identifier you do not own.
- Identifier enumeration. If the image identifier is numeric or otherwise predictable, walk neighbouring values and check whether images from other accounts come back. A positive result is a run of valid images belonging to unrelated users. Enumeration simply means trying values one after another, like 1, 2, 3.
- Metadata on other file types. Check whether documents, PDFs and videos keep author, GPS or device metadata after upload. A positive result is metadata from the original file visible in the downloaded object.
- Thumbnails and derived sizes. Request resized or cached variants of the image URL with a substituted identifier. A positive result is a derivative that still serves another user's image, sometimes with the metadata intact. A thumbnail is a small copy the site generates for display.
- Unauthenticated access. Repeat the substituted request without a session. A positive result is the image returned to an anonymous client. A session is the state of being logged in; without one, the server should treat you as a stranger.
Notes for anyone hunting this kind of bug
This class of bug hides where user supplied files are addressed by an identifier in a URL and served back without an ownership check: profile pictures, attachments, exported reports, generated PDFs. During recon, upload an image yourself, note the shape of the URL, and look for a parameter that looks like a record ID rather than an opaque token. If it is a small integer, the endpoint is worth testing with a second account.
The metadata half is easy to miss because it is invisible in the browser. Download your own uploaded image and run exiftool on it, or point an online EXIF viewer at the URL, to see whether the original metadata survived the upload pipeline.
The researcher demonstrated the chain with two accounts, a substituted identifier that returned the other account's image, and metadata read through a public EXIF viewer.
Glossary
- API: a way for one piece of software to talk to another, like a waiter taking your order to the kitchen and bringing back the dish.
- Authorisation: the check that decides whether a logged-in user is allowed to do or see a particular thing.
- Bounty: a payment a company makes to someone who reports a security problem responsibly.
- Cache: a stored copy kept so the same thing can be served again faster.
- Cookie: a small piece of data a website stores in your browser so it can recognise you on later requests.
- Endpoint: a specific address on a server that accepts requests, for example the address that serves an image.
- Enumeration: trying values one after another, such as 1, 2, 3, to find which ones exist.
- EXIF: extra information written into a photo file by the camera, such as model, time, settings and sometimes GPS position.
- exiftool: a free command-line program for reading and writing metadata inside files.
- Focal length: a camera setting describing how zoomed in the lens was.
- Geolocation: the real-world location of something, usually expressed as latitude and longitude.
- GPS: the satellite system phones use to work out where they are.
- IDOR (Insecure Direct Object Reference): a flaw where a site lets you reach someone else's item just by changing the identifier in a request, because it never checks that the item is yours.
- Identifier: a value that names one specific item, such as an image or a record.
- IRC: Internet Relay Chat, an old text chat system that people connect to through a client.
- IRCCloud: a web based client for IRC, meaning you use IRC through a normal browser page.
- JPEG: a common image file format used by most cameras and phones.
- Latitude and longitude: the two numbers that pin a point on the Earth's surface.
- Metadata: data about data; here, the extra details stored inside a file alongside its actual content.
- Parameter: a part of a URL that carries a value, often naming which item you want.
- Privacy leak: exposure of information that was not meant to be public.
- Profile picture: the image a user chooses to represent their account.
- Proof of concept (PoC): a small demonstration showing that a problem is real.
- Recon: the early stage of testing where you look around a site to understand how it is built.
- Re-encode: open a file and save it again in a fresh copy, which keeps the content but drops extra embedded details.
- Redacted: hidden or blacked out in a published document, usually to avoid revealing something sensitive.
- Request: a message your browser sends to a server asking for a page, file or action.
- Server: the computer that stores a website and answers requests from browsers.
- Session: the state of being logged in, usually kept alive by a cookie or token.
- Shutter speed: a camera setting describing how long the sensor was exposed to light.
- Thumbnail: a small copy of an image made for quick display.
- Token: a value that stands in for something else, often used to prove who you are or to name an item without revealing its real identity.
- URL: the address of a page or file on the web.
- Vulnerability: a weakness in software that someone could abuse.