Skip to content

Commit

Permalink
Add XSS note to themes.js.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcenizal committed Dec 8, 2017
1 parent 3b736d2 commit d54538f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ui/public/theme/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export function registerTheme(theme, styles) {

export function applyTheme(newTheme) {
currentTheme = newTheme;

// NOTE: The use of innerHTML opens up to XSS attacks, so we can't support user-generated themes
// as long as this implementation is in use. Ideally we would use the webpack style-loader/useable
// to activate and deactivate themes, but that causes the optimize step to fail.
document.getElementById('themeCss').innerHTML = themes[currentTheme];
}

Expand Down

0 comments on commit d54538f

Please sign in to comment.