origin-storage
origin-storage copied to clipboard
How are you controlling security?
How are you controlling security?
Let's assume that I have:
sub1.example.comsub2.example.comand they are using this library by sharing data with the origin set to a page onexample.com.
Couldn't I set up sub1.example.com.malicious.com and point it to the origin set on example.com and then see all of the data in any user's browser whom I can trick into going to my malicious site?
Of course, you could have use it like this.
new OriginStorage({
broadcastChanges: true,
+ targetOrigin: 'http://sub1.example.com',
})
This will mean that only sub1.example.com will have access to this sharing data.
If you want to support multiple site configurations, you can set it up like this.
new OriginStorage({
broadcastChanges: true,
targetOrigin: 'http://sub1.example.com',
})
new OriginStorage({
broadcastChanges: true,
targetOrigin: 'http://sub2.example.com',
})