Skip to content

Commit 6de67c8

Browse files
committed
Action.OpenUrl with a top-level browsing context
While HTML links [launch without an opener reference][spec], [`window.open`][vulnerability] provides a reference to the parent page through an auxiliary browsing context. Given untrusted URL input, this can lead to tabnabbing and phishing attacks. This change uses the [noopener] and [noreferrer] [window features] for the default link handler in the React renderer. [spec]: whatwg/html#4078 [vulnerability]: https://mathiasbynens.github.io/rel-noopener/ [window features]: https://developer.mozilla.org/en-US/docs/Web/API/Window/open#windowfeatures [noopener]: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/noopener [noreferrer]: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/noreferrer
1 parent d757703 commit 6de67c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/nodejs/adaptivecards-react/src/adaptive-card.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const propTypes = {
4343
};
4444

4545
const defaultOpenUrlHandler = (action: AdaptiveCards.OpenUrlAction) => {
46-
window.open(action.url, '_blank');
46+
window.open(action.url, '_blank', 'noopener,noreferrer');
4747
};
4848

4949
const setUpMarkdownIt = () => {

0 commit comments

Comments
 (0)