Vulnerability Type: HTML Injection via JSON Type Confusion
Affected Versions: Preact 10.26.5 through 10.28.1
Severity: Low to Medium (see below)
Applications using affected Preact versions are vulnerable if they meet all of the following conditions:
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
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.
If you cannot upgrade immediately, implement the following mitigations:
Preact thanks YoungGeun Choi (Xvezda) for the responsible disclosure of this vulnerability and for providing detailed reproduction steps and proof-of-concept demonstrations.
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": "HIGH",
"github_reviewed_at": "2026-01-07T19:28:15Z",
"cwe_ids": [
"CWE-843"
],
"nvd_published_at": "2026-01-08T15:15:44Z",
"github_reviewed": true
}