Skip to content
XSS Disclosed report Intermediate

XSS on https://www.udemy.com/asset/export.html

The file title parameter in the asset upload endpoint was not sanitised, allowing an attacker to inject HTML and JavaScript. When the lecture was previewed, the Flash player fetched a JSON endpoint that served content as text/html, causing the injected script to execute in the victim's browser.

adrianbelen Follow

Originally disclosed on HackerOne

  • Triaged in 6 days
  • Fixed in 3 months
  • Paid in 4 months
  • Disclosed after 5 months

##Description https://www.udemy.com/asset/export.html is used to generate a content of a lecture and it will be dispalyed on https://www.udemy.com/staticx/udemy/flash/udemypresentation.player.swf?. https://www.udemy.com/asset/export.html contain json response but the content type is text/html, allowing the browser to render some html tag

Step to Reproduces

https://www.udemy.com/asset/add-submit/?type=Presentation containing the file and the file title. the vulnerable parameter is the file title so put your XSS payload on this parameter

Dump Request

POST /asset/add-submit/?type=Presentation HTTP/1.1 Host: www.udemy.com Connection: keep-alive Content-Length: 301 Accept: application/json, text/javascript, */*; q=0.01 X-NewRelic-ID: XAcEWV5ADQIBUlNW Origin: https://www.udemy.com X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 DNT: 1 Referer: https://www.udemy.com/course-manage/edit-curriculum?courseId=497324 Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.8,et;q=0.6,fil;q=0.4

##(removed cookie) type=Presentation&title="><svg/onload=javascript:alert(2);>Neglected+DNS+Records+Exploited+To+Takeover+Subdomains+Yassine+ABOUKIR&isSubmitted=1&csrf=dc5d07dd336b1ab185623b1f83fd932e&file=2015-05-14_06-09-55__Neglected_DNS_records_exploited_to_takeover_subdomains___Yassine_ABOUKIR.pdf&displayType=ajax

###Working PoC https://www.udemy.com/asset/export.html?displayType=json&uaid=E0AYcFhSR3oT&uaidh=bffae6ad200b35970a667b0e2baab6e5&ulid=E0ESc1laTHgT&ulidh=1c92156b2841b96203cfb7f464fe4f18&uuid=E0ofdFZaQ3QT&uuidh=b1e2facab92aeba9d7f6936302ebf022

The original report as published on HackerOne, by adrianbelen. 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

Root cause

Likely the application failed to sanitise user-supplied input (the file title) before reflecting it in an HTML context, and the export endpoint served JSON with a text/html content type, enabling script execution.

Impact

An attacker could run JavaScript in a victim's browser when the victim previews a lecture.

What the attacker needed

Attacker can create a course; victim previews the lecture

How it was found

  1. Create a new course and go to the curriculum tab.
  2. Add new content to a lecture and select presentation, then upload a PDF file.
  3. Submit the file with a malicious file title via the add-submit endpoint.
  4. Preview the lecture as instructor or student to trigger the Flash player request to the export endpoint.

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.

When you upload a file, the website saves the title you give it. The site later shows that title on a page without cleaning it, so if you put special code in the title, the browser runs it as if it were part of the website. This lets an attacker run their own code in another user's session.

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 adrianbelen

View all

4 more disclosed reports, best first.

More from Udemy

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.