serialize-javascript is vulnerable to Cross-Site Scripting (XSS)
59
Medium Risk
serialize-javascript escapes </script> sequences inside serialized function bodies so its output can be embedded safely in an inline HTML script element. The escaping only matches a complete </script...> tag within a single serialized value, so a closing script tag split across two separately serialized function bodies is left intact. When the serialized output is written into an HTML script context, the pieces reassemble into a real </script> sequence, break out of the script element, and let injected markup run in the browser. The fix escapes bare </script prefixes at HTML tokenizer delimiters and tracks string, template, regex, and comment spans so the split payload cannot be reassembled.
You are affected if you are using a version that falls within the vulnerable range and you embed serialized output containing untrusted function bodies into an HTML script context.
serialize-javascript is vulnerable to Cross-Site Scripting (XSS) in versions 7.0.1 - 7.1.0.
Upgrade the serialize-javascript library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.