-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: allow js scipts for most https origin #1236
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
Conversation
src/components/Folder/index.tsx
Outdated
| sandbox="allow-scripts allow-forms" | ||
| sandbox="allow-scripts allow-forms allow-same-origin" |
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.
can we remove allow-same-origin? When an iframe enables both allow-scripts and allow-same-origin, and uses srcDoc (thus sharing the same origin as the parent page), scripts inside the frame effectively gain the same privileges as the main application — allowing them to access the parent DOM, read sensitive data, and even remove the sandbox, rendering the isolation meaningless from a security perspective. check https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox
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.
If we removed that, many demo examples will not be correctly shown.
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.
would using blob URL instead of srcDoc could resolve this issue?
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.
For this trade-off, the most efficient approach seems to be simply removing allow-same-origin. It’s mainly used for localStorage, which isn’t typically required for 3D rendering. What do you think?
@bytecii
Wendong-Fan
left a comment
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.
thanks @bytecii , I will remove allow-same-origin for now and merge this PR to move things forward first, if we have better solution we can add another enhance PR later
Description
Sometimes eigent generates the interactive htmls but cannot render / interact usually because of we now only allow one javascript script (js from https://cdn.amplitude.com).
Now add as many as https allowlist as possible
Fixes #1233
What is the purpose of this pull request?