CVE-2020-7660: Serialize javascript Remote Code Execution Vulnerability
HIGHCVE-2020-7660 is a HIGH (CVSS 8.1) remote code execution vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Serialize javascript libraries in the npm ecosystem. The issue involves insecure serialization leading to rce in serialize-javascript. Remediation is available by upgrading affected packages to version 3.1.0.
CVE-2020-7660 at a Glance
Security Impact
CVSS: 8.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2020-7660
To remediate this vulnerability, upgrade all affected Serialize javascript dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install serialize-javascript@3.1.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls serialize-javascript
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2020-7660, inspect your project dependencies using npm:
npm ls serialize-javascript
Analyze the terminal output to locate any version of Serialize javascript in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.0), your application is affected.
Note: The npm ls serialize-javascript command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In Serialize javascript, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2020-7660 Affected Serialize javascript Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
serialize-javascript
|
npm |
< 3.1.0
|
3.1.0
|
References
Frequently Asked Questions
What is CVE-2020-7660?
Which Serialize javascript versions are affected?
What version fixes CVE-2020-7660?
Is serialize-javascript affected?
What is the CVSS score of CVE-2020-7660?
What CWE is associated with CVE-2020-7660?
How can I check npm dependencies for CVE-2020-7660?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hxcc-f52p-wc94",
"modified" : "2021-09-23T18:50:59Z",
"published" : "2020-08-11T17:21:13Z",
"aliases" : [ "CVE-2020-7660" ],
"summary" : "Insecure serialization leading to RCE in serialize-javascript",
"details" : "serialize-javascript prior to 3.1.0 allows remote attackers to inject arbitrary code via the function \"deleteFunctions\" within \"index.js\". \n\nAn 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "serialize-javascript"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.1.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-7660"
}, {
"type" : "WEB",
"url" : "https://github.com/yahoo/serialize-javascript/commit/f21a6fb3ace2353413761e79717b2d210ba6ccbd"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/yahoo/serialize-javascript"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-502" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-08-11T14:14:51Z",
"nvd_published_at" : null
}
}