Skip to content
XSS Write-up Intermediate

How I Earned My First $200 Bounty

A stored cross-site scripting vulnerability existed in the Media Manager feature, where a PDF file containing embedded JavaScript executed when opened by any project member. An attacker could run arbitrary JavaScript in a victim's session, potentially leading to session hijacking or data theft.

medium.com

Published on medium.com

As a bug bounty hunter, landing your first accepted vulnerability is an exciting milestone. Recently, I discovered a Stored Cross-Site Scripting (XSS) vulnerability on app.example.com, specifically in the project’s Media Manager feature.

TakiasSec, 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 rendered uploaded PDFs in a context that allowed embedded JavaScript to execute in the browser's origin, rather than isolating the PDF in a sandbox or separate viewer.

Impact

An attacker could run arbitrary JavaScript in any project member's session, potentially leading to session hijacking, data theft, or unauthorised actions.

What the attacker needed

Access to a project's Media Manager; victim opens the uploaded PDF

The fix

The issue should be fixed by sanitising PDF uploads and sandboxing file previews so embedded JavaScript cannot run in the browser's context.

How it was found

  1. Go to the Media Manager section of a project.
  2. Upload a PDF file that contains embedded JavaScript.
  3. Click the uploaded PDF in the Media Manager to preview it.
  4. Observe that the embedded script executes in the browser.
  5. Invite another project member and have them click the same PDF; the script executes in their session too.

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.

This is a stored cross-site scripting (XSS) bug. Normally, a PDF's JavaScript should only run inside the PDF reader, not in the web page. Here, the application previewed the PDF in a way that let the script run as if it were part of the website, so it could act with the victim's logged-in permissions.

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.