Skip to content
XSS Write-up Beginner

Stored XSS via PDF Upload in Live chat⚠️

A live chat file upload accepted a PDF containing embedded JavaScript, which was stored on a third-party CDN and executed when opened from the chat. An attacker could run arbitrary JavaScript in the browser of any user or support agent who opens the file.

firdansp Follow

Published on medium.com

Today I’m sharing a critical Stored Cross-Site Scripting (XSS) I found that leverages PDF uploads in a live chat integration.

0verRida, 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 upload pipeline did not strip active PDF content such as /OpenAction and served the file inline from a CDN, so the browser's PDF viewer executed the embedded script.

Impact

Arbitrary JavaScript could run in the browser of any user or support agent who opens the uploaded PDF, potentially leading to session hijacking, credential theft, phishing or account takeover.

What the attacker needed

Ability to upload a file in live chat; victim opens the uploaded PDF link

The fix

The upload should strip active PDF objects such as /OpenAction, serve files as attachments with security headers, and scan uploads before making them available.

How it was found

  1. Open the live chat widget on the site.
  2. Upload a PDF containing an embedded JavaScript action.
  3. The file is stored on the third-party file host and appears in the chat.
  4. Click the file link in the chat, which opens a new tab to the hosted file.
  5. The browser executes the embedded JavaScript and shows a popup.

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 PDF file can contain small programs (JavaScript) that some browser PDF viewers run when the file is opened. The chat let people upload such a PDF and then served it from a file host, so opening the link ran that program in the viewer's browser. This is called stored cross-site scripting because the harmful file stays saved and affects anyone who opens it.

What is XSS?

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

More by firdansp

View all

5 more disclosed reports, best first.

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.