-
Notifications
You must be signed in to change notification settings - Fork 10
Fix permissions to ensure tracker can only send events #64
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
base: sandstorm
Are you sure you want to change the base?
Changes from 1 commit
a1a566a
b69dab8
986429b
24d5f60
0516314
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -98,7 +98,7 @@ <h2>Tracker Setup</h2> | |
| var template = "<script>" + $("#tracking_template").html() + "</scr" + "ipt>\n"; | ||
| template = template.replace('$API_PROTO', document.location.protocol); | ||
| window.addEventListener("message", messageListener); | ||
| window.parent.postMessage({renderTemplate: {rpcId: "0", template: template}}, "*"); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I keep forgetting what Beyond that I don't think it affects permissions much. But I guess doublecheck my claims here. @ocdtrekkie Is there anything else?
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
So I think we want it to be true here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, yeah that was the other thing. But iirc you show up as anonymous when used as a share link but not as an API key, or maybe the other way around, I forget. In any case, goofy behavior. You can try it out. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah forSharing "detaches it from you", so IMHO it should be true for any key you intend to make public or give to someone else. I don't think it has a major security implication but it does move it from webkeys (which is sort of your API keys) to sharing (which is who you shared it with). I think it should be true here. |
||
| window.parent.postMessage({renderTemplate: {rpcId: "0", roleAssignment: { roleId: 0 }, forSharing: true, template: template}}, "*"); | ||
| }); | ||
| </script> | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So when I tried to do this I put this in a different place, but you know your codebase better. Here's what I'd make sure of:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this code here protects the web sockets with view-data permissions, and the above in
defaultHandlerprotects regular http. I should add a guard on the tracker for completeness.