CVE-2020-7660: Insecure serialization leading to RCE in serialize-javascript
Summary
CVE-2020-7660: Insecure serialization leading to RCE in serialize-javascript. Affects serialize-javascript versions < 3.1.0. Fixed in 3.1.0. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The serialize-javascript package is an npm package used for serializing JavaScript objects into a string representation. It is commonly used in web applications to transmit data between the client and server. The package provides a function called 'serialize' that takes an object as input and returns a string representation of that object. This package is vulnerable to an insecure serialization vulnerability that can lead to remote code execution (RCE).
Vulnerability Detail
The vulnerability in serialize-javascript prior to version 3.1.0 allows remote attackers to inject arbitrary code via the 'deleteFunctions' function within 'index.js'. An attacker can exploit this vulnerability by providing a specially crafted object for serialization. By controlling the values of both 'foo' and 'bar' properties in the object, and guessing the value of the '<UID>' placeholder, the attacker can escape the 'bar' key and inject arbitrary code. This vulnerability has a high severity rating with a CVSS score of 8.1.
How To Fix
Latest published version: 7.1.3 as of 22 Oct 2026
npm install serialize-javascript@7.1.3
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
3.1.0
This is the first release that contains the fix.
npm install serialize-javascript@3.1.0
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for this vulnerability. It is recommended to update to the latest version of the serialize-javascript package as soon as possible.
Conclusion
The serialize-javascript package prior to version 3.1.0 is vulnerable to an insecure serialization vulnerability that can lead to remote code execution. Developers should update to the latest version of the package to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for serialize-javascript →
FAQ
Serialize-javascript is an npm package used for serializing JavaScript objects into a string representation.
This vulnerability allows remote attackers to inject arbitrary code, potentially leading to remote code execution.
You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply provide your package-lock.json file and the playground will analyze it for vulnerabilities.
Yes, developers should update the serialize-javascript package to version 3.1.0 or later to fix this vulnerability.
There are no known workarounds for this vulnerability. It is recommended to update to the latest version of the serialize-javascript package.
References
Related vulnerabilities
Recent vulnerabilities recorded for serialize-javascript.