From 9753ee8d825001e76e726d2173068ee5d144ac31 Mon Sep 17 00:00:00 2001 From: Richard Lewis Date: Thu, 24 May 2018 16:14:18 +0100 Subject: [PATCH] Better check of jitsi widget message origin. --- src/components/views/elements/AppTile.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/views/elements/AppTile.js b/src/components/views/elements/AppTile.js index e4d003b59b..018b6cb342 100644 --- a/src/components/views/elements/AppTile.js +++ b/src/components/views/elements/AppTile.js @@ -278,7 +278,12 @@ export default class AppTile extends React.Component { event.origin = event.originalEvent.origin; } - if (!this.state.widgetUrl.startsWith(event.origin)) { + const widgetUrlObj = url.parse(this.state.widgetUrl); + const eventOrigin = url.parse(event.origin); + if ( + eventOrigin.protocol !== widgetUrlObj.protocol || + eventOrigin.host !== widgetUrlObj.host + ) { return; }