Skip to content
XSS Disclosed report Intermediate

https://mathfacts.khanacademy.org/ includes code from unprivileged localhost port

The Khan Academy math facts page included a script tag pointing at a localhost development server on an unprivileged port. On a shared computer, another local user could run a service on that port and serve arbitrary JavaScript that would run in the context of the Khan Academy page for other users.

hanno Follow

Originally disclosed on HackerOne

  • Triaged in 40 hours
  • Fixed in 7 months
  • Disclosed after 14 months

The webpage

contains an invalid javascript include at the bottom of the page: <script src="http://localhost:8021/webpack-dev-server.js"></script>

This is probably some unintended leftover from the development.

In normal situations this will only cause the browser to be unable to connect. But it can actually become a security risk. The port in question (8021) is an unprivileged port, which means on standard operating systems it's possible for every user on the system to run a service on this port.

If you imagine a Desktop computer that is usable by multiple users. One user can run a local service in his account opening this port, thus serving whatever javascript he wants and thus arbitrarily change the appearance of the served webpage for any other user on the same computer.

Impact

An attacker with user privileges can manipulate the webpage https://mathfacts.khanacademy.org/ for all users using the same computer.

The original report as published on HackerOne, by hanno. 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 a leftover development script reference to a local webpack dev server was shipped to production.

Impact

An attacker with local user privileges could alter the page for other users of the same computer; this only matters on multi-user machines and does not affect remote visitors.

What the attacker needed

Shared multi-user computer; attacker has a local account; victim uses the same machine

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 web page can load extra code from another address. Here the page tried to load code from the visitor's own computer on a port that any user of that machine is allowed to use. If several people share one computer, one of them could put their own code there, and the page would run it as if it came from Khan Academy.

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 hanno

View all

13 more disclosed reports, best first.

More from Khan Academy

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.