Skip to content
XSS Write-up Intermediate

HTML Injection via EXIF MetaData

Uploaded profile images retained full EXIF metadata, and the application rendered HTML present in that metadata. An attacker could expose precise GPS and device information and render phishing forms to harvest credentials, leading to account takeover.

medium.com

Published on medium.com

How leaking EXIF metadata plus improper output encoding turned a profile-photo endpoint into a 1‑Click account take‑over vector — and how to fix it.

Utkarsh Srivastava, on medium.com

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 application stored uploaded images with their EXIF metadata intact and then inserted metadata fields into HTML without encoding or sanitisation.

Impact

A crafted image could expose EXIF fields such as GPS and device data and render UI elements like a form that captures user input, enabling phishing that could lead to account takeover.

What the attacker needed

A free account; ability to upload an image; victim views the profile photo

The fix

The application should strip all EXIF metadata from uploaded images on the server before storage or serving, and if metadata must be displayed, treat every field as untrusted and apply context-appropriate encoding or escaping.

How it was found

  1. Create an account and go to profile settings.
  2. Upload an image that contains extra EXIF metadata with HTML-like content.
  3. Open the profile-photo endpoint that serves the uploaded image or metadata.
  4. Observe that the server returns full metadata and the viewer renders HTML-like content.

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.

When you upload a photo, it can carry hidden data called EXIF, such as where it was taken and what camera was used. This site showed that hidden data on a page without cleaning it, so someone could put a fake login form inside the photo's data. Visitors might then type their password into that fake form.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.