preact
Affected
- introduced
10.26.5, fixed10.26.10(semver)
Fixed versions
10.26.10
Fix
- Fixed version
10.26.10npm install [email protected]
Advisory
Also known as: CVE-2026-22028
Preact has JSON VNode Injection issue
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:
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:
preact-render-to-stringPatches
Patched Versions:
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:
References
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
---
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.
High Basis: The source's own band: HIGH
10.26.5, fixed 10.26.10 (semver)10.26.10
10.26.10npm install [email protected]10.27.0, fixed 10.27.3 (semver)10.27.3
10.27.3npm install [email protected]10.28.0, fixed 10.28.2 (semver)10.28.2
10.28.2npm install [email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0