Summary
React Router Framework Mode versions 7.0.0 through 7.14.1 can participate in a chained remote code execution (RCE) scenario when combined with an existing prototype pollution bug in the surrounding application code.
Under specific conditions, crafted external requests can abuse polluted objects and server-side deserialization paths to trigger unauthorized code execution on the remote server. Declarative Mode (<BrowserRouter>) and Data Mode (createBrowserRouter/<RouterProvider>) are not affected.
Affected context
This vulnerability arises in React applications that:
- Use React Router 7.0.0–7.14.1 in Framework Mode on the server side, and
- Contain an existing prototype pollution vulnerability elsewhere in the application code, and
- Expose HTTP endpoints capable of processing externally supplied data that influences server-side routing or configuration.
In this context, polluted prototypes can alter data structures that React Router's Framework Mode logic relies on, allowing attacker-controlled data to flow into deserialization or dynamic evaluation paths that support RCE.
Exploit preconditions
- Attack surface: Network-exposed endpoints handled by a server-side React Router Framework Mode application.
- Required access: Ability to send crafted HTTP(S) requests to the vulnerable application (no direct filesystem or shell access required).
- Application prerequisites:
- React Router 7.0.0–7.14.1 running in Framework Mode.
- An exploitable prototype pollution vulnerability in the surrounding app or framework code.
- Server-side logic that uses polluted objects in configuration, routing, or data processing that ultimately feed into a deserialization or dynamic execution step.
- Trigger point: A two-step request sequence in which:
- The first step pollutes object prototypes via an existing bug.
- The second step causes React Router Framework Mode to operate on polluted data, enabling attacker-controlled input to influence unsafe deserialization or execution.
- Why exploitation is possible: Framework Mode trusts the shape and properties of objects it receives from the application environment. When prototypes are polluted, these objects may gain unexpected properties or behaviors that are interpreted in a way that ultimately reaches an unsafe deserialization or execution primitive (CWE-502).
Why this happens
The underlying issue is a chained vulnerability where React Router's Framework Mode behavior can be coerced into participating in unsafe deserialization flows when upstream objects have been compromised via prototype pollution.
In abstract terms:
- Prototype pollution allows attackers to inject properties into base object prototypes.
- Framework Mode relies on these objects for configuration or routing metadata without fully constraining or sanitizing inherited properties.
- Under certain conditions, these attacker-controlled properties can alter what is deserialized or executed, effectively turning trusted configuration into a vehicle for running arbitrary code.
This matches CWE-502: Unsafe Deserialization at the conceptual level: untrusted or attacker-influenced data is allowed to control deserialization or dynamic behavior in a way that exceeds its intended data-only role, enabling code execution when combined with another bug class (prototype pollution).
Potential impact
- Remote code execution on the server handling React Router Framework Mode requests.
- Unauthorized access to sensitive runtime data such as environment variables, API keys, or configuration secrets.
- Manipulation of server-side logic, including routing, rendering, and feature flags.
- Use of the compromised server as a pivot for lateral movement within the hosting environment or internal network.
- Service disruption or defacement of content served by the affected application.
General mitigation guidance
Effective mitigation focuses on both eliminating unsafe data flows in Framework Mode and removing the prerequisite prototype pollution risk:
- Constrain object shapes and inheritance:
- Avoid relying on plain objects with ambient prototype chains for routing or configuration metadata; prefer frozen objects,
Object.create(null), or strongly-typed structures. - Normalize and validate data structures used by Framework Mode before they influence routing or server-side behavior.
- Harden against prototype pollution:
- Sanitize incoming data before merging it into global or shared objects (e.g., reject keys like
__proto__,constructor,prototype). - Use defensive merge utilities that explicitly block prototype-related keys rather than generic deep-merge functions.
- Reduce deserialization and execution risk:
- Treat any data influenced by user input as untrusted; ensure it cannot directly control deserialization targets, class types, or dynamic code paths.
- Favor declarative configuration and static routing definitions over dynamic evaluation wherever possible.
- Apply least privilege and isolation:
- Run server processes with minimal OS and network privileges so that, if a chain were exploited, the blast radius is constrained.
- Separate concerns (routing, data loading, templating) so a compromise in one layer cannot trivially escalate to full code execution.
These patterns help protect not only against this specific chain but also against similar deserialization and prototype-based attacks in other frameworks.
How teams detect issues like this
Detection benefits from looking for both components of the chain—prototype pollution and unsafe deserialization behavior—within applications using React Router Framework Mode:
- Static analysis and code scanning:
- Flag uses of deep merge utilities (e.g., custom
deepMerge,Object.assignon untrusted input) that do not explicitly block prototype-related keys. - Identify custom serialization/deserialization paths where user-influenced data can determine object types, constructors, or handlers.
- Highlight code that trusts inherited object properties in routing or configuration, especially in server-side React tooling and Framework Mode integration points.
- Code review signals:
- Server-side React Router Framework Mode integrations that pull configuration from request data, headers, cookies, or untrusted sources.
- Patterns where configuration objects are reused globally across requests, increasing the impact of a single pollution event.
- Runtime and logging approaches:
- Monitor for suspicious properties (e.g.,
__proto__,constructor) appearing in request payloads and logs. - Add defensive logging around routing/configuration resolution to detect unexpected keys or structural anomalies.
- Automated security tooling:
- Integrate SAST and dependency scanning tools into CI to flag prototype pollution patterns and unsafe deserialization constructs.
- Use application-level security tests (DAST) to probe for prototype pollution by sending payloads with dangerous keys and observing behavior.

