Skip to content

Commit d6041b5

Browse files
authored
fix(trace-viewer): validate origin of postMessage trace blob (#40548)
1 parent 08ccdc9 commit d6041b5

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

packages/trace-viewer/src/ui/workbenchLoader.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ export const WorkbenchLoader: React.FunctionComponent<{
6969
});
7070
React.useEffect(() => {
7171
const listener = (e: MessageEvent) => {
72+
if (e.origin !== window.location.origin)
73+
return;
7274
const { method, params } = e.data;
7375

7476
if (method !== 'load' || !(params?.trace instanceof Blob))

0 commit comments

Comments
 (0)