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

Replace deprecated iFrame frameborder with border: 0 #33331

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nschonni
Copy link
Contributor

Not completely sure about the Ruby changes, but looked for the refrences from the failing ESLint PR.
Used the inline style to turn off the border https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#frameborder

@@ -136,7 +136,7 @@ module Config
attributes: {
'audio' => %w(controls),
'embed' => %w(height src type width),
'iframe' => %w(allowfullscreen frameborder height scrolling src width),
'iframe' => %w(allowfullscreen height scrolling src style width),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think allowing style might actually introduce potential security issues. Not sure this is necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I just leave frameborder as allowed here, for any external embeds that might still use it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allowing style attributes should be safe, although there have been vulnerabilities in our sanitizing library in the past, and limiting the surface area should be best.

And if we do decide to allow style attributes, it probably makes sense to only allow specific properties like border. And keep support for frameborder as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! To keep this simple, I've reverted this file, and kept the changes focused to the places where Mastodon was authoring the frameborder attribute

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Afaik the html bit you modified still goes through sanitization, so by using style instead, it will get sanitized away and won't work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. I added back style, but left frameborder for any legacy content that might need it for the same affect

@mjankowski mjankowski added ruby Pull requests that update Ruby code lint fix 💅 labels Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lint fix 💅 ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants