r/javascript • Front-End Engineer • Aug 09 '12

A JavaScript Security Flaw

http://blog.alexmaccaw.com/a-javascript-security-flaw
0 Upvotes

13 comments sorted by

View all comments

4

u/bonafidebob Aug 09 '12

I think the description confuses the render tree with DOM tree, which made me re-read it several times. This is 'just' a HTML parsing problem.

The first occurrence of the sequence </script inside a <script> element ends the element. The HTML parser is not even supposed to try to parse javascript, it does not and should not know about JS syntax.

But, yeah, inserting arbitrary strings into <script> elements is a problem.