Description
serialize-javascript escapes its output so it is safe to embed inside a <script> element. In 7.1.1 that guarantee does not hold for function values: a crafted function body can carry a literal, unescaped </script> into the output, terminating the script element early so the remainder is parsed as HTML.
Recommendation
Update the serialize-javascript package to the latest compatible version. Followings are version details:
- Affected version(s): >= 7.1.1, < 7.1.2
- Patched version(s): 7.1.2
References
Could your website be exposed too?
SmartScanner can check your website for Serialize JavaScript: Cross-site scripting (XSS) via unescaped </script> in serialized function bodies and gives you actionable findings to investigate.
Start a free scanRelated Issues
- Serialize JavaScript: Cross-site scripting (XSS) via unescaped </script at the end of a serialized function body - CVE-2026-115897
- Cross-site Scripting (XSS) in serialize-javascript - CVE-2024-11831
- Jodit has cross-site scripting (XSS) via <script> nested in SVG that bypasses clean-html sanitization - CVE-2026-65841
- Cross-Site Scripting in serialize-javascript - CVE-2019-16769


