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

Add origin check to events #7933

Closed
C0rby opened this issue Nov 7, 2022 · 1 comment · Fixed by #7941
Closed

Add origin check to events #7933

C0rby opened this issue Nov 7, 2022 · 1 comment · Fixed by #7941
Assignees
Labels
Priority:p2-high Escalation, on top of current planning, release blocker Severity:sev4-low no loss of service, req. for docs info or enhancement Topic:Security Pull requests that address a security vulnerability

Comments

@C0rby
Copy link
Contributor

C0rby commented Nov 7, 2022

This event listener should check the event's origin.

window.addEventListener('message', (event) => {
if (event.data.length > 0) {
const payload = JSON.parse(event.data)
switch (payload.event) {
case 'init':
this.fileExtension === 'vsdx' ? this.importVisio() : this.load()
break
case 'autosave':
this.save(payload, true)
break
case 'save':
this.save(payload)
break
case 'exit':
this.exit()
break
}
}
})

And these lines should contain the target origin:



See this for more information: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage#security_concerns
If you want a demo of a poc exploit, just ping me. :)

@C0rby C0rby added Topic:Security Pull requests that address a security vulnerability Severity:sev4-low no loss of service, req. for docs info or enhancement labels Nov 7, 2022
@kulmann kulmann added the Priority:p3-medium Normal priority label Nov 8, 2022
@kulmann kulmann added Priority:p2-high Escalation, on top of current planning, release blocker and removed Priority:p3-medium Normal priority labels Nov 8, 2022
@JammingBen JammingBen self-assigned this Nov 9, 2022
@JammingBen
Copy link
Contributor

This has been fixed via #7941 in the stable-6.0 branch. Will come to master soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:p2-high Escalation, on top of current planning, release blocker Severity:sev4-low no loss of service, req. for docs info or enhancement Topic:Security Pull requests that address a security vulnerability
Projects
Archived in project
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants