Skip to content
SSRF Write-up Intermediate

It’s Just a Preview… Until It Isn’t: File Previews That Lea

A document preview endpoint rendered uploaded files without sandboxing, allowing script execution in the previewer, and also fetched arbitrary URLs supplied by the user. The author claims this let them reach internal services, the cloud metadata service, and obtain cloud credentials that gave access to storage buckets.

iski Follow

Published on medium.com

Free Link🎈

Iski, 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 preview renderer neither sandboxed rendered documents nor restricted which URLs the server-side fetcher could request, so user input reached internal services and the cloud metadata endpoint.

Impact

The author claims script execution in the previewer, internal network access, leaked cloud credentials and exposure of personal data in storage buckets; the text does not show any defence limiting the attack.

What the attacker needed

Ability to upload a document; ability to submit a URL to preview; no allowlist on fetched URLs

The fix

Preview renderers should be sandboxed and the URLs they may fetch should be validated against an allowlist, with metadata services blocked.

How it was found

  1. Find the document preview endpoint during subdomain enumeration.
  2. Upload a document containing script and preview it to confirm script execution.
  3. Send a request with the url field pointing at a localhost address to confirm server-side request forgery.
  4. Point the url field at the cloud metadata service to read instance information.
  5. Request the metadata path for the instance role's credentials.
  6. Use the returned credentials with the cloud CLI to list and copy bucket contents.

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.

A preview feature takes a file or a link and shows it back to you. Here it did two risky things: it ran any script inside the uploaded file in the browser, and it would fetch any web address it was given, including addresses only the server can normally reach. That let the author read internal pages and cloud credentials that should never have been reachable from outside.

What is SSRF?

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.

More by iski

View all

186 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Server-side request forgery (SSRF)

The lesson behind this report.

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.