Skip to content
XSS Write-up Intermediate

Riding the Waves of API Versioning: Unmasking a Stored XSS Vulnerability, CSP Bypass Using YouTube OEmbed

A stored cross-site scripting vulnerability existed in the URL input field of a document upload feature, where the v3 API accepted arbitrary text without requiring a https:// prefix. An attacker could inject a script tag that bypassed the Content Security Policy by loading a script from YouTube's oEmbed endpoint, leading to script execution in the context of the preview page.

Syed Mushfik Hasan Tahsin Follow

Published on infosecwriteups.com

Hello, as some of you already know me, I’m Syed Mushfik Hasan Tahsin aka SMHTahsin33. And for those who doesn’t, I’m a 19 Y/O Cyber Security Enthusiast from Bangladesh with 3+ years of experience.

SMHTahsin33, on infosecwriteups.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

Impact

An attacker could execute arbitrary JavaScript in the context of the preview page when a victim views a malicious document, potentially leading to account compromise or data theft, though the report only demonstrates an alert popup.

What the attacker needed

Ability to create documents; victim views the preview page

How it was found

  1. Send a POST request to /v3/items with the required parameters to create an item, including a URL field containing a script payload.
  2. Add the created document to a project and open its preview page.
  3. Observe that the payload is reflected inside double quotes and escapes them, but the script is blocked by CSP.
  4. Craft a payload that loads a script from YouTube's oEmbed endpoint with a callback parameter to execute JavaScript.
  5. Add the new document to the project and visit the preview page to see the alert 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.

This report describes a stored cross-site scripting (XSS) bug. XSS lets an attacker inject malicious JavaScript into a web page that other users view, so the script runs in their browser. Here, the attacker could put a script into a document's URL field, and when someone previewed that document, the script would run, but only after bypassing a security rule called Content Security Policy (CSP) that normally blocks such scripts.

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.