erikras / erikras/postmessage-client-server

Server specifies targetOrigin as '*'

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
9
Forks
5
PR merge metrics
No merged PRs in 30d

Description

I noticed that in the server code, the postMessage call has a targetOrigin parameter of '*', but from these docs it says you should specify a specific uri:

```
clientWindow.postMessage(JSON.stringify({postmessageClientServerInit: true}), '*');
```

https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
"Always provide a specific targetOrigin, not *, if you know where the other window's document should be located. Failing to provide a specific target discloses the data you send to any interested malicious site."

Do you think this uri should be set as the parent's uri?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.