Skip to content

Insecure serialization leading to RCE in serialize-javascript

High severity GitHub Reviewed Published Aug 11, 2020 to the GitHub Advisory Database • Updated Nov 29, 2023

Package

npm serialize-javascript (npm)

Affected versions

< 3.1.0

Patched versions

3.1.0

Description

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.

References

Reviewed Aug 11, 2020
Published to the GitHub Advisory Database Aug 11, 2020
Last updated Nov 29, 2023

Severity

High
8.1
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Weaknesses

CVE ID

CVE-2020-7660

GHSA ID

GHSA-hxcc-f52p-wc94
Checking history
See something to contribute? Suggest improvements for this vulnerability.