Vulnerability library
Security checkMarch 02, 2026

Serialize JavaScript is Vulnerable to RCE via RegExp.flags and Date.prototype.toISOString()

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

The serialize-javascript npm package (versions <= 7.0.2) contains a code injection vulnerability. It is an incomplete fix for CVE-2020-7660.

While RegExp.source is sanitized, RegExp.flags is interpolated directly into the generated output without escaping. A similar issue exists in Date.prototype.toISOString().

Recommendation

Update the serialize-javascript package to the latest compatible version. Followings are version details:

  • Affected version(s): <= 7.0.2
  • Patched version(s): 7.0.3

References

Could your website be exposed too?

SmartScanner can check your website for Serialize JavaScript is Vulnerable to RCE via RegExp.flags and Date.prototype.toISOString() and gives you actionable findings to investigate.

Start a free scan

Related Issues

See something that needs correcting? Let us knowUpdated March 02, 2026