-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Sandbox: Use toString to create observe and resize script string #42872
Conversation
Size Change: -454 B (0%) Total Size: 1.27 MB
ℹ️ View Unchanged
|
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.
Interesting! The reasoning makes sense and it seems like this would be beneficial in multiple ways.
From what I could gather, I don't think this would be problematic (security, reliability), but I would feel better if we got one more reviewer's approval as well.
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 don't think there shoud be any security conserns, but having a final sign-off doesn't hurt 😄 Don't know who to request a review from to get that. @aaronrobertshaw Can you add someone from security team as a reviewer? Would also be good to get someone from the mobile team to make sure it works as expected in the mobile app as well. |
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.
My 2 cents from a security perspective is that I don't see an additional security threat being introduced here. This function is not modifiable as user input and there is already a way to pass your own function as a prop, a more immediate danger would be users of this component not being aware of the security implications of that.
To abuse this code would require introducing some kind of other XSS vulnerability to the site and at that point there would be easier ways to perform an attack.
I opened wordpress-mobile/gutenberg-mobile#5083 to allow a few more mobile-specific CI tests to run against these changes. I hope to spend time testing the changes in the mobile editor within the next couple of days. |
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.
The additional mobile CI tasks passed in wordpress-mobile/gutenberg-mobile#5083. 🎉 Unfortunately, I discovered a regression on Android that I have outlined further in a separate comment.
If we address the Android regression, I do not see a reason why these changes cannot be made to the native mobile file. However, like other commenters, I would defer to others more experienced in security matters to comment on any possible vulnerabilities in these changes.
Thanks for the ping!
Hey all 👋 Is this PR ready to be merged? Since some time has passed, should we rebase it before doing so? |
Co-authored-by: David Calhoun <438664+dcalhoun@users.noreply.github.com>
df75807
to
c8678b9
Compare
I have rebased the PR. I belive it's ready to be merged. |
Makes sense to me — let's merge once CI is ✅ ! |
What?
Use
toString
on theobserveAndResizeJS
function to create string used in the iframe.Why?
How?
Used
toString
instead of hardcoding the function as a string.Testing Instructions
Test the editor where the
Sandbox
component is used. Ex theCustom HTML
block in preview mode.