Skip to content
XSS Disclosed report Beginner

XSS in https://www.coursera.org/courses/

The search results page reflected the 'query' parameter without proper encoding when the parameter was supplied as an array, allowing an attacker to inject HTML and JavaScript. An attacker could execute arbitrary scripts in a victim's browser by crafting a malicious link.

David Vieira-Kurz Follow

Originally disclosed on HackerOne

  • Triaged in under an hour
  • Fixed in 6 hours
  • Disclosed after 5 months

DESCRIPTION

It has been identified that the page located at https://www.coursera.org/courses/ is prone to cross-site scripting issues. Cross-site Scripting (XSS) refers to client-side code injection attack wherein an attacker can execute malicious scripts (also commonly referred to as a malicious payload) into a legitimate website or web application.

IMPACT

A XSS vulnerability arises when web applications take data from users and dynamically include it in web pages without first properly validating the data. XSS vulnerabilities allow an attacker to execute arbitrary commands and display arbitrary content in a victim user's browser. A successful XSS attack leads to
an attacker controlling the victim’s browser or account on the vulnerable web application.

TEST ENVIRONMENT

  1. Firefox 45.0 on Mac OS X 10.11.3

PROOF OF CONCEPT

Please use the Mozilla Firefox Browser to verify the identified issue!

  1. legit request: https://www.coursera.org/courses/?query=coursera

  2. If you try to pass a xss payload to the "query" param as string it will be encoded correctly and is therefore not vulnerable - but if you now change the „query“ param to „query[]“ you will be able to inject html and javascript code.

2.1) proof of concept 1: https://www.coursera.org/courses/?query[]=secalert%22/%3E%3Cmarquee+onstart=alert(document.domain)%3E

2.2) Proof of Concept 2: https://www.coursera.org/courses/?query[]=secalert%22/%3E%3Cimg%20src=secalert%20onerror=confirm%28document.domain%29%3E

It will be rendered like this:

HTML
<span data-reactid=".255dmgqjchs.1.1.1.2.1.0.0">You searched for <strong>secalert"/><marquee onstart=alert(document.domain)></strong>.</span>

SCREENSHOT

Screenshots are attached.

REMEDIATION

  1. All input should be neutralized before being reflected back to client (i.e.
browser), not just parameters that the user is supposed to specify, but all data
in the request, including hidden fields, cookies, headers, the URL itself, and
 so forth.
  2. Make use of entity encoding in the used context. See also:
https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet

CREDITS

David Vieira-Kurz aka @secalert (https://hackerone.com/secalert)

Attachments

coursera-xss-1.png
coursera-xss-1.png From the original on HackerOne
coursera-xss-2.png
coursera-xss-2.png
coursera-xss-3.png
coursera-xss-3.png

The original report as published on HackerOne, by secalert. 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 commands and display arbitrary content in a victim user's browser, potentially controlling the victim's browser or account on the vulnerable web application.

What the attacker needed

Use Firefox browser

The fix

All input should be neutralised before being reflected back to the client, using entity encoding appropriate to the context.

How it was found

  1. Open the legitimate search URL with a normal query parameter.
  2. Change the parameter name from 'query' to 'query[]' and supply a crafted value containing HTML and JavaScript.
  3. Load the modified URL in Firefox and observe the script executing.

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.

The site showed the search term back without cleaning it when sent as a list, letting an attacker run code in your browser.

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 David Vieira-Kurz

View all

3 more disclosed reports, best first.

More from Coursera

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.