Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Near miss on security issue - cross-site scripting in extension window #9

Closed
pruby opened this issue Mar 20, 2018 · 2 comments
Closed

Comments

@pruby
Copy link

pruby commented Mar 20, 2018

Hello,

I've just quickly reviewed this extension and identified an unsafe pattern in the popup construction. The names of blocked domains are injected in to the popup HTML without HTML-encoding them to prevent injection of Javascript or other HTML content.

I have not identified a working way to exploit this, however any of the following would have resulted in injection of arbitrary HTML in to the popup:

  • Any URL scheme which does not use the :// notation being passed to the onBeforeRequest handler, based on the custom URL decoding routine ignoring this possibility.
  • If punycode allowed ASCII characters to be redundantly encoded (I checked, it doesn't seem to).
  • If Chrome passed protocol-relative or other incomplete URLs to the extension (it doesn't)

HTML-encoding content before injecting it in to the popup would remove the hazard that such a condition is introduced in future.

@AykutCevik
Copy link
Owner

Thank you for the submission @pruby. I will work on a fix for that.

@Gitoffthelawn
Copy link

I noticed the fix does not HTML-encode the content. Is the fix sufficient?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants