Skip to content
XSS Disclosed report Intermediate

[GitHub Extension] Unsanitised HTML leading to XSS on GitHub.com

The Awesome Autocomplete browser extension inserted search results into GitHub pages without sanitising the HTML, so a crafted repository name could inject markup and script into the github.com page. An attacker could get a JavaScript alert to run in the context of GitHub.com when a victim searched for a specific string.

ysx Follow

Originally disclosed on HackerOne

  • Fixed in 12 days
  • Paid in 12 days
  • Disclosed after 12 days

Summary by the researcher

In certain cases, HTML elements were unsanitised by the Awesome Autocomplete extension when presented in DOM, leading to XSS on the GitHub website. Thanks to the Algolia team for the swift resolution and fix.

The report

Hi,

I noticed that certain HTML is unsanitised by the Awesome Autocomplete for GitHub extension, leading to a case of XSS on the GitHub website.

Please note that I do not have ownership nor affiliation with the repository and user names in this report, nor the final JavaScript alert dialog.

Proof of Concept

I have tested the following Proof of Concept demonstrations with the following conditions:

Extension

  • Latest version of the Awesome Autocomplete extension

Operating Systems

  • macOS Sierra 10.12.4
  • Windows 7 x64

Browsers

  • Google Chrome 57.0.2987.133 (latest)
  • Safari 10.1 (latest)

Unsanitised HTML

Please follow the below steps to demonstrate the presence of an unsanitised HTML issue.

  1. Search for '"><img src=x onerror= on GitHub.com
  2. Note the broken <img> element and requests to "x" on GitHub.com

The following images demonstrate that a broken <img> element was created in the context of GitHub.com by the Algolia extension:

Unsanitised_1.png
Unsanitised_1.png From the original on HackerOne
Unsanitised_2.png
Unsanitised_2.png

XSS on GitHub

Please follow the below steps to demonstrate the presence of a full XSS issue.

  1. Search for a'"><h1 on GitHub.com
  2. Because of a specific repository name being loaded, a JavaScript alert dialog will appear:
XSS_1.png
XSS_1.png From the original on HackerOne

As noted above, I am currently attempting to reproduce this vulnerability using my own repositories and JavaScript code (e.g. document.domain rather than "1337").

Please let me know if you require any additional information regarding these vulnerabilities.

Thanks!

The original report as published on HackerOne, by ysx. 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 extension rendered search-result data as raw HTML in the page's DOM without escaping or sanitising it.

Impact

An attacker could run script in the context of GitHub.com for users who have the extension installed and perform the crafted search, though the reporter was still working on a self-owned reproduction.

What the attacker needed

Victim has the extension installed; victim searches a crafted string; attacker controls a repository name

The fix

The issue was fixed after the vendor was notified.

How it was found

  1. Search GitHub.com for a string containing an image tag with an error handler.
  2. Observe a broken image element and requests to a non-existent host on GitHub.com.
  3. Search GitHub.com for a string containing a heading tag.
  4. Observe a JavaScript alert dialog appear because of a specific repository name being loaded.

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 browser extension called Awesome Autocomplete adds search suggestions to GitHub. It took text from repository names and put it straight into the page as HTML instead of plain text, so a name containing markup became real page elements. That let a crafted name run JavaScript on github.com, which is cross-site scripting (XSS): injecting code into a site so it runs as that site.

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 ysx

View all

25 more disclosed reports, best first.

More from Algolia

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.