Vulnerability in HTML design: the script tag
Last edited:
Alex KarpinskyTL;DR
This article covers one of the ways to avoid the by-design <script> HTML element vulnerability.
Long story short, unlike any other HTML tag, <script> implies different rules of escaping its content. The proper escaping is unreasonably difficult and can even be impossible under certain circumstances.
The “escaping problem” often makes <script> a source of security vulnerabilities in HTML.
Instead of going with the uncertain rules, I propose using the <safescript> element which follows HTML guidelines on escaping via HTML entities.