# CVE-2026-22028: Preact has JSON VNode Injection issue

> Attackers can inject malicious scripts via crafted JSON payloads in Preact applications that improperly handle untrusted data as VNodes.

- **Severity:** High 7.2 (`CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 8 Jan 2026
- **Updated:** 8 Jan 2026
- **Also known as:** GHSA-36hm-qxxp-pg3m, UBUNTU-CVE-2026-22028

## What is CVE-2026-22028?

CVE-2026-22028 is a high-severity cross-site scripting vulnerability in preactjs preact, published on 8 Jan 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Preact, a lightweight web development framework, JSON serialization protection to prevent Virtual DOM elements from being constructed from arbitrary JSON. A regression introduced in Preact 10.26.5 caused this protection to be softened. In applications where values from JSON payloads are assumed to be strings and passed unmodified to Preact as children, a specially-crafted JSON payload could be constructed that would be incorrectly treated as a valid VNode. When this chain of failures occurs it can result in HTML injection, which can allow arbitrary script execution if not mitigated by CSP or other means. Applications using affected Preact versions are vulnerable if they meet all of the following conditions: first, pass unmodified, unsanitized values from user-modifiable data sources (APIs, databases, local storage, etc.) directly into the render tree; second assume these values are strings but the data source could return actual JavaScript objects instead of JSON strings; and third, the data source either fails to perform type sanitization AND blindly stores/returns raw objects interchangeably with strings, OR is compromised (e.g., poisoned local storage, filesystem, or database). Versions 10.26.10, 10.27.3, and 10.28.2 patch the issue. The patch versions restore the previous strict equality checks that prevent JSON-parsed objects from being treated as valid VNodes. Other mitigations are available for those who cannot immediately upgrade. Validate input types, cast or validate network data, sanitize external data, and use Content Security Policy (CSP).

Weakness: CWE-843 (Access of Resource Using Incompatible Type)

## Which versions are affected by CVE-2026-22028?

6 open source packages ship an affected version, including preact. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `preact` | npm | From 10.26.5 | 10.26.10 |
| `preact` | npm | From 10.26.5 | 10.26.10 |
| `preact` | npm | From 10.27.0 | 10.27.3 |
| `preact` | npm | From 10.27.0 | 10.27.3 |
| `preact` | npm | From 10.28.0 | 10.28.2 |
| `preact` | npm | From 10.28.0 | 10.28.2 |

Products: Preactjs Preact.

## How do I fix CVE-2026-22028?

Upgrade preact to a fixed version for your release line: 10.26.10, 10.27.3 or 10.28.2.

## Is CVE-2026-22028 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-22028 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-22028 and fix it if it is affected.

What it is: CVE-2026-22028 is a high-severity cross-site scripting vulnerability in preactjs preact, published on 8 Jan 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-22028 exists.

Affected packages and fixed versions:
- preact (npm): affected from 10.26.5; fixed in 10.26.10
- preact (npm): affected from 10.26.5; fixed in 10.26.10
- preact (npm): affected from 10.27.0; fixed in 10.27.3
- preact (npm): affected from 10.27.0; fixed in 10.27.3
- preact (npm): affected from 10.28.0; fixed in 10.28.2
- preact (npm): affected from 10.28.0; fixed in 10.28.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/CVE-2026-22028/ (Markdown: https://insights.sbomify.com/CVE-2026-22028/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-22028
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-22028
- OSV: https://osv.dev/vulnerability/CVE-2026-22028

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-22028/
Summaries are generated and may contain mistakes; the official description above is the record.
