Vulnerability library
Security checkSeptember 30, 2026

Serialize JavaScript: Cross-site scripting (XSS) via unescaped </script> in serialized function bodies

Understand the exposure, see the recommended fix, and check whether your own website has related weaknesses.

Check your website

Find this and other vulnerabilities with a free scan.

Your scan runs on your computer. No account required.

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 scan

Related Issues

See something that needs correcting? Let us knowUpdated September 30, 2026