CVE-2019-16769: Serialize javascript Cross-Site Scripting Vulnerability
MODERATECVE-2019-16769 is a MODERATE (CVSS 4.2) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Serialize javascript libraries in the npm ecosystem. The issue involves cross-site scripting in serialize-javascript. Remediation is available by upgrading affected packages to version 2.1.1.
CVE-2019-16769 at a Glance
Security Impact
CVSS: 4.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:L).
How to Fix CVE-2019-16769
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@2.1.1
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-2019-16769, 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 2.1.1), 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. 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-2019-16769 Affected Serialize javascript Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
serialize-javascript
|
npm |
< 2.1.1
|
2.1.1
|
References
Frequently Asked Questions
What is CVE-2019-16769?
Which Serialize javascript versions are affected?
What version fixes CVE-2019-16769?
Is serialize-javascript affected?
What is the CVSS score of CVE-2019-16769?
What CWE is associated with CVE-2019-16769?
How can I check npm dependencies for CVE-2019-16769?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-h9rv-jmmf-4pgx",
"modified" : "2021-01-08T18:42:22Z",
"published" : "2019-12-05T18:44:37Z",
"aliases" : [ "CVE-2019-16769" ],
"summary" : "Cross-Site Scripting in serialize-javascript",
"details" : "Versions of `serialize-javascript` prior to 2.1.1 are vulnerable to Cross-Site Scripting (XSS). The package fails to sanitize serialized regular expressions. This vulnerability does not affect Node.js applications.\n\n\n## Recommendation\n\nUpgrade to version 2.1.1 or later.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "serialize-javascript"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.1.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/yahoo/serialize-javascript/security/advisories/GHSA-h9rv-jmmf-4pgx"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-16769"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-h9rv-jmmf-4pgx"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/1426"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T21:39:51Z",
"nvd_published_at" : null
}
}