{"id":"CVE-2026-22028","aliases":["CVE-2026-22028","GHSA-36hm-qxxp-pg3m"],"related":[],"kind":"vulnerability","state":"published","title":"Preact has JSON VNode Injection issue","summary":"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).","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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).","source":"cvelist"},{"lang":"en","text":"## 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Preact, un framework ligero de desarrollo web, protección de serialización JSON para evitar que los elementos del DOM Virtual se construyan a partir de JSON arbitrario. Una regresión introducida en Preact 10.26.5 hizo que esta protección se suavizara. En aplicaciones donde se asume que los valores de las cargas útiles JSON son cadenas y se pasan sin modificar a Preact como hijos, se podría construir una carga útil JSON especialmente diseñada que sería tratada incorrectamente como un VNode válido. Cuando esta cadena de fallos ocurre, puede resultar en inyección HTML, lo que puede permitir la ejecución arbitraria de scripts si no se mitiga mediante CSP u otros medios. Las aplicaciones que utilizan versiones afectadas de Preact son vulnerables si cumplen todas las siguientes condiciones: primero, pasan valores sin modificar y sin sanear de fuentes de datos modificables por el usuario (APIs, bases de datos, almacenamiento local, etc.) directamente al árbol de renderizado; segundo, asumen que estos valores son cadenas pero la fuente de datos podría devolver objetos JavaScript reales en lugar de cadenas JSON; y tercero, la fuente de datos o bien no realiza la sanitización de tipos Y almacena/devuelve ciegamente objetos sin procesar indistintamente con cadenas, O está comprometida (p. ej., almacenamiento local, sistema de archivos o base de datos envenenados). Las versiones 10.26.10, 10.27.3 y 10.28.2 aplican un parche al problema. Las versiones del parche restauran las comprobaciones de igualdad estricta anteriores que evitan que los objetos analizados por JSON sean tratados como VNodes válidos. Otras mitigaciones están disponibles para aquellos que no pueden actualizar de inmediato. Validar tipos de entrada, convertir o validar datos de red, sanear datos externos y usar la Política de Seguridad de Contenido (CSP).","source":"nvd"}],"published":"2026-01-07T19:28:15.000Z","modified":"2026-09-10T03:50:32.404Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":7.2,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":7.2,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-843"],"affected":[{"ranges":[{"version":">= 10.26.5, < 10.26.10","status":"affected"},{"version":">= 10.27.0, < 10.27.3","status":"affected"},{"version":">= 10.28.0, < 10.28.2","status":"affected"}],"vendor":"preactjs","product":"preact","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"10.26.5","status":"affected","fixed":"10.26.10"}],"ecosystem":"npm","package":"preact","purl":"pkg:npm/preact","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"10.27.0","status":"affected","fixed":"10.27.3"}],"ecosystem":"npm","package":"preact","purl":"pkg:npm/preact","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"10.28.0","status":"affected","fixed":"10.28.2"}],"ecosystem":"npm","package":"preact","purl":"pkg:npm/preact","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"10.26.5","fixed":"10.26.10"},{"status":"affected","introduced":"10.27.0","fixed":"10.27.3"},{"status":"affected","introduced":"10.28.0","fixed":"10.28.2"}],"vendor":"preactjs","product":"preact","cpe":"cpe:2.3:a:preactjs:preact:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/preactjs/preact/security/advisories/GHSA-36hm-qxxp-pg3m","tags":["exploit","mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-22028","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/preactjs/preact","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-01-08T14:52:00.716Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-22028","url":"https://www.cve.org/CVERecord?id=CVE-2026-22028","licence":"CVE Terms of Use","modified":"2026-01-08T15:55:06.321Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-36hm-qxxp-pg3m","url":"https://github.com/advisories/GHSA-36hm-qxxp-pg3m","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:32.404Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-22028","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-22028","licence":"Public domain","modified":"2026-06-17T10:19:23.103Z"}],"updatedAt":"2026-11-25T22:59:12.666Z","epss":{"score":0.00271,"percentile":0.20669,"date":"2026-12-01T12:00:22.000Z"}}