Skip to content
XSS Disclosed report Beginner

XSS when clicking "Share to Twitter" at quora.com/widgets/embed_iframe?path=...

A question title containing double quotes was inserted into the href attribute of a 'Share to Twitter' button without proper escaping, allowing an attacker to inject JavaScript. When a victim clicked the button, the injected script executed in the context of the Quora page.

stefanovettorazzi Follow

Originally disclosed on HackerOne

  • Triaged in 2 months
  • Fixed in 5 months
  • Paid in 2 months
  • Disclosed after 5 months

Summary: The endpoint at https://{language}.quora.com/widgets/embed_iframe?path={path_to_answer_in_same_language} shows the answer you specify in path (like /Question/answer/User) in a format useful to embed. There is one button Share that when clicked shows another button Share to Twitter. The href attribute of this last button is of the format javascript: window.open("https://twitter.com/intent/tweet?text=Answer on @Quora by @User to Question? http://qr.ae/nnnn", "Share Answer to Twitter", "width=600, height=250"). The problem is that you can create a question with " (quotes) and inject Javascript code that is going to be executed when the user clicks Share to Twitter.

Description (Include Impact): It requires user interaction, but it works.

Steps To Reproduce

  1. Go to https://www.quora.com/
  2. Click on Ask Question
  3. Enter a valid question which includes "-alert(document.domain)-" somewhere. I entered Question ignore "-alert(document.domain)-"? and it was accepted as valid
  4. Now you may be in the page of the question you just asked
  5. Click on Answer
  6. Enter anything
  7. Click on Submit
  8. Copy the path from the address bar. Mine was /Question-ignore-alert-document-domain/answer/Cuenta-Para-Probar
  9. Go to https://www.quora.com/widgets/embed_iframe?path={path_from_last_step}. Mine is https://www.quora.com/widgets/embed_iframe?path=/Question-ignore-alert-document-domain/answer/Cuenta-Para-Probar
  10. Click on Share
  11. Click on Share to Twitter
  12. alert(document.domain) is executed

Optional: Your Environment (Browser version, Device, app version, os version etc)

  • It is not browser dependent. Anyway, I tested it on Firefox, Chrome and Safari for Mac.

Optional: Supporting Material/References (Screenshots)

  • I don't think is necessary, but let me know if you need something else.

The original report as published on HackerOne, by stefanovettorazzi. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report 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 Quora embed page when a victim clicked the share button, though user interaction was required.

What the attacker needed

Victim clicks Share then Share to Twitter; attacker can create a question with a crafted title

How it was found

  1. Go to Quora and click Ask Question.
  2. Enter a question that includes a double quote and JavaScript code, such as a quote followed by an alert.
  3. Answer the question and submit the answer.
  4. Copy the path of the answer from the address bar.
  5. Open the embed iframe URL with that path.
  6. Click Share, then click Share to Twitter; the script executes.

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 report has not been written yet. The Original tab links to the source.

A website sometimes puts user-supplied text into a link's address. If that text contains a double quote, it can break out of the link and add a script command. Here, a question title with a quote let the attacker add JavaScript that ran when someone clicked a share button.

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 stefanovettorazzi

View all

17 more disclosed reports, best first.

More from Quora

View all

The newest disclosed reports for this program.

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.