Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global.postMessage issue #57

Open
rawb opened this issue Sep 27, 2016 · 2 comments
Open

global.postMessage issue #57

rawb opened this issue Sep 27, 2016 · 2 comments

Comments

@rawb
Copy link

rawb commented Sep 27, 2016

Hello,

Using installPostMessageImplementation() will use global.postMessage to send messages. If, let's say you maintain a browser extension that has access to window and executes this code, you will send a message that a web page could be listening to. If the web page has code that is listening for messages, but does not clean the message before processing (JSON.parse(message)), you could break a site unintentionally.

I know as professionals we should clean input before processing or try/catch, etc, but big sites such as icloud.com fall victim to this issue.

After navigating to the notes section after logging in to icloud.com the page will error if you execute a setImmediate() call sometime during loading.

@ronkorving
Copy link

That is indeed somewhat scary. Do you think postMessage should be avoided altogether?

@rawb
Copy link
Author

rawb commented Nov 10, 2017

As the readme mentions, window. postMessage seems like its the best hack available until something native comes along. I wrote this issue without understanding the need for window.postMessage for this lib and understanding that there is no better alternative. Thanks for reading it though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants