Improper Neutralization of Directives in Statically Saved Code ('Static Code Injection') in serialize-javascript
Cxf5fb15b0-6576
- serialize-javascript
Summary
serialize-javascript through 7.0.2 contains a code injection vulnerability due to improper escaping of "RegExp.flags" during serialization. Although "RegExp.source" is sanitized, the "flags" property is directly interpolated into the generated output without adequate validation. If attacker-controlled input is passed to "serialize()", malicious JavaScript may be injected into the serialized string. When the output is evaluated, for example via "eval", "new Function", or "<script>", arbitrary code execution may occur. This issue represents an incomplete fix for "CVE-2020-7660".
- HIGH
- NETWORK
- HIGH
- UNCHANGED
- NONE
- NONE
- HIGH
- HIGH
CWE-96 - Improper Neutralization of Directives in Statically Saved Code ('Static Code Injection')
The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes code syntax before inserting the input into an executable resource, such as a library, configuration file, or template.
References
Advisory Timeline
- Published