CVE-2020-7660 is a high-severity (CVSS 8.1) Deserialization of Untrusted Data vulnerability in serialize-javascript. A fix is available for serialize-javascript — see the affected versions and patch details below.
Insecure serialization leading to RCE in serialize-javascript
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
serialize-javascriptnpmDescription
serialize-javascript prior to 3.1.0 allows remote attackers to inject arbitrary code via the function "deleteFunctions" within "index.js".
An object such as {"foo": /1"/, "bar": "a\"@__R-<UID>-0__@"} was serialized as {"foo": /1"/, "bar": "a\/1"/}, which allows an attacker to escape the bar key. This requires the attacker to control the values of both foo and bar and guess the value of <UID>. The UID has a keyspace of approximately 4 billion making it a realistic network attack.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | serialize-javascript | all versions | 3.1.0npm install serialize-javascript@3.1.0 |
Affected Products
serialize-javascriptverizonDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for serialize-javascript, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update serialize-javascript to 3.1.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2020-7660 is resolved across your whole dependency graph.
Workarounds
Do not deserialise data from untrusted sources: where the format allows it, restrict deserialisation to an explicit allowlist of expected types, and prefer a data-only format (JSON, Protobuf) over one that can reconstruct arbitrary objects until you can upgrade.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
Red Hat Quay includes serialize-javascript as a dependency of webpack which is only used at build time. The vulnerable library is not used at runtime meaning this has a low impact on Red Hat Quay. The currently supported versions of Container Native Virtualization 2 are not affected by this flaw. However, version 2.0,…
| Product | Fixed in | Advisory |
|---|---|---|
| OpenShift Service Mesh 1.0 | servicemesh-grafana-0:6.2.2-38.el8 | RHSA-2020:2861 |
| OpenShift Service Mesh 1.1 | servicemesh-grafana-0:6.4.3-11.el8 | RHSA-2020:2796 |
Frequently Asked Questions
Is CVE-2020-7660 in your dependencies?
Find it across npm, including transitive dependencies.