GHSA-hwmc-r6mf-jh83 — spatie/schema-org
Fix: spatie/schema-org#242GHSA-hwmc-r6mf-jh83 is a security vulnerability in spatie/schema-org. A fix is available for spatie/schema-org — see the affected versions and patch details below.
Schema.org has cross-site scripting (XSS) via script break-out in toScript() output
Real-World Exposure
spatie/schema-org🐘spatie/schema-orgReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Packagist packages — download data is not available via public APIs for these ecosystems.
Description
Schema.org has a cross-site scripting (XSS) vulnerability via script break-out in toScript() output.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐘Packagist | spatie/schema-org | ≥ 3.23.1&&< 3.23.2 | 3.23.2composer require spatie/schema-org:^3.23.2 |
| 🐘Packagist | spatie/schema-org | ≥ 4.0.0&&< 4.0.2 | 4.0.2composer require spatie/schema-org:^4.0.2 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for spatie/schema-org, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update spatie/schema-org to 3.23.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-hwmc-r6mf-jh83 is resolved across your whole dependency graph.
Workarounds
Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
Frequently Asked Questions
Is GHSA-hwmc-r6mf-jh83 in your dependencies?
Find it across Packagist, including transitive dependencies.