Skip to content

use textContent instead of innerHtml, preventing XSS #3816

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

Conversation

tanhauhau
Copy link
Member

Fixes #3813

Added a new concept here, is_static_content besides the can_use_innerhtml

to differentiate cases where we can use innerHtml:

  • no mustache tags
  • logic blocks, if, each, etc

and cases where the content is static:

  • no dynamic dependencies
  • only mount, will not need to handle changes.

@Rich-Harris Rich-Harris merged commit 4c5dd9f into sveltejs:master Oct 28, 2019
@Rich-Harris
Copy link
Member

ah, whoops. good fix, thanks

@tanhauhau tanhauhau deleted the tanhauhau/text-content-instead-of-inner-html branch October 28, 2019 14:48
@snoopysecurity
Copy link

Hey @Rich-Harris, any plans a pushing a new release to npm with this fix? Thanks 😊

@Conduitry
Copy link
Member

The last cut version (3.13.0-alpha.2) was before #3808, which introduced the issue.

@snoopysecurity
Copy link

Ahhh makes sense, thanks @Conduitry

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.

XSS danger - Escaping needed after #3808
4 participants