`@orpc/client` has Prototype Pollution via `StandardRPCJsonSerializer` Deserialization
Summary
A critical Prototype Pollution vulnerability exists in the RPC JSON deserializer of the @orpc/client package. The vulnerability allows unauthenticated, remote attackers to inject arbitrary properties into the global Object.prototype. Because this pollution persists for the lifetime of the Node.js process and affects all objects, it can lead to severe security breaches, including authentication bypass, denial of service, and potentially Remote Code Execution.
Vulnerability Details
The root cause lies in the deserialize() method of StandardRPCJsonSerializer. When processing attacker-controlled path segments from the meta and maps arrays, the deserializer fails to implement validation or sanitization for dangerous JavaScript object keys, specifically __proto__ and constructor:
There are two primary distinct write vectors available to an attacker:
- The
metavector: Writes type-constrained values (e.g.,Map,Set,Date) to arbitrary object paths. - The
mapsvector: Allows the injection of arbitrary string values. This occurs because the return value ofgetBlob(i)(which relies onFormData.get(i.toString())) is castas Blob. Since this is strictly a TypeScript compile-time cast, the runtime execution allows standard text fields to return as arbitrary strings.
Crucially, this deserialization process occurs at the very beginning of the request lifecycle before any Zod schema validation takes place. Consequently, a malicious payload will successfully pollute the prototype even if the request is subsequently rejected by the validation layer.
This issue impacts all server adapters utilizing the RPC protocol.
Proof of Concept
To reproduce the vulnerability, set up the playgrounds/astro environment and start the development server using pnpm dev.
Run the following curl command to send a crafted payload:
curl -X POST http://localhost:4321/rpc/planet/create \
-F 'data={"json":{},"meta":[],"maps":[["__proto__","role"]]}' \
-F '0=admin'
Result: The deserializer evaluates maps, follows the __proto__ path, and maps index 0 to the string "admin". This immediately applies Object.prototype.role = "admin" across the entire Node.js server instance.
Impact
Servers relying on StandardRPCJsonSerializer for deserialization are immediately susceptible to global prototype pollution. The potential impacts including:
- Privilege Escalation / Authorization Bypass: Attackers can bypass flawed security checks. For example, if the server relies on a defaulted property check like
if (user.role === "admin"), the application will evaluate this astruefor all users globally. - Remote Code Execution: If the application or its dependencies contain susceptible prototype pollution gadgets (e.g., dynamically executing shell commands or scripts based on object properties), this vulnerability can be leveraged into full RCE.
- Denial of Service: Attackers can overwrite built-in methods (e.g.,
toString) or set objects into unexpected states, causing the application to crash or throw unhandled exceptions globally.
Betroffene Software
Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.
| Plattform | Paket | Anfällige Versionen | Behoben in |
|---|---|---|---|
| npm-Paket | @orpc/client | < 1.13.6 | 1.13.6 |
Verweise
- CVSS-Vektor
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:L/SI:L/SA:N- Schwäche (CWE)
CWE-1321- Plattform
- npm
- Paket
@orpc/client- Veröffentlicht
- 02.03.2026
- Aktualisiert
- 11.10.2026 10:22
Quellen und Lizenzen
OSV / GitHub Advisory Database - GHSA-m272-9rp6-32mc - CC BY 4.0
Schwachstellenhistorie: @orpc/client
Alle veröffentlichten Schwachstellen dieses Pakets (npm-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.
Dies ist die einzige bekannte Schwachstelle dieses Pakets.
Erkennen Sie Schwachstellen in Ihrer Anwendung
Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.