Skip to content

Commit 0644977

Browse files
Merge tag 'v1.5.15' into AMP.chat
Change-Id: I72c756fda40f108249b0b4e43452fe4c324add31
2 parents 9c7a348 + 0cfdc7b commit 0644977

File tree

8 files changed

+56
-30
lines changed

8 files changed

+56
-30
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
Changes in [1.5.15](https://github.com/vector-im/riot-web/releases/tag/v1.5.15) (2020-04-01)
2+
============================================================================================
3+
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.5.14...v1.5.15)
4+
5+
## Security notice
6+
7+
The `jitsi.html` widget wrapper introduced in Riot 1.5.14 could be used to extract user data by tricking the user into adding a custom widget or opening a link in the browser used to run Riot. Jitsi widgets created through Riot UI do not pose a risk and do not need to be recreated.
8+
9+
It is important to purge any copies of Riot 1.5.14 so that the vulnerable `jitsi.html` wrapper from that version is no longer accessible.
10+
11+
## All changes
12+
13+
* Upgrade React SDK to 2.3.1 for Jitsi fixes
14+
* Fix popout support for jitsi widgets
15+
[\#12980](https://github.com/vector-im/riot-web/pull/12980)
16+
117
Changes in [1.5.14](https://github.com/vector-im/riot-web/releases/tag/v1.5.14) (2020-03-30)
218
============================================================================================
319
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.5.14-rc.1...v1.5.14)

config.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
{
22
"update_base_url": "https://update.amp.chat/desktop/update/",
3-
"default_hs_url": "https://test.amp.chat",
4-
"default_is_url": "",
3+
"default_server_config": {
4+
"m.homeserver": {
5+
"base_url": "https://test.amp.chat",
6+
"server_name": "AMP.chat"
7+
},
8+
"m.identity_server": {
9+
"base_url": ""
10+
}
11+
},
512
"disable_3pid_login": true,
613
"brand": "AMP.chat",
714
"integrations_ui_url": "https://dimension.test.amp.chat/riot",
@@ -26,5 +33,8 @@
2633
},
2734
"enable_presence_by_hs_url": {
2835
"https://test.amp.chat": false
36+
},
37+
"jitsi": {
38+
"preferredDomain": "jitsi.amp.chat"
2939
}
3040
}

config.sample.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
"breadcrumbs": true
5454
},
5555
"jitsi": {
56-
"preferredDomain": "jitsi.riot.im",
57-
"externalApiUrl": "https://jitsi.riot.im/libs/external_api.min.js"
56+
"preferredDomain": "jitsi.riot.im"
5857
}
5958
}

docs/config.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ For a good example, see https://riot.im/develop/config.json.
8888
1. `preferredDomain`: The domain name of the preferred Jitsi instance. Defaults
8989
to `jitsi.riot.im`. This is used whenever a user clicks on the voice/video
9090
call buttons - integration managers may use a different domain.
91-
1. `externalApiUrl`: The URL to the Jitsi Meet API script. This is required
92-
for showing any Jitsi widgets, no matter the source. Defaults to
93-
`https://jitsi.riot.im/libs/external_api.min.js`.
9491

9592
Note that `index.html` also has an og:image meta tag that is set to an image
9693
hosted on riot.im. This is the image used if links to your copy of Riot

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@
3838
"clean": "rimraf lib webapp electron_app/dist",
3939
"build": "yarn clean && yarn build:genfiles && yarn build:compile && yarn build:types && yarn build:bundle",
4040
"build-stats": "yarn clean && yarn build:genfiles && yarn build:compile && yarn build:types && yarn build:bundle-stats",
41+
"build:jitsi": "curl -s https://jitsi.riot.im/libs/external_api.min.js > ./webapp/jitsi_external_api.min.js",
4142
"build:res": "node scripts/copy-res.js",
42-
"build:genfiles": "yarn reskindex && yarn build:res",
43+
"build:genfiles": "yarn reskindex && yarn build:res && yarn build:jitsi",
4344
"build:modernizr": "modernizr -c .modernizr.json -d src/vector/modernizr.js",
4445
"build:compile": "babel -d lib --verbose --extensions \".ts,.js,.tsx\" src",
4546
"build:bundle": "cross-env NODE_ENV=production webpack -p --progress --bail --mode production",
@@ -52,7 +53,7 @@
5253
"install:electron": "electron-builder install-app-deps",
5354
"dist": "scripts/package.sh",
5455
"start": "concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n reskindex,reskindex-react,res,riot-js \"yarn reskindex:watch\" \"yarn reskindex:watch-react\" \"yarn start:res\" \"yarn start:js\"",
55-
"start:res": "node scripts/copy-res.js -w",
56+
"start:res": "yarn build:jitsi && node scripts/copy-res.js -w",
5657
"start:js": "webpack-dev-server --host=0.0.0.0 --output-filename=bundles/_dev_/[name].js --output-chunk-filename=bundles/_dev_/[name].js -w --progress --mode development",
5758
"electron": "yarn build && yarn install:electron && electron .",
5859
"lint": "yarn lint:types && yarn lint:ts && yarn lint:js && yarn lint:style",

src/vector/jitsi/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ <h2>Jitsi Video Conference</h2>
1515
</div>
1616
</div>
1717
</div>
18+
<!-- This script is not webpacked, and the script is downloaded at build time -->
19+
<script src="./jitsi_external_api.min.js"></script>
1820
</body>
1921
</html>

src/vector/jitsi/index.ts

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,19 @@ let widgetApi: WidgetApi;
4949
return <string>query[name];
5050
};
5151

52+
// If we have these params, expect a widget API to be available (ie. to be in an iframe
53+
// inside a matrix client). Otherwise, assume we're on our own, eg. have been popped
54+
// out into a browser.
55+
const parentUrl = qsParam('parentUrl', true);
56+
const widgetId = qsParam('widgetId', true);
57+
5258
// Set this up as early as possible because Riot will be hitting it almost immediately.
53-
widgetApi = new WidgetApi(qsParam('parentUrl'), qsParam('widgetId'), [
54-
Capability.AlwaysOnScreen,
55-
Capability.GetRiotWebConfig,
56-
]);
57-
widgetApi.expectingExplicitReady = true;
59+
if (parentUrl && widgetId) {
60+
widgetApi = new WidgetApi(qsParam('parentUrl'), qsParam('widgetId'), [
61+
Capability.AlwaysOnScreen,
62+
]);
63+
widgetApi.expectingExplicitReady = true;
64+
}
5865

5966
// Populate the Jitsi params now
6067
jitsiDomain = qsParam('conferenceDomain');
@@ -63,16 +70,10 @@ let widgetApi: WidgetApi;
6370
avatarUrl = qsParam('avatarUrl', true); // http not mxc
6471
userId = qsParam('userId');
6572

66-
await widgetApi.waitReady();
67-
await widgetApi.setAlwaysOnScreen(false); // start off as detachable from the screen
68-
69-
const riotConfig = await widgetApi.getRiotConfig();
70-
71-
// Get the Jitsi Meet API loaded up as fast as possible, but ensure that the widget's postMessage
72-
// receiver (WidgetApi) is up and running first.
73-
const scriptTag = document.createElement("script");
74-
scriptTag.src = riotConfig['jitsi']['externalApiUrl'];
75-
document.body.appendChild(scriptTag);
73+
if (widgetApi) {
74+
await widgetApi.waitReady();
75+
await widgetApi.setAlwaysOnScreen(false); // start off as detachable from the screen
76+
}
7677

7778
// TODO: register widgetApi listeners for PTT controls (https://github.com/vector-im/riot-web/issues/12795)
7879

@@ -94,7 +95,7 @@ function joinConference() { // event handler bound in HTML
9495
switchVisibleContainers();
9596

9697
// noinspection JSIgnoredPromiseFromCall
97-
widgetApi.setAlwaysOnScreen(true); // ignored promise because we don't care if it works
98+
if (widgetApi) widgetApi.setAlwaysOnScreen(true); // ignored promise because we don't care if it works
9899

99100
const meetApi = new JitsiMeetExternalAPI(jitsiDomain, {
100101
width: "100%",
@@ -116,7 +117,7 @@ function joinConference() { // event handler bound in HTML
116117
switchVisibleContainers();
117118

118119
// noinspection JSIgnoredPromiseFromCall
119-
widgetApi.setAlwaysOnScreen(false); // ignored promise because we don't care if it works
120+
if (widgetApi) widgetApi.setAlwaysOnScreen(false); // ignored promise because we don't care if it works
120121

121122
document.getElementById("jitsiContainer").innerHTML = "";
122123
});

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7473,10 +7473,10 @@ matrix-mock-request@^1.2.3:
74737473
bluebird "^3.5.0"
74747474
expect "^1.20.2"
74757475

7476-
7477-
version "2.3.0"
7478-
resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-2.3.0.tgz#67c50130e2c62dcd48bae684b1d68eae4ff229f4"
7479-
integrity sha512-K1+y2Q3XcjRu7jN72JKO2bG8yD0MK8i1tYI8/oafvFJP1HlpphUzF58tQ/EAiXs1a4UnsxBV27xvrHOxqzflLQ==
7476+
7477+
version "2.3.1"
7478+
resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-2.3.1.tgz#76ac6f98dfa89d4ceb7c63b31e10b9779bca12fe"
7479+
integrity sha512-TIiiEIUa891eTdRFCaj18sAFJULBDgbFOvV4upaED/aNXxnHOLV5JjNuYzsmQMEJ6Fmrz5iM0DbWXaADnuZwpQ==
74807480
dependencies:
74817481
"@babel/runtime" "^7.8.3"
74827482
blueimp-canvas-to-blob "^3.5.0"

0 commit comments

Comments
 (0)