-
Notifications
You must be signed in to change notification settings - Fork 51
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
[media] Check origin of messages #1643
Conversation
a28fe3d
to
1fa31fb
Compare
if (window.origin !== event.origin) { | ||
console.log("Unexpected Origin: ", event.origin); | ||
return; | ||
} |
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.
@seanshpark I noticed that there is a potential security problem from Verify the origin of the received message
.
I assumed that the messages are coming from the window's origin, would it be okay for CircleGraph?
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.
I'm not sure about technical background of this, but I think event
itself would be coming from vscode process(? or thread?, the node-js).
And not sure about the fix but if this has no problem loading the model, I think it would be OK.
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.
I agree this changes because this is a similar solution from sonarsource.com.
https://rules.sonarsource.com/javascript/RSPEC-2819/
window.addEventListener("message", function(event) {
if (event.origin !== "http://example.org") // Compliant
return;
console.log(event.data)
});
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.
@jyoungyun I actually referred that solution :-D
@jyoungyun PTAL :-D (Should I Pr this drafts at once or separately?) |
@dayo09 Could you update the commit title so that there is no |
This commit checks origin of messages in event handlers ONE-vscode-DCO-1.0-Signed-off-by: Dayoung Lee <[email protected]>
1fa31fb
to
26f1122
Compare
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.
LGTM
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.
LGTM
This commit checks origin of messages in event handlers
ONE-vscode-DCO-1.0-Signed-off-by: Dayoung Lee [email protected]
For #1624 (comment)