# CVE-2020-7660: serialize-javascript insecure serialization RCE

Source: https://junglewise.ai/threats/cve-2020-7660-serialize-javascript-insecure-serialization-rce  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2020-08-11. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2020-7660 · Severity: low · CVSS 3.1 · Published 2020-08-11

serialize-javascript is a Node.js library used to serialize JavaScript objects for transmission or storage. A flaw in how it handles regex and function placeholders allows an attacker who can control object properties to inject arbitrary code, leading to remote code execution. An attacker must guess a 4-billion-value identifier space, making this a realistic network-based attack.

Technologies: [serialize-javascript (npm)](https://junglewise.ai/threats/technologies/serialize-javascript). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2020-7660 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2020-7660 being exploited in the wild.

**How severe is CVE-2020-7660?** Low severity, with a CVSS score of 3.1, published 11 August 2020.

**Which products and versions are affected?** serialize-javascript (npm) SEMVER:introduced=0,fixed=3.1.0.

**Is there a fix for CVE-2020-7660?** Yes. serialize-javascript (npm): upgrade to 3.1.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2020-7660 attacked?** It is attacked over the network.

**Am I affected by CVE-2020-7660?** Check whether you run serialize-javascript (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- serialize-javascript (npm): upgrade to 3.1.0 or later

  ```sh
  npm install serialize-javascript@3.1.0
  ```


## Technical details

The vulnerability is an insecure serialization issue in serialize-javascript prior to version 3.1.0, classified as CWE-502. The root cause is in the "deleteFunctions" function within index.js, which fails to properly escape regex and function placeholders within string literals. An attacker can craft a malicious object (e.g., {"foo": /1"/, "bar": "a\"@__R-&lt;UID&gt;-0__@"}) such that the serialization output breaks out of the intended string context, allowing arbitrary code injection. The attack requires the attacker to control both object property values and guess a UID with ~4 billion possible values, making it feasible in network scenarios. The attack vector is network-based with no authentication or user interaction required. The vulnerability is fixed in version 3.1.0 via commit f21a6fb, which prevents regex and function placeholder replacement within string literals.

## Affected products

- Yahoo serialize-javascript prior to 3.1.0

## Identifiers

- CVE-2020-7660
- GHSA-hxcc-f52p-wc94

## Timeline

- 2020-08-11: disclosed
- 2020-08-11: patched: Fixed in version 3.1.0

## References

- [https://github.com/yahoo/serialize-javascript/commit/f21a6fb3ace2353413761e79717b2d210ba6ccbd](https://github.com/yahoo/serialize-javascript/commit/f21a6fb3ace2353413761e79717b2d210ba6ccbd)

## Related threats

- [Yahoo Serialize JavaScript XSS via unescaped script tag in function body](https://junglewise.ai/threats/cve-2026-115897-serialize-javascript-serializes-javascript-values-to-a-superset)
- [serialize-javascript cross-site scripting via unescaped script tag](https://junglewise.ai/threats/cve-2026-115754-serialize-javascript-from-7-0-1-before-7-1-3-contains-a-cross)
- [serialize-javascript XSS via script-closing tag bypass in functions](https://junglewise.ai/threats/cve-2026-97711-serialize-javascript-serializes-javascript-values-to-a-superset)
- [Yahoo serialize-javascript CPU exhaustion DoS via crafted array-like objects](https://junglewise.ai/threats/cve-2026-34043-yahoo-serialize-javascript-cpu-exhaustion-dos-via-crafted-array)
- [serialize-javascript code injection via RegExp.flags and Date.toISOString](https://junglewise.ai/threats/serialize-javascript-code-injection-via-regexp-flags-and-date-a4d4abae)
