CVE-2019-16769: Serialize javascript Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-h9rv-jmmf-4pgx
CVSS 4.2
CWE-79
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2019-16769
GHSA Identifier GHSA-h9rv-jmmf-4pgx
Severity MODERATE
CVSS v3.1 Base Score 4.2
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Serialize javascript
Package Ecosystem npm
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability Low (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.

serialize-javascript fixed: 2.1.1
npm install serialize-javascript@2.1.1
Verify Direct and Transitive Dependencies

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

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. ## Recommendation Upgrade to version 2.1.1 or later.

CVE-2019-16769 Affected Serialize javascript Versions

1 component(s)
Fixed Versions:
2.1.1
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?
CVE-2019-16769 is a security vulnerability in Serialize javascript involving Cross-Site Scripting in serialize-javascript under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Serialize javascript versions are affected?
Affected versions include releases prior to 2.1.1 across affected packages: serialize-javascript.
What version fixes CVE-2019-16769?
Upgrading to 2.1.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is serialize-javascript affected?
Yes, serialize-javascript is affected in releases prior to 2.1.1. Upgrade your dependency to 2.1.1 or later.
What is the CVSS score of CVE-2019-16769?
CVE-2019-16769 has a CVSS v3.1 base score of 4.2 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:L.
What CWE is associated with CVE-2019-16769?
CVE-2019-16769 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (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.).
How can I check npm dependencies for CVE-2019-16769?
Run the dependency tree command: 'npm ls serialize-javascript'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}