Skip to content

Commit

Permalink
[SECURITY] Mitigate XSS in viewpage
Browse files Browse the repository at this point in the history
The `viewpage` module contains a preset selection, where
users can select different browser viewports. Since the
corresponding preset labels, configurable via TSconfig,
had not been encoded properly, is was vulnerable to XSS.

The issue is addressed by properly encoding the labels.

Resolves: #93702
Releases: master, 11.3, 10.4, 9.5
Change-Id: Ia22c5ab4332816614dd07a93d7e739d9fc1d8bac
Security-Bulletin: CORE-SA-2021-009
Security-References: CVE-2021-32667
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69987
Tested-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
  • Loading branch information
o-ba authored and ohader committed Jul 20, 2021
1 parent 5a49b34 commit a4406f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Expand Up @@ -14,6 +14,7 @@
import $ from 'jquery';
import 'jquery-ui/resizable';
import PersistentStorage = require('TYPO3/CMS/Backend/Storage/Persistent');
import SecurityUtility = require('TYPO3/CMS/Core/SecurityUtility');

enum Selectors {
resizableContainerIdentifier = '.t3js-viewpage-resizeable',
Expand Down Expand Up @@ -58,7 +59,7 @@ class ViewPage {
}

private static setLabel(label: string): void {
$(Selectors.currentLabelSelector).html(label);
$(Selectors.currentLabelSelector).html((new SecurityUtility()).encodeHtml(label));
}

private static getCurrentLabel(): string {
Expand Down
2 changes: 1 addition & 1 deletion typo3/sysext/viewpage/Resources/Public/JavaScript/Main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a4406f3

Please sign in to comment.