Payload in EXIF
Google Scholar rendered user-uploaded images from the same origin and used location.hash parameters with XHR to fetch and render templating snippets unescaped, allowing an attacker to upload a crafted image containing an XSS payload that survived image processing. An attacker could execute JavaScript in the context of Google Scholar.
Published on blog.doyensec.com
A few months ago I came across a curious design pattern on Google Scholar. Multiple screens of the web application were fetched and rendered using a combination of location.hash parameters and XHR to retrieve the supposed templating snippets from a relative URI, rendering them on the page unescaped.
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 rendered user-controlled data from location.hash and XHR responses without escaping, and allowed user-uploaded images to be served from the same origin, enabling stored XSS via a polymorphic image.
Impact
An attacker could execute JavaScript in the context of Google Scholar, potentially compromising user accounts or data, though the text does not detail specific consequences beyond XSS.
What the attacker needed
Ability to upload an image; victim views the crafted image; image processing preserves payload
How it was found
- Craft a base image with the same quality factors as images resulting from the server's conversion.
- Embed the payload in the JPG's entropy-coded data segment (ECS) and adjust byte patterns so it survives transformation.
- Upload the crafted image to Google Scholar's image upload functionality.
- The uploaded image is served from the same origin and rendered, executing the payload.
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.
The website took parts of the page address (the bit after the # symbol) and used them to load and display content without cleaning it first. Because users could upload images that were served from the same website, an attacker could hide a small script inside an image file. When the image was displayed, the script ran in the victim's browser as if it came from the trusted site.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.