Skip to content

Commit

Permalink
Fix a possible XSS issue on public pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
BusterNeece committed Aug 28, 2021
1 parent 888e110 commit 1182a8d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -22,7 +22,7 @@ release channel, you can take advantage of these new features and fixes.
identifier; if you're calling the API externally, you should _always_ use a generated API key and not count on the
user's existing session.

-
- A minor cross-site scripting (XSS) vulnerability on public pages has been resolved.

---

Expand Down
3 changes: 2 additions & 1 deletion src/Customization.php
Expand Up @@ -17,6 +17,7 @@ class Customization
public const THEME_BROWSER = 'browser';
public const THEME_LIGHT = 'light';
public const THEME_DARK = 'dark';
public const THEMES = [self::THEME_BROWSER, self::THEME_LIGHT, self::THEME_DARK];

protected ?Entity\User $user = null;

Expand Down Expand Up @@ -45,7 +46,7 @@ public function __construct(
// Register current theme
$queryParams = $request->getQueryParams();

if (!empty($queryParams['theme'])) {
if (!empty($queryParams['theme']) && in_array($queryParams['theme'], self::THEMES, true)) {
$this->publicTheme = $this->theme = $queryParams['theme'];
} else {
$this->publicTheme = $this->settings->getPublicTheme() ?? $this->publicTheme;
Expand Down

0 comments on commit 1182a8d

Please sign in to comment.