Skip to content
Heist/ feed
Back to feed
Medium

Security advisory

Type: advisorySources: OSVCVE: CVE-2019-16772

The serialize-to-js NPM package before version 3.0.1 is vulnerable to Cross-site Scripting (XSS). It does not properly mitigate against unsafe characters in serialized regular expressions. This vulnerability is not affected on Node.js environment since Node.js's implementation of RegExp.prototype.toString() backslash-escapes all forward slashes in regular expressions. If serialized data of regular expression objects are used in an environment other than Node.js, it is affected by this vulnerability.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2019-16772
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 10:37 UTC · Revision 1

Source evidence

CVE-2019-16772

core-osv · Original source

Published 7 Dec 2019, 00:15 UTC

The serialize-to-js NPM package before version 3.0.1 is vulnerable to Cross-site Scripting (XSS). It does not properly mitigate against unsafe characters in serialized regular expressions. This vulnerability is not affected on Node.js environment since Node.js's implementation of RegExp.prototype.toString() backslash-escapes all forward slashes in regular expressions. If serialized data of regular expression objects are used in an environment other than Node.js, it is affected by this vulnerability.

osv:CVE-2019-16772
Complete source record
{
  "id": "bbb0a631ddda5d33971fb52defb2936d9d68e52cd9b18516ffc51d9d4330f736",
  "url": "https://osv.dev/vulnerability/CVE-2019-16772",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2019-16772",
    "summary": "The serialize-to-js NPM package before version 3.0.1 is vulnerable to Cross-site Scripting (XSS). It does not properly mitigate against unsafe characters in serialized regular expressions. This vulnerability is not affected on Node.js environment since Node.js's implementation of RegExp.prototype.toString() backslash-escapes all forward slashes in regular expressions. If serialized data of regular expression objects are used in an environment other than Node.js, it is affected by this vulnerability.",
    "evidence": "osv:CVE-2019-16772",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2019-16772",
      "aliases": [
        "CVE-2019-16772",
        "GHSA-3fjq-93xj-3f3f"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/commenthol/serialize-to-js",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "89c82a8d993c122834597f620c50c11a3798500d"
                },
                {
                  "fixed": "181d7d583ae5293cd47cc99b14ad13352875f3e3"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:serialize-to-js_project:serialize-to-js:*:*:*:*:*:node.js:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "3.0.1"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "181d7d583ae5293cd47cc99b14ad13352875f3e3"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v3.0.0",
            "v2.0.1",
            "v2.0.0",
            "v1.2.2",
            "v1.2.1",
            "v1.2.0",
            "v1.1.2",
            "v1.1.1",
            "v1.1.0",
            "v1.0.0",
            "v0.5.0",
            "v0.4.0",
            "v0.3.1",
            "v0.3.0",
            "v0.2.0",
            "v0.1.2",
            "v0.1.1",
            "v0.1.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2019-16772.json"
          }
        }
      ],
      "modified": "2026-10-20T10:50:47.442694904Z",
      "provider": "osv",
      "references": [
        "https://github.com/commenthol/serialize-to-js/security/advisories/GHSA-3fjq-93xj-3f3f",
        "https://github.com/commenthol/serialize-to-js/commit/181d7d583ae5293cd47cc99b14ad13352875f3e3"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2019-16772",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 382155,
  "published_at": "2019-12-07T00:15:11.09+00:00"
}