Skip to content

Conversation

@lydell
Copy link

@lydell lydell commented Nov 11, 2025

Closes #246 together with elm/virtual-dom#191.

srcdoc =
stringProperty "srcdoc"
srcdoc _ =
stringProperty "srcdoc" """This is an XSS vector. Please <a href="https://github.com/elm/html/blob/master/iframe-srcdoc.md">use a web component instead</a>."""
Copy link
Author

Choose a reason for hiding this comment

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

This wording is inspired by elm/virtual-dom:

https://github.com/elm/virtual-dom/blob/faa43820c372b1a3077582887971686f7ba1474d/src/Elm/Kernel/VirtualDom.js#L309-L321

Note that in the linked code, the message does not appear in --optimize mode. I don’t think it’s worth the effort doing the same here, since nobody will use Html.Attributes.srcdoc in production, since it no longer does anything useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Iframe's srcDoc allow arbitrary scripts which can result in unsafe packages published

1 participant