CVE-2026-22028: Preact Preact Has JSON VNode Injection Vulnerability

HIGH
Advisory Identifier: GHSA-36hm-qxxp-pg3m
CWE-843
Published
Advisory Summary

CVE-2026-22028 is a HIGH preact has json vnode injection vulnerability (CWE-843: Access of Resource Using Incompatible Type ('Type Confusion')) affecting Preact libraries in the npm ecosystem. The issue involves preact has json vnode injection issue. Remediation is available by upgrading affected packages to version 10.26.10, 10.27.3, 10.28.2.

CVE-2026-22028 at a Glance

CVE Identifier CVE-2026-22028
GHSA Identifier GHSA-36hm-qxxp-pg3m
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-843: Access of Resource Using Incompatible Type ('Type Confusion')
Affected Product Preact
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-22028

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

preact fixed: 10.26.10
npm install preact@10.26.10
preact fixed: 10.27.3
npm install preact@10.27.3
preact fixed: 10.28.2
npm install preact@10.28.2
Verify Direct and Transitive Dependencies

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

npm ls preact

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-22028, inspect your project dependencies using npm:

npm ls preact

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

Note: The npm ls preact command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-843: Access of Resource Using Incompatible Type ('Type Confusion'), where the product allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type. In Preact, 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

## Impact **Vulnerability Type:** HTML Injection via JSON Type Confusion **Affected Versions:** Preact 10.26.5 through 10.28.1 **Severity:** Low to Medium (see below) ### Who is Impacted? Applications using affected Preact versions are vulnerable if they meet **all** of the following conditions: 1. **Pass unmodified, unsanitized values** from user-modifiable data sources (APIs, databases, local storage, etc.) directly into the render tree 2. **Assume these values are strings** but the data source could return actual JavaScript objects instead of JSON strings 3. 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) ### Technical Details Preact includes 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. **Important Notes:** - This regression was never present in `preact-render-to-string` - This is primarily an "expanded attack surface" issue rather than a standalone vulnerability - Exploitation requires either insecure API design (no type validation) or a compromised data source ## Patches **Patched Versions:** - **10.26.10** (for 10.26.x users) - **10.27.3** (for 10.27.x users) - **10.28.2** (for 10.28.x users) Users should upgrade to the latest patch version of whatever minor version they are on, which can be done via `npm update preact` or by installing one of the above versions directly. The patch versions simply restore the previous strict equality checks that prevent JSON-parsed objects from being treated as valid VNodes. ## Mitigations If you cannot upgrade immediately, implement the following mitigations: - **Validate input types:** Don't accept arbitrary objects as inputs in your API and blindly store them. Enforce strict type contracts at API boundaries. - **Cast or validate network data:** Don't assume strings are strings if your code got them from the network. Always cast to the expected type or validate before rendering. - **Sanitize external data:** Validate that data from external sources (APIs, storage, databases) matches expected types before passing it to preact. - **Use Content Security Policy (CSP):** Implement a strict CSP to prevent inline script execution as a defense-in-depth measure. ## References - **Reporter:** [YoungGeun Choi](https://github.com/Xvezda) - **Affected Versions:** 10.26.5 - 10.28.1 - **Patched Versions:** 10.26.10, 10.27.3, 10.28.2 ## Credits Preact thanks **YoungGeun Choi (Xvezda)** for the responsible disclosure of this vulnerability and for providing detailed reproduction steps and proof-of-concept demonstrations. ## Timeline - **2026-01-04:** Initial vulnerability report received - **2026-01-05:** Clarification requested regarding network/serialization boundary - **2026-01-06:** Network PoC provided demonstrating real-world exploitatibility - **2026-01-06:** Hotfix patches released (10.26.10, 10.27.3, 10.28.2) --- **Recommendation:** All users of Preact 10.26.5 through 10.28.1 should upgrade to the appropriate patched version (10.26.10, 10.27.3, or 10.28.2) as soon as possible, and review their applications for proper input validation and sanitization practices.

CVE-2026-22028 Affected Preact Versions

3 component(s)
Fixed Versions:
10.26.1010.27.310.28.2
Product / Package Ecosystem Affected Versions Fixed Version
preact
npm
≥ 10.26.5
< 10.26.10
10.26.10
preact
npm
≥ 10.27.0
< 10.27.3
10.27.3
preact
npm
≥ 10.28.0
< 10.28.2
10.28.2

References

Frequently Asked Questions

What is CVE-2026-22028?
CVE-2026-22028 is a security vulnerability in Preact involving Preact has JSON VNode Injection issue under CWE-843: Access of Resource Using Incompatible Type ('Type Confusion').
Which Preact versions are affected?
Affected versions include releases prior to 10.26.10, 10.27.3, 10.28.2 across affected packages: preact.
What version fixes CVE-2026-22028?
Upgrading to 10.26.10, 10.27.3, 10.28.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is preact affected?
Yes, preact is affected in releases prior to 10.26.10, 10.27.3, 10.28.2. Upgrade your dependency to 10.26.10, 10.27.3, 10.28.2 or later.
What CWE is associated with CVE-2026-22028?
CVE-2026-22028 is classified under CWE-843: Access of Resource Using Incompatible Type ('Type Confusion') (The product allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type.).
How can I check npm dependencies for CVE-2026-22028?
Run the dependency tree command: 'npm ls preact'. 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-36hm-qxxp-pg3m",
  "modified" : "2026-01-08T21:19:13Z",
  "published" : "2026-01-07T19:28:15Z",
  "aliases" : [ "CVE-2026-22028" ],
  "summary" : "Preact has JSON VNode Injection issue",
  "details" : "## Impact\n\n**Vulnerability Type:** HTML Injection via JSON Type Confusion\n\n**Affected Versions:** Preact 10.26.5 through 10.28.1\n\n**Severity:** Low to Medium (see below)\n\n### Who is Impacted?\n\nApplications using affected Preact versions are vulnerable if they meet **all** of the following conditions:\n\n1. **Pass unmodified, unsanitized values** from user-modifiable data sources (APIs, databases, local storage, etc.) directly into the render tree\n2. **Assume these values are strings** but the data source could return actual JavaScript objects instead of JSON strings\n3. The data source either:\n   - Fails to perform type sanitization **AND** blindly stores/returns raw objects interchangeably with strings, OR\n   - Is compromised (e.g., poisoned local storage, filesystem, or database)\n\n### Technical Details\n\nPreact includes 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.\n\n**Important Notes:**\n- This regression was never present in `preact-render-to-string`\n- This is primarily an \"expanded attack surface\" issue rather than a standalone vulnerability\n- Exploitation requires either insecure API design (no type validation) or a compromised data source\n\n## Patches\n\n**Patched Versions:**\n- **10.26.10** (for 10.26.x users)\n- **10.27.3** (for 10.27.x users)\n- **10.28.2** (for 10.28.x users)\n\nUsers should upgrade to the latest patch version of whatever minor version they are on, which can be done via `npm update preact` or by installing one of the above versions directly.\n\nThe patch versions simply restore the previous strict equality checks that prevent JSON-parsed objects from being treated as valid VNodes.\n\n## Mitigations\n\nIf you cannot upgrade immediately, implement the following mitigations:\n\n- **Validate input types:** Don't accept arbitrary objects as inputs in your API and blindly store them. Enforce strict type contracts at API boundaries.\n- **Cast or validate network data:** Don't assume strings are strings if your code got them from the network. Always cast to the expected type or validate before rendering.\n- **Sanitize external data:** Validate that data from external sources (APIs, storage, databases) matches expected types before passing it to preact.\n- **Use Content Security Policy (CSP):** Implement a strict CSP to prevent inline script execution as a defense-in-depth measure.\n\n## References\n\n- **Reporter:** [YoungGeun Choi](https://github.com/Xvezda)\n- **Affected Versions:** 10.26.5 - 10.28.1\n- **Patched Versions:** 10.26.10, 10.27.3, 10.28.2\n\n## Credits\n\nPreact thanks **YoungGeun Choi (Xvezda)** for the responsible disclosure of this vulnerability and for providing detailed reproduction steps and proof-of-concept demonstrations.\n\n## Timeline\n\n- **2026-01-04:** Initial vulnerability report received\n- **2026-01-05:** Clarification requested regarding network/serialization boundary\n- **2026-01-06:** Network PoC provided demonstrating real-world exploitatibility\n- **2026-01-06:** Hotfix patches released (10.26.10, 10.27.3, 10.28.2)\n\n---\n\n**Recommendation:** All users of Preact 10.26.5 through 10.28.1 should upgrade to the appropriate patched version (10.26.10, 10.27.3, or 10.28.2) as soon as possible, and review their applications for proper input validation and sanitization practices.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "preact"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.26.5"
      }, {
        "fixed" : "10.26.10"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "preact"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.27.0"
      }, {
        "fixed" : "10.27.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "preact"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.28.0"
      }, {
        "fixed" : "10.28.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/preactjs/preact/security/advisories/GHSA-36hm-qxxp-pg3m"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-22028"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/preactjs/preact"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-843" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-01-07T19:28:15Z",
    "nvd_published_at" : "2026-01-08T15:15:44Z"
  }
}