# GHSA-hwmc-r6mf-jh83: Schema.org has cross-site scripting (XSS) via script break-out in toScript() output

> An attacker can execute arbitrary scripts in a victim's browser via XSS in the Schema.org library's toScript() output.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 1 Jul 2026

## What is GHSA-hwmc-r6mf-jh83?

GHSA-hwmc-r6mf-jh83 is a cross-site scripting vulnerability in spatie/schema-org, published on 1 Jul 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

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

## Which versions are affected by GHSA-hwmc-r6mf-jh83?

4 open source packages ship an affected version, including spatie/schema-org.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `spatie/schema-org` | Packagist | From 3.23.1 | 3.23.2 |
| `spatie/schema-org` | Packagist | From 3.23.1 | 3.23.2 |
| `spatie/schema-org` | Packagist | From 4.0.0 | 4.0.2 |
| `spatie/schema-org` | Packagist | From 4.0.0 | 4.0.2 |

## How do I fix GHSA-hwmc-r6mf-jh83?

Upgrade spatie/schema-org to a fixed version for your release line: 3.23.2 or 4.0.2.

## Is GHSA-hwmc-r6mf-jh83 being exploited?

There is no known exploitation of GHSA-hwmc-r6mf-jh83 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-hwmc-r6mf-jh83 and fix it if it is affected.

What it is: GHSA-hwmc-r6mf-jh83 is a cross-site scripting vulnerability in spatie/schema-org, published on 1 Jul 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of GHSA-hwmc-r6mf-jh83 in the wild and no public exploit code.

Affected packages and fixed versions:
- spatie/schema-org (Packagist): affected from 3.23.1; fixed in 3.23.2
- spatie/schema-org (Packagist): affected from 3.23.1; fixed in 3.23.2
- spatie/schema-org (Packagist): affected from 4.0.0; fixed in 4.0.2
- spatie/schema-org (Packagist): affected from 4.0.0; fixed in 4.0.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-hwmc-r6mf-jh83/ (Markdown: https://insights.sbomify.com/GHSA-hwmc-r6mf-jh83/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-hwmc-r6mf-jh83

---
From sbomify Insights: https://insights.sbomify.com/GHSA-hwmc-r6mf-jh83/
Summaries are generated and may contain mistakes; the official description above is the record.
