CVE-2026-22028: CWE-843: Access of Resource Using Incompatible Type ('Type Confusion') in preactjs preact
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).
AI Analysis
Technical Summary
CVE-2026-22028 is a type confusion vulnerability classified under CWE-843 affecting the Preact JavaScript framework, a lightweight alternative to React used for building web interfaces. The vulnerability stems from a regression introduced in Preact version 10.26.5 that softened the JSON serialization protections designed to prevent Virtual DOM elements (VNodes) from being constructed from arbitrary JSON data. Normally, Preact expects children passed to its render tree to be strings or valid VNodes, but due to this regression, specially crafted JSON payloads can be interpreted incorrectly as valid VNodes. This occurs when applications take JSON payloads from user-controllable sources (APIs, databases, local storage) and pass them unmodified into the render tree, assuming these values are strings. If the data source returns actual JavaScript objects instead of strings and fails to sanitize or validate these types, or if the data source is compromised (e.g., poisoned local storage or database), the crafted payload can lead to HTML injection. This injection can escalate to arbitrary script execution if the application does not have effective Content Security Policy (CSP) or other script execution mitigations. The vulnerability affects Preact versions >=10.26.5 and <10.26.10, >=10.27.0 and <10.27.3, and >=10.28.0 and <10.28.2. The patched versions restore strict equality checks that prevent JSON-parsed objects from being treated as VNodes. While no known exploits are reported in the wild, the vulnerability poses a significant risk to web applications relying on vulnerable Preact versions and unsafe data handling practices.
Potential Impact
For European organizations, this vulnerability can lead to client-side code injection attacks, compromising the confidentiality and integrity of user data and potentially enabling cross-site scripting (XSS) attacks. This can result in session hijacking, credential theft, or distribution of malware via compromised web applications. Organizations in sectors with high web application usage—such as e-commerce, finance, healthcare, and government—are particularly at risk. The impact is heightened in environments where user data sources are not strictly sanitized or where legacy systems store mixed-type data. Additionally, the exploitation does not require user interaction or authentication, increasing the attack surface. The vulnerability could undermine trust in affected services and lead to regulatory penalties under GDPR if personal data is compromised. The lack of known exploits in the wild suggests limited immediate risk, but the ease of exploitation and high severity score indicate a strong need for prompt remediation.
Mitigation Recommendations
European organizations should prioritize upgrading Preact to versions 10.26.10, 10.27.3, or 10.28.2 to apply the official patches that restore strict type checking. For environments where immediate upgrade is not feasible, implement strict input validation and type checking on all data entering the render tree, ensuring that only strings or properly sanitized VNodes are passed. Sanitize and validate all user-controllable data sources, including APIs, databases, and local storage, to prevent injection of malicious objects. Employ Content Security Policy (CSP) headers with strict script-src directives to mitigate the impact of any injected scripts. Conduct thorough code reviews and audits to identify unsafe data handling patterns. Implement runtime monitoring for anomalous DOM manipulations or script injections. Educate development teams on secure coding practices related to client-side rendering frameworks. Finally, maintain an inventory of applications using Preact and verify their versions and data handling methods to assess exposure.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Italy, Spain, Poland, Belgium, Finland
CVE-2026-22028: CWE-843: Access of Resource Using Incompatible Type ('Type Confusion') in preactjs preact
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).
AI-Powered Analysis
Technical Analysis
CVE-2026-22028 is a type confusion vulnerability classified under CWE-843 affecting the Preact JavaScript framework, a lightweight alternative to React used for building web interfaces. The vulnerability stems from a regression introduced in Preact version 10.26.5 that softened the JSON serialization protections designed to prevent Virtual DOM elements (VNodes) from being constructed from arbitrary JSON data. Normally, Preact expects children passed to its render tree to be strings or valid VNodes, but due to this regression, specially crafted JSON payloads can be interpreted incorrectly as valid VNodes. This occurs when applications take JSON payloads from user-controllable sources (APIs, databases, local storage) and pass them unmodified into the render tree, assuming these values are strings. If the data source returns actual JavaScript objects instead of strings and fails to sanitize or validate these types, or if the data source is compromised (e.g., poisoned local storage or database), the crafted payload can lead to HTML injection. This injection can escalate to arbitrary script execution if the application does not have effective Content Security Policy (CSP) or other script execution mitigations. The vulnerability affects Preact versions >=10.26.5 and <10.26.10, >=10.27.0 and <10.27.3, and >=10.28.0 and <10.28.2. The patched versions restore strict equality checks that prevent JSON-parsed objects from being treated as VNodes. While no known exploits are reported in the wild, the vulnerability poses a significant risk to web applications relying on vulnerable Preact versions and unsafe data handling practices.
Potential Impact
For European organizations, this vulnerability can lead to client-side code injection attacks, compromising the confidentiality and integrity of user data and potentially enabling cross-site scripting (XSS) attacks. This can result in session hijacking, credential theft, or distribution of malware via compromised web applications. Organizations in sectors with high web application usage—such as e-commerce, finance, healthcare, and government—are particularly at risk. The impact is heightened in environments where user data sources are not strictly sanitized or where legacy systems store mixed-type data. Additionally, the exploitation does not require user interaction or authentication, increasing the attack surface. The vulnerability could undermine trust in affected services and lead to regulatory penalties under GDPR if personal data is compromised. The lack of known exploits in the wild suggests limited immediate risk, but the ease of exploitation and high severity score indicate a strong need for prompt remediation.
Mitigation Recommendations
European organizations should prioritize upgrading Preact to versions 10.26.10, 10.27.3, or 10.28.2 to apply the official patches that restore strict type checking. For environments where immediate upgrade is not feasible, implement strict input validation and type checking on all data entering the render tree, ensuring that only strings or properly sanitized VNodes are passed. Sanitize and validate all user-controllable data sources, including APIs, databases, and local storage, to prevent injection of malicious objects. Employ Content Security Policy (CSP) headers with strict script-src directives to mitigate the impact of any injected scripts. Conduct thorough code reviews and audits to identify unsafe data handling patterns. Implement runtime monitoring for anomalous DOM manipulations or script injections. Educate development teams on secure coding practices related to client-side rendering frameworks. Finally, maintain an inventory of applications using Preact and verify their versions and data handling methods to assess exposure.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-01-05T22:30:38.718Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 695fc0a3c901b06321f657fe
Added to database: 1/8/2026, 2:35:15 PM
Last enriched: 1/8/2026, 2:49:33 PM
Last updated: 1/9/2026, 11:04:39 AM
Views: 93
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2025-40361
LowCVE-2026-22713: CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') in The Wikimedia Foundation Mediawiki - GrowthExperiments Extension
LowCVE-2026-22712: CWE-116 Improper Encoding or Escaping of Output in The Wikimedia Foundation Mediawiki - ApprovedRevs Extension
LowCVE-2025-64093: Vulnerability in Zenitel ICX500
CriticalCVE-2025-64092: Vulnerability in Zenitel ICX500
HighActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.