Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Sanitize and sandbox toot embeds #9552
Up until now, we blindly included oEmbed replies from remote toots in the embed modal.
It however causes Content Security Policy warnings, and we may still provide users with malicious instructions.
The proposed change sanitizes the oEmbed content before suggesting it to the user, and also sandboxes the code to prevent executing scripts in a same-origin context.
This does cause some functionality loss: the generated code for embedding remote toots will not include the JS snippet needed to adjust the iframe's height.