Skip to content

Root level script tag should not be executed #11483

Closed
@hybridwebdev

Description

@hybridwebdev

Version

2.6.11

Reproduction link

https://codesandbox.io/s/cranky-moser-p90di?file=/src/main.js

Steps to reproduce

Put valid <script> element in template string

What is expected?

Script should be blocked from executing

What is actually happening?

Script executes


As the example illustrates, if a <script> element is the sole element passed into the template string of a component, it will execute said script block. However if it's pre-ceded by a valid element, eg: a div the script is blocked from execution by the renderer. You do not have to close said element as shown in examples, simply preceding the script tag with a valid opening tag suffices. I believe this is because the renderer automatically closes elements with missing closures.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions