Dec 1, 2026·9 min read·1 visit
React Router versions 7.0.0 through 7.18.4 and 8.0.0 through 8.5.0 contain a prototype pollution flaw in the vendored turbo-stream v2 deserializer. Direct property assignment during stream hydration allows '__proto__' keys to mutate Object.prototype. Users must upgrade to React Router 7.18.5 or 8.5.1.
CVE-2026-139996 is a prototype pollution vulnerability (CWE-1321) in React Router's vendored turbo-stream deserializer, utilized in Framework mode for single-fetch transitions and client-server hydration. When unflattening serialized streams, the decoder assigns object properties using direct bracket notation (object[key] = value) rather than defining own properties via Object.defineProperty. Furthermore, the deserializer lacks integer and bounds validation on stream reference indices. An attacker capable of supplying crafted turbo-stream payloads to the deserializer can pollute Object.prototype or trigger arbitrary index dereferences, compromising application integrity and confidentiality.
React Router (developed under the remix-run/react-router repository) provides routing and data loading functionality for React applications. In Framework mode, React Router relies on a streaming serialization and deserialization protocol known as turbo-stream, which is vendored directly inside the packages/react-router/vendor/turbo-stream-v2/ directory. This subsystem is responsible for flattening and unflattening complex JavaScript data structures—including circular references, Promises, Maps, Sets, and nested objects—across client-server boundaries during hydration and single-fetch data transitions.
CVE-2026-139996 (tracked also as GHSA-qhgm-jj2j-75wj) is a prototype pollution vulnerability (CWE-1321) coupled with improper array index validation within the unflatten.ts module of the vendored turbo-stream deserializer. When decoding a flat array of tuple instructions and reference indices back into structured JavaScript objects, the deserializer performs direct property assignment (object[key] = value) without neutralizing special property identifiers such as __proto__.
In JavaScript runtimes, assigning a value to the __proto__ property via bracket notation invokes the built-in accessor setter on Object.prototype.__proto__, altering the prototype reference of the target object or mutating attributes on the prototype chain. Because the deserializer also fails to validate whether reference indices are safe, bounded integers, an attacker can pass non-integer keys (such as "constructor" or "__proto__") or out-of-bounds offsets during hydration lookups.
Successful exploitation allows an unauthenticated attacker who can inject or control serialized turbo-stream data to modify object prototypes within the executing JavaScript environment. Depending on the application architecture and subsequent code paths (gadgets) that inspect inherited object properties, this condition leads to authentication bypasses, privilege escalation, or manipulation of internal framework execution logic.
The root cause of CVE-2026-139996 resides in packages/react-router/vendor/turbo-stream-v2/unflatten.ts within the hydrate function. The turbo-stream format represents an object graph as a flat JSON array (values), where objects use string keys prefixed with an underscore (e.g., _1: 3) to reference the array indices of their corresponding property keys and values. During deserialization, the hydrate function iterates through these indices, resolves dependencies, and schedules deferred property assignments inside a postRun callback queue.
The primary flaw occurs during the execution of the postRun callbacks when reconstructing plain JavaScript objects. The deserializer stores the resolved key in r[0] and the resolved value in r[1], and then executes object[r[0]] = r[1]. In ECMAScript, bracket property assignment ([[Set]]) checks the prototype chain for accessor properties before creating an own data property on the target instance. Because Object.prototype defines a setter for __proto__, supplying "__proto__" as r[0] and an attacker-controlled object as r[1] overwrites the prototype of object or pollutes properties across the prototype chain rather than defining a literal "__proto__" data property.
A secondary flaw in the same function involves insufficient validation of array reference indices. When hydrate processes an index or resolves special reference types—specifically TYPE_PROMISE ("P") and TYPE_PREVIOUS_RESOLVED ("Z")—it uses the provided index b directly as a property lookup on the hydrated and values arrays (hydrated[b]).
Because JavaScript arrays are objects, indexing an array with a non-integer string like "constructor", "length", or "__proto__" resolves properties on Array.prototype or Object.prototype instead of throwing an out-of-bounds error. Similarly, negative integers, floating-point values, or integers exceeding the array length were not rejected prior to lookup, allowing crafted streams to reference internal array properties or uninitialized slots during deserialization.
The vulnerability was remediated in commits 18e1fbd1f5323ec39f18a6de74ba15465d46f164 (v8 branch) and d7223c082799207b07d0f4ac5c4b1cb2eb763fb4 (v7 branch). The patch modifies packages/react-router/vendor/turbo-stream-v2/unflatten.ts to address both the unsafe property assignment and the unvalidated index lookups.
Before the patch, the object property hydration in unflatten.ts queued a direct assignment inside postRun:
// Vulnerable code in packages/react-router/vendor/turbo-stream-v2/unflatten.ts
postRun.push(() => {
// Direct assignment invokes the Object.prototype.__proto__ setter
// if r[0] evaluates to "__proto__"
object[r[0]] = r[1];
});The patch replaces the bracket assignment with Object.defineProperty ([[DefineOwnProperty]]). Unlike [[Set]], Object.defineProperty bypasses setters on the prototype chain and explicitly creates an own data property directly on object, even if the property key is "__proto__", "constructor", or "prototype":
// Patched code in packages/react-router/vendor/turbo-stream-v2/unflatten.ts
postRun.push(() => {
// Safely defines an own property without triggering prototype setters
Object.defineProperty(object, r[0], {
value: r[1],
enumerable: true,
configurable: true,
writable: true,
});
});To prevent invalid index dereferencing, the patch introduces a helper function validateIndex and invokes it at the entry of the hydrate loop as well as inside the TYPE_PROMISE and TYPE_PREVIOUS_RESOLVED switch cases:
// Patched index validation in packages/react-router/vendor/turbo-stream-v2/unflatten.ts
function hydrate(this: ThisDecode, index: number): any {
// ... loop setup ...
validateIndex(index, values.length);
if (hydrated[index]) {
set(hydrated[index]);
continue;
}
// ... inside switch (type) ...
case TYPE_PROMISE:
validateIndex(b, values.length);
if (hydrated[b]) {
set((hydrated[index] = hydrated[b]));
} else {
// ...
case TYPE_PREVIOUS_RESOLVED:
validateIndex(b, values.length);
set((hydrated[index] = hydrated[b]));
continue;
}
function validateIndex(index: number, length: number) {
// Rejects non-integers (strings, objects, floats), negative numbers, and out-of-bounds indices
if (!Number.isSafeInteger(index) || index < 0 || index >= length) {
throw new SyntaxError();
}
}The fix is complete for this deserialization code path. By enforcing Number.isSafeInteger(index) along with strict lower (>= 0) and upper (< length) bounds checks, any attempt to pass string keys, arrays, booleans, or out-of-range offsets into index references immediately throws a SyntaxError before touching hydrated or values. Using Object.defineProperty ensures that deserialized objects retain standard data descriptors without mutating the prototype chain.
Exploiting CVE-2026-139996 requires an attacker to feed a malicious turbo-stream payload into a channel or endpoint that invokes the turbo-stream decode / unflatten routines. In React Router Framework mode, this protocol is used for single-fetch data loading and client-server state hydration. The CVSS v3.1 Attack Complexity is rated High (AC:H) because the attacker must target a specific execution context where untrusted input is decoded by turbo-stream or perform a man-in-the-middle / response injection attack against the hydration stream.
A turbo-stream payload consists of a line-delimited JSON array where index 0 represents the root value. Object literals in the stream map key indices (prefixed with _) to value indices. To trigger prototype pollution or prototype replacement on a deserialized object, an attacker constructs a stream tuple where a key index points to the string "__proto__" and the value index points to an attacker-controlled object:
// Example payload structure from the vendor test suite:
// Index 0: Root object { _1: 3 } -> maps key at index 1 to value at index 3
// Index 1: [2] -> key array pointing to index 2
// Index 2: "__proto__" -> the property name
// Index 3: { _4: 5 } -> nested object mapping key at index 4 to value at index 5
// Index 4: "nested" -> polluted property name
// Index 5: "value" -> polluted property value
const payload = [{ _1: 3 }, [2], "__proto__", { _4: 5 }, "nested", "value"];When an unpatched version of React Router decodes this stream, hydrate resolves index 2 ("__proto__") and index 3 ({ nested: "value" }), then runs output["__proto__"] = { nested: "value" }. As a consequence, Object.getPrototypeOf(output) is overwritten with { nested: "value" }, and accessing output.nested resolves to "value" via prototype inheritance rather than evaluating to undefined.
Similarly, an attacker can exploit the missing index validation by sending a crafted reference instruction for a Promise ("P") or a previously resolved value ("Z") containing an invalid index:
// Malicious reference stream payload targeting TYPE_PROMISE ("P") or TYPE_PREVIOUS_RESOLVED ("Z")
const maliciousRefStream = [["P", "__proto__"]];
const outOfBoundsStream = [["Z", 100]];In unpatched versions, hydrated["__proto__"] resolves to Object.prototype (which is truthy), causing the deserializer to bind Object.prototype directly into the hydrated result graph as if it were a resolved Promise or hydrated value. With the patch applied, validateIndex intercepts "__proto__" and 100, terminating deserialization with a SyntaxError.
CVE-2026-139996 carries a CVSS v3.1 base score of 7.4 (High) with the vector CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N. The vulnerability is remotely exploitable over the network without authentication (AV:N/PR:N/UI:N), though exploitation depends on the application exposing a path where attacker-controlled data is passed into the turbo-stream deserializer (AC:H).
The primary security impact affects Confidentiality (C:H) and Integrity (I:H). When prototype attributes are modified or when Object.prototype is injected into the hydrated object graph via invalid index dereferencing (hydrated["__proto__"]), subsequent application logic operating on the deserialized data can be subverted.
If application code checks for configuration flags, authorization roles, or routing states on the deserialized object (for example, if (user.isAdmin) or if (options.allowUnsafe)), an attacker can satisfy those conditions by injecting properties onto the prototype. In Node.js server-side rendering (SSR) environments, prototype pollution can also interact with third-party libraries or template engines (known as prototype pollution gadgets) to achieve cross-site scripting (XSS) during client hydration or arbitrary code execution on the server.
Availability impact is rated as None (A:N) in the official CVSS vector, as the primary exploit paths focus on unauthorized data access and state manipulation rather than denial of service. As of publication, no public exploit tools exist outside the vendor regression tests, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog.
The definitive remediation for CVE-2026-139996 is to upgrade react-router and all associated @react-router/* monorepo packages to the patched versions released on 2026-10-27.
7.18.5 or later.8.5.1 or later.Update the dependency specifications in package.json across all affected projects:
{
"dependencies": {
"react-router": "^7.18.5",
"@react-router/node": "^7.18.5",
"@react-router/serve": "^7.18.5"
}
}> [!NOTE]
> Ensure that lockfiles (package-lock.json, yarn.lock, or pnpm-lock.yaml) are regenerated and that the resolved version of react-router inside node_modules matches >= 7.18.5 (for v7) or >= 8.5.1 (for v8).
For environments where an immediate package upgrade cannot be deployed, operators running React Router on Node.js can implement runtime defense-in-depth measures to mitigate prototype manipulation:
__proto__ in Node.js: Pass the --disable-proto=delete or --disable-proto=throw command-line flag to the Node.js process. This completely removes the Object.prototype.__proto__ accessor property from the V8 runtime, neutralizing prototype pollution vectors that rely on bracket assignment to __proto__.Object.freeze(Object.prototype) and Object.freeze(Array.prototype) during application bootstrap to prevent runtime mutation of root prototypes.CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
react-router remix-run | >= 7.0.0, < 7.18.5 | 7.18.5 |
react-router remix-run | >= 8.0.0, < 8.5.1 | 8.5.1 |
| Attribute | Detail |
|---|---|
| CVE ID | CVE-2026-139996 (GHSA-qhgm-jj2j-75wj) |
| Weakness | CWE-1321 (Prototype Pollution) |
| CVSS v3.1 Score | 7.4 High (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N) |
| Affected Component | packages/react-router/vendor/turbo-stream-v2/unflatten.ts |
| Vulnerable Versions | react-router >= 7.0.0, < 7.18.5 and >= 8.0.0, < 8.5.1 |
| Patched Versions | react-router 7.18.5 and 8.5.1 |
| Exploit Status | PoC (Unit tests in official patch commits) |
| CISA KEV Status | Not Listed |
The software receives input from an upstream component, but it does not properly neutralize special elements such as __proto__, constructor, or prototype before modifying attributes of an object or invoking assignment operations.
CVE-2026-137181 (GHSA-637h-v79h-mvqf) is an incorrect authorization vulnerability (CWE-863) in OpenFGA versions 1.10.3 through 1.22.x. The graph evaluation engine fails to distinguish between normal stream exhaustion and context cancellations or deadline exceedances during concurrent set evaluations. When resolving models using relational set operations (and, or, but not), an aborted worker branch can be evaluated as empty rather than errored, causing the engine to return unauthorized access grants (Allowed: true). When query caching is enabled, these erroneous evaluation states can be persisted to the in-memory cache, poisoning subsequent authorization checks.
An uncaught exception vulnerability (CWE-248) in Engine.IO versions prior to 6.6.12 allows remote unauthenticated attackers to cause a Denial of Service (DoS) against Node.js applications utilizing Engine.IO or Socket.IO. By sending an HTTP upgrade request targeting a non-Engine.IO URL path and forcibly resetting the underlying TCP connection before the internal destruction timeout expires, an attacker triggers an unhandled ECONNRESET error event on the socket object, terminating the entire Node.js runtime process.
CVE-2026-137199 (GHSA-ghv9-86vm-4v8m) is a critical OS command injection vulnerability in the Node.js cross-spawn library affecting versions prior to 6.0.7 and 7.1.0 on Windows. The vulnerability stems from incomplete metacharacter escaping when routing batch scripts (.bat and .cmd) outside of node_modules/.bin through cmd.exe, alongside flaws in file extension canonicalization, environment variable expansion, and line break handling. Attackers who control arguments passed to batch scripts can break out of argument quoting and execute arbitrary system commands.
An improper data encoding vulnerability (CWE-172) exists in the OpenTelemetry Collector exporterhelper package between versions 0.147.0 and 0.163.x. When metadata-partitioned batching is enabled with multiple metadata keys, the partition key generator uses an unescaped null byte delimiter to concatenate key names and multi-valued header arrays. An authenticated attacker capable of sending multi-valued HTTP or gRPC headers to an ingress receiver can induce partition key collisions, causing cross-tenant telemetry data mixture, data poisoning, or unauthorized data exfiltration.
CVE-2026-137187 (GHSA-5xhm-p3jx-2fmc) is a missing authorization vulnerability (CWE-862) in @zereight/mcp-gitlab affecting versions 2.2.5 through 2.3.6. The flaw exists within the gitlab_api_request tool, where project allowlist enforcement fails open when evaluating API paths that do not conform to the /projects/:id pattern or when following HTTP redirects to an empty relative path. Attackers or compromised LLM agents with access to the api toolset can bypass project isolation boundaries to query or modify group, user, and instance-level GitLab resources permitted by the server's underlying authentication token.
Hugo versions 0.152.0 through 0.167.x contain a path traversal and sandbox bypass vulnerability in the module configuration loader. When a root project does not define module replacements, Hugo permits imported themes or modules to define their own module.replacements directives. Because replaced module imports are internally marked as project-replaced, they bypass theme directory path restrictions, allowing an untrusted theme to mount arbitrary host filesystem directories and expand the Node.js read sandbox.