-
Notifications
You must be signed in to change notification settings - Fork 645
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Add rel="noreferrer" to external links of widgets
Clicking on external links (with target="_blank") in RSS widgets and buttons of Dashboard widgets can leak the referrer of the linked page. This is mostly not wanted because it reveals the URL of the TYPO3 backend. Additionally, the other page can access the "window.opener" property, which exposes security issues. Also if the other page is running a lot of JavaScript, the performance of the TYPO3 backend may also suffer, because the other page may run on the same process as the TYPO3 backend. To mitigate this behaviour rel="noreferrer" is added to external links in the according widgets. "noreferrer" also implies the "noopener" behaviour, so this is sufficient. See also: - https://html.spec.whatwg.org/multipage/links.html#link-type-noreferrer - https://developers.google.com/web/tools/lighthouse/audits/noopener Resolves: #91290 Releases: master Change-Id: Ie53b543e39bc716a5437d9a7364691de3ec7346f Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64401 Reviewed-by: Josef Glatz <josefglatz@gmail.com> Reviewed-by: Oliver Bartsch <bo@cedev.de> Reviewed-by: Richard Haeser <richard@maxserv.com> Tested-by: TYPO3com <noreply@typo3.com> Tested-by: Josef Glatz <josefglatz@gmail.com> Tested-by: Oliver Bartsch <bo@cedev.de> Tested-by: Richard Haeser <richard@maxserv.com>
- Loading branch information
1 parent
da6bd97
commit f66a20d
Showing
5 changed files
with
13 additions
and
18 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
typo3/sysext/dashboard/Resources/Private/Partials/Widget/Button.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true"> | ||
<f:if condition="{button}"> | ||
<a href="{button.link}" class="widget-cta"{f:if(condition: '{button.target}', then: ' target="{button.target}"')}{f:if(condition: '{button.target} == "_blank"', then: ' rel="noreferrer"')}>{f:translate(id: button.title, default: button.title)}</a> | ||
</f:if> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters