GHSA-hwmc-r6mf-jh83: Spatie/schema org Cross-Site Scripting Vulnerability

LOW
CWE-79
Published
Advisory Summary

GHSA-hwmc-r6mf-jh83 is a LOW cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Spatie/schema org libraries in the Packagist ecosystem. The issue involves schema.org has cross-site scripting (xss) via script break-out in toscript() output. Remediation is available by upgrading affected packages to version 3.23.2, 4.0.2.

GHSA-hwmc-r6mf-jh83 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-hwmc-r6mf-jh83
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Spatie/schema org
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix GHSA-hwmc-r6mf-jh83

To remediate this vulnerability, upgrade all affected Spatie/schema org dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

spatie/schema-org fixed: 3.23.2
Upgrade spatie/schema-org to 3.23.2
spatie/schema-org fixed: 4.0.2
Upgrade spatie/schema-org to 4.0.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for spatie/schema-org

How to Check if You Are Affected

To determine whether your application is affected by GHSA-hwmc-r6mf-jh83, inspect your project dependencies for Spatie/schema org:

inspect dependencies for spatie/schema-org

Analyze the terminal output to locate any version of Spatie/schema org in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.23.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

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 Spatie/schema org, 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

Schema.org has a cross-site scripting (XSS) vulnerability via script break-out in toScript() output.

GHSA-hwmc-r6mf-jh83 Affected Spatie/schema org Versions

2 component(s)
Fixed Versions:
3.23.24.0.2
Product / Package Ecosystem Affected Versions Fixed Version
spatie/schema-org
Packagist
≥ 3.23.1
< 3.23.2
3.23.2
spatie/schema-org
Packagist
≥ 4.0.0
< 4.0.2
4.0.2

References

Frequently Asked Questions

What is GHSA-hwmc-r6mf-jh83?
GHSA-hwmc-r6mf-jh83 is a security vulnerability in Spatie/schema org involving Schema.org has cross-site scripting (XSS) via script break-out in toScript() output under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Spatie/schema org versions are affected?
Affected versions include releases prior to 3.23.2, 4.0.2 across affected packages: spatie/schema-org.
What version fixes GHSA-hwmc-r6mf-jh83?
Upgrading to 3.23.2, 4.0.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is spatie/schema-org affected?
Yes, spatie/schema-org is affected in releases prior to 3.23.2, 4.0.2. Upgrade your dependency to 3.23.2, 4.0.2 or later.
What CWE is associated with GHSA-hwmc-r6mf-jh83?
GHSA-hwmc-r6mf-jh83 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 Packagist dependencies for GHSA-hwmc-r6mf-jh83?
Run the dependency tree command: 'inspect dependencies for spatie/schema-org'. 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-hwmc-r6mf-jh83",
  "modified" : "2026-07-01T18:33:02Z",
  "published" : "2026-07-01T18:32:31Z",
  "aliases" : [ ],
  "summary" : "Schema.org has cross-site scripting (XSS) via script break-out in toScript() output",
  "details" : "Schema.org has a cross-site scripting (XSS) vulnerability via script break-out in toScript() output.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:U"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "spatie/schema-org"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.23.1"
      }, {
        "fixed" : "3.23.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "spatie/schema-org"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.0.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/spatie/schema-org/pull/242"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spatie/schema-org/commit/be389b4759214c11cc1364a16e34a929c5af5a88"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/spatie/schema-org/2026-04-20.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/spatie/schema-org"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spatie/schema-org/releases/tag/4.0.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-01T18:32:31Z",
    "nvd_published_at" : null
  }
}