浏览代码

fix xss issue reported by @realansgar, regression from 3dade6117628beb7706b4abdc61c268ce281abbc

Hakim El Hattab 1 年之前
父节点
当前提交
16f6633014
共有 3 个文件被更改,包括 7 次插入0 次删除
  1. 0 0
      plugin/notes/notes.esm.js
  2. 0 0
      plugin/notes/notes.js
  3. 7 0
      plugin/notes/speaker-view.html

文件差异内容过多而无法显示
+ 0 - 0
plugin/notes/notes.esm.js


文件差异内容过多而无法显示
+ 0 - 0
plugin/notes/notes.js


+ 7 - 0
plugin/notes/speaker-view.html

@@ -383,6 +383,13 @@
 
 				window.addEventListener( 'message', function( event ) {
 
+					// Validate the origin of all messages to avoid parsing messages
+					// that aren't meant for us. Ignore when running off file:// so
+					// that the speaker view continues to work without a web server.
+					if( window.location.origin !== event.origin && window.location.origin !== 'file://' ) {
+						return
+					}
+
 					clearTimeout( connectionTimeout );
 					connectionStatus.style.display = 'none';
 

部分文件因为文件数量过多而无法显示