Skip to content

Commit 6a1143f

Browse files
authored
chore(tests): Reject messages from unknown origins in integration tests (#19016)
Handles: https://github.com/getsentry/sentry-javascript/security/code-scanning/434 Closes #19017 (added automatically)
1 parent 5886804 commit 6a1143f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • dev-packages/browser-integration-tests/suites/wasm/webWorker/assets

dev-packages/browser-integration-tests/suites/wasm/webWorker/assets/worker.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ function getBuildId(module) {
4848

4949
// Handle messages from the main thread
5050
self.addEventListener('message', async event => {
51+
if (event.origin !== '' && event.origin !== self.location.origin) {
52+
return;
53+
}
54+
5155
function crash() {
5256
throw new Error('WASM error from worker');
5357
}

0 commit comments

Comments
 (0)