Feb 24, 2026·6 min read·90 visits
Preact forgot how to tell the difference between a real Virtual DOM node and a JSON object masquerading as one. If you pass user-controlled JSON into a render tree, attackers can inject arbitrary HTML components and execute JavaScript.
A high-severity type confusion vulnerability in Preact allows attackers to smuggle malicious Virtual DOM nodes via simple JSON payloads, leading to Cross-Site Scripting (XSS). A regression in version 10.26.5 weakened the internal validation logic, causing the framework to mistake plain JavaScript objects for trusted VNodes.
In the modern web ecosystem, we've largely outsourced our DOM manipulation anxiety to frameworks like React and Preact. We trust them to take our messy state and efficiently paint the screen. We assume that when we write <div>{userInput}</div>, the framework will treat userInput as exactly that: text. Maybe a number. But certainly not executable code.
Preact, the lightweight cousin of React, operates on Virtual DOM (VNode) objects. These are lightweight JavaScript objects that describe what the UI should look like. To prevent chaos, Preact (and React) historically rely on a mechanism to distinguish a "blessed" VNode created by the framework from a random JSON object sent by an API.
Usually, this is done via Symbols or non-enumerable properties—things that JSON.stringify() destroys and JSON.parse() cannot recreate. It is the digital equivalent of a holographic watermark on a banknote. If the watermark isn't there, it's just monopoly money.
But in CVE-2026-22028, Preact stopped checking for the watermark. It started accepting the monopoly money. And unfortunately for us, the attackers are printing cash.
The vulnerability is a classic Type Confusion bug, specifically CWE-843. The core issue lies in how Preact decides if a JavaScript object is a valid VNode that should be rendered as an element, or just a plain object that should be stringified or ignored.
Prior to version 10.26.5, Preact enforced strict checks. It looked for specific internal markers—often Symbols or specific integer constants—that an attacker cannot inject via a standard JSON payload because JSON doesn't support them. You can't put Symbol('react.element') in a JSON file. It just doesn't parse.
However, a regression introduced in 10.26.5 "softened" these checks. The developers likely tried to optimize the hot path of the renderer or support a specific edge case for serialization. In doing so, they inadvertently allowed "Duck Typing" on VNodes.
If it looks like a VNode (has a props property, has a type property) and quacks like a VNode (has a __v property set to 0 or null), Preact says, "Come on in!" This allows an attacker to construct a JSON object that satisfies these loose constraints, effectively forging a VNode without ever calling createElement.
Let's look at the logic. In a secure implementation, the check often involves a Symbol. Since JSON.parse returns "Plain Old JavaScript Objects" (POJOs), a secure check fails immediately against network data.
The Secure Pattern (Conceptual):
// Inside Preact's render loop
if (child && child.$$typeof === REACT_ELEMENT_SYMBOL) {
// It's a real VNode, render it.
renderVNode(child);
} else {
// It's just data. Escape it and show text.
document.createTextNode(String(child));
}The Vulnerable Pattern (Regression):
Around version 10.26.5, the logic shifted to something that looks dangerously like this:
// The check became looser to support some internal optimization
if (child && (child.__v === 0 || child.constructor === undefined)) {
// "Looks legit to me!"
renderVNode(child);
}The critical failure here is that __v: 0 is perfectly valid JSON. An attacker doesn't need to bypass a memory protection or guess a randomization seed; they just need to send { "__v": 0 } in their payload. The framework creates a VNode instance from this raw data, essentially letting the attacker define the type (HTML tag) and props (attributes) of the rendered element.
How does a hacker turn this into a weapon? Imagine a user profile page that fetches data from an API. The frontend code looks innocent enough:
// Vulnerable component
const Profile = ({ userBio }) => {
// userBio comes directly from JSON.parse(apiResponse)
return <div>{userBio}</div>;
};Normally, if userBio is a string, it renders text. If userBio is an object, React/Preact usually warns you or stringifies it to [object Object]. But thanks to the type confusion, we can feed it a structure that Preact interprets as a command to render an image tag with an XSS payload.
The Payload:
{
"type": "img",
"props": {
"src": "invalid_url_to_trigger_error",
"onerror": "alert('System Compromised via Preact!');"
},
"__v": 0
}When the application processes this:
{userBio} expression.__v: 0 and assumes this is a valid VNode.type: "img" and creates an <img> DOM element.props. src fails to load, triggering onerror.This isn't just an alert box. It's cookie theft, session hijacking, or forcing the user to perform actions (CSRF) on the platform.
This vulnerability is particularly nasty because it turns standard data handling into a remote code execution vector (in the browser context). Developers are taught to sanitize HTML strings, but they are rarely taught to sanitize JSON objects passed to the render tree because the framework is supposed to handle that isolation.
If you are using Preact 10.26.5 through 10.28.1, any endpoint where a user can store a JSON object that gets rendered into a view is a potential XSS vector. This includes:
The CVSS score is 7.2 (High), but in the right application—say, a chat app or a dashboard with high privileges—the impact is critical. It bypasses standard XSS filters that look for <script> tags because the payload is just a JSON object.
The Preact team responded quickly (and correctly) by reverting the loose check and restoring strict type validation. The patch essentially ensures that VNodes must be created by the framework's internal factory methods, which stamp them with symbols or non-serializable properties that cannot be spoofed via JSON.
Remediation Steps:
10.26.10, 10.27.3, or 10.28.2 depending on your branch.{variable} where variable comes directly from an API response without validation.// Do this:
<div>{String(userBio)}</div>
// Or this (if you expect an object structure):
<div>{userBio.text}</div>This is a stark reminder: libraries are code, and code has bugs. Trust, but verify. And maybe don't trust JSON quite so much.
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| Product | Affected Versions | Fixed Version |
|---|---|---|
Preact Preact | 10.26.5 - 10.26.9 | 10.26.10 |
Preact Preact | 10.27.0 - 10.27.2 | 10.27.3 |
Preact Preact | 10.28.0 - 10.28.1 | 10.28.2 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-843 (Type Confusion) |
| Attack Vector | Network (JSON Payload) |
| CVSS v3.1 | 6.1 (Medium) |
| CVSS v4.0 | 7.2 (High) |
| Impact | Cross-Site Scripting (XSS) |
| Exploit Status | PoC Available |
The product accesses a resource using an incompatible type, triggering a logic error that allows arbitrary code execution or component injection.
CVE-2026-9799 is an authorization bypass vulnerability in the User-Managed Access (UMA) subsystem of Keycloak (org.keycloak.authorization). When a resource server is configured with the non-default PERMISSIVE policy enforcement mode, an authenticated user holding a valid UMA permission ticket for a single typed resource can obtain an authorization Requesting Party Token (RPT) granting access to all resources of the same type across the resource server. By submitting an authorization request with the type selector prefix 'resource-type-any:<type>', the attacker bypasses instance-level owner approval checks for unshared peer resources that lack explicit static administrative policies.
CVE-2026-9083 is a path traversal and information disclosure vulnerability (CWE-22) affecting Keycloak and the Red Hat build of Keycloak. The vulnerability resides in the Java Keystore key provider component (JavaKeystoreKeyProviderFactory), which fails to restrict the user-supplied keystore file path to a designated directory. An authenticated realm administrator holding the 'manage-realm' role can supply arbitrary absolute or relative filesystem paths when configuring a key provider. Because the application returns distinct error messages depending on whether the target path does not exist, lacks read permissions, or fails keystore parsing, an attacker can use this component as an oracle to probe the underlying host filesystem.
CVE-2026-9086 is a stored Cross-Site Scripting (XSS) vulnerability in Keycloak and the Red Hat build of Keycloak. The vulnerability stems from a case-sensitive URI scheme validation check in DefaultClientValidationProvider, allowing attackers with client registration or management permissions to inject javascript: or data: URIs using mixed-case characters.
CVE-2026-62290 is an incorrect authorization vulnerability (CWE-863) in cert-manager that allows low-privileged Kubernetes namespace tenants to bypass ClusterIssuer DNS01 solver policies and exfiltrate cluster-scoped DNS credentials. By directly creating standalone ACME Challenge custom resources rather than going through the standard Certificate and Order workflow, an attacker can specify arbitrary solver provider configurations while referencing a privileged ClusterIssuer. The cert-manager ACME challenge controller reconciles these directly instantiated Challenge resources without verifying their parentage or validating the user-supplied solver parameters against the referenced ClusterIssuer's selector policies.
CVE-2026-118662 (also tracked as GHSA-8g5g-mxqh-grgj) is an improper access control and path canonicalization vulnerability in the Vite frontend build and development tool. In version 6.4.4, the Vite development server fails to strip transform and loader query parameters before evaluating file paths against the `server.fs.deny` configuration directive. When the development server is exposed to a network and sensitive files located within `server.fs.allow` match patterns in `server.fs.deny`, an unauthenticated remote attacker can bypass file access restrictions by appending specific query strings such as `?raw` or `?inline` to HTTP requests. This allows arbitrary retrieval of restricted files, including environment configuration files and private cryptographic keys.
A vulnerability in the Rust `zip` crate (versions 1.3.0 prior to 9.0.0) allows an attacker to trigger an uncatchable process abort via a crafted ZIP archive. When extracting symbolic link entries on Unix or Windows targets, `ZipArchive::extract` passes the untrusted, attacker-controlled `uncompressed_size` header value directly to `Vec::with_capacity` before reading or validating entry payload data. By supplying a 112-byte archive with a ZIP64 extended information field declaring an excessive uncompressed size, an attacker forces the memory allocator to fail and invoke `handle_alloc_error()`, immediately terminating the entire process with `SIGABRT`.