CVE-2026-115897

Serialize JavaScript: Cross-site scripting (XSS) via unescaped </script at the end of a serialized function body

Low 2.1

Serialize JavaScript serializes JavaScript values to a superset of JSON that includes regular expressions and functions. Prior to 7.1.3, the function-source escaping logic does not neutralize a bare closing-script prefix when attacker-influenced function source text ends exactly at that prefix. Because each function body is escaped independently, a delimiter supplied by surrounding serialized output can terminate an HTML script element, and a later serialized value supplies injected markup that becomes a live element in the page. Exploitation requires control of a serialized function's source text, such as through a spoofed toString(). This issue is fixed in version 7.1.3.

Assigner
GitHub_M
Published
2026-10-23
Updated
2026-10-23
Reserved
2026-10-23

Seen in other sources

Scores

SourceCVSSScoreSeverityVector
GitHub_M4.02.1LowCVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N

Weaknesses

Affected

VendorProductVersions
yahoo serialize-javascript < 7.1.3 (affected)

References

Full CVE JSON record (5.2)

API · GitHub · cve.org

{
  "containers": {
    "cna": {
      "affected": [
        {
          "product": "serialize-javascript",
          "vendor": "yahoo",
          "versions": [
            {
              "status": "affected",
              "version": "\u003c 7.1.3"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "Serialize JavaScript serializes JavaScript values to a superset of JSON that includes regular expressions and functions. Prior to 7.1.3, the function-source escaping logic does not neutralize a bare closing-script prefix when attacker-influenced function source text ends exactly at that prefix. Because each function body is escaped independently, a delimiter supplied by surrounding serialized output can terminate an HTML script element, and a later serialized value supplies injected markup that becomes a live element in the page. Exploitation requires control of a serialized function\u0027s source text, such as through a spoofed toString(). This issue is fixed in version 7.1.3."
        }
      ],
      "metrics": [
        {
          "cvssV4_0": {
            "attackComplexity": "HIGH",
            "attackRequirements": "PRESENT",
            "attackVector": "NETWORK",
            "baseScore": 2.1,
            "baseSeverity": "LOW",
            "privilegesRequired": "LOW",
            "subAvailabilityImpact": "NONE",
            "subConfidentialityImpact": "LOW",
            "subIntegrityImpact": "LOW",
            "userInteraction": "PASSIVE",
            "vectorString": "CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N",
            "version": "4.0",
            "vulnAvailabilityImpact": "NONE",
            "vulnConfidentialityImpact": "LOW",
            "vulnIntegrityImpact": "LOW"
          }
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "cweId": "CWE-79",
              "description": "CWE-79: Improper Neutralization of Input During Web Page Generation (\u0027Cross-site Scripting\u0027)",
              "lang": "en",
              "type": "CWE"
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-10-23T21:37:41.097Z",
        "orgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
        "shortName": "GitHub_M"
      },
      "references": [
        {
          "name": "https://github.com/yahoo/serialize-javascript/security/advisories/GHSA-m5mm-p8h7-m29v",
          "tags": [
            "x_refsource_CONFIRM"
          ],
          "url": "https://github.com/yahoo/serialize-javascript/security/advisories/GHSA-m5mm-p8h7-m29v"
        },
        {
          "name": "https://github.com/yahoo/serialize-javascript/pull/235",
          "tags": [
            "x_refsource_MISC"
          ],
          "url": "https://github.com/yahoo/serialize-javascript/pull/235"
        },
        {
          "name": "https://github.com/yahoo/serialize-javascript/commit/2864b3c6260a3bfd52d2db3e70d1a079de108a61",
          "tags": [
            "x_refsource_MISC"
          ],
          "url": "https://github.com/yahoo/serialize-javascript/commit/2864b3c6260a3bfd52d2db3e70d1a079de108a61"
        },
        {
          "name": "https://github.com/yahoo/serialize-javascript/releases/tag/v7.1.3",
          "tags": [
            "x_refsource_MISC"
          ],
          "url": "https://github.com/yahoo/serialize-javascript/releases/tag/v7.1.3"
        }
      ],
      "source": {
        "advisory": "GHSA-m5mm-p8h7-m29v",
        "discovery": "UNKNOWN"
      },
      "title": "Serialize JavaScript: Cross-site scripting (XSS) via unescaped \u003c/script at the end of a serialized function body"
    }
  },
  "cveMetadata": {
    "assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
    "assignerShortName": "GitHub_M",
    "cveId": "CVE-2026-115897",
    "datePublished": "2026-10-23T21:37:41.097Z",
    "dateReserved": "2026-10-23T19:37:27.177Z",
    "dateUpdated": "2026-10-23T21:37:41.097Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2"
}