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

XSS danger - Escaping needed after #3808 #3813

Closed
Conduitry opened this issue Oct 28, 2019 · 1 comment · Fixed by #3816
Closed

XSS danger - Escaping needed after #3808 #3813

Conduitry opened this issue Oct 28, 2019 · 1 comment · Fixed by #3816
Labels

Comments

@Conduitry
Copy link
Member

This should have its own issue so it's not forgotten about before the next alpha, because this is a nasty one.

No REPL link because this isn't released yet, but:

<div>{'<div onclick="alert(&quot;oh no&quot;)">click me</div>'}</div>

produces an actual div with an onclick since #3808. Less maliciously,

<div>{'&lt;'}</div>

renders as <. The text isn't getting escaped. I don't think there's currently any runtime escaping of entities in DOM code, but with these changes, we'll need some. If this proves too challenging, we should revert #3808 for now.

@Conduitry Conduitry added the bug label Oct 28, 2019
@tivac
Copy link
Contributor

tivac commented Oct 28, 2019

Runtime escaping wasn't needed when everything was created as a text node. Is the slight code size decrease worth the increased risk and cost of runtime escaping?

Seems like something that needs benchmarking 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants