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

Ensure <script> tags rendered via TemplateResults on server do not result in executable code on client #67

Open
kevinpschaaf opened this issue Jul 7, 2020 · 0 comments
Assignees

Comments

@kevinpschaaf
Copy link
Contributor

On the client, this code will not result in script execution:

const result = html`<script>alert('hi')</script>`;
render(result, container);

However, when rendering the same template via render-lit-html, the script will be emitted into the page and executed when parsed on the client. The SSR code should (optionally) identify <script> tags and mark with a type="disabled" or similar attribute to prevent script execution, to maintain the same guarantees client-side security guarantees when server-rendering.

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

No branches or pull requests

1 participant