Refined-github: Audit extension for XSS vulns

Created on 20 Jul 2016  路  4Comments  路  Source: sindresorhus/refined-github

https://github.com/sindresorhus/refined-github/pull/269#issuecomment-233547355

We likely have more than just that 1. Note that the risk factor is lower than usual thanks to GitHub using a strict content security policy, but it's still worthwhile.

enhancement help wanted

Most helpful comment

We're done here!

All 4 comments

Yeah this seems like a good idea.

Maybe switching to "use strict;" in the javascript would ease up the issues? Though I haven't read all the source and don't know what unit testing this actually passes through, but a quick lint can help uncover issues pretty quickly.

It happened #510

Also relevant:

What you can do, if that's important to anyone here, is to review each string composition to make sure we're sanitizing the input, wherever necessary
https://github.com/sindresorhus/refined-github/issues/439#issuecomment-306419652

Sanitized addReadmeButtons: #538

All over the extension we create elements via $('html') and similar methods. We should start restricting this HTML to our own strings and limit as much as possible user content.

Example:

domify(`<a class="one two" href="${ element.title }">${ name }`);

Becomes

a = domify('<a class="one two">');
a.href = element.title;
a.textContent = name

or

$('<a class="one two">', {
  href: element.title,
  text: name
})

Edit: continued on https://github.com/sindresorhus/refined-github/issues/539

We're done here!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mareksuscak picture mareksuscak  路  3Comments

alexanderadam picture alexanderadam  路  3Comments

pawelad picture pawelad  路  3Comments

MilesBHuff picture MilesBHuff  路  3Comments

hkdobrev picture hkdobrev  路  3Comments