CVE-2026-103918
@orpc/zod: Prototype injection in smart coercion
oRPC is a tool that helps build APIs that are end-to-end type-safe and adhere to OpenAPI standards. Prior to 1.14.10, the @orpc/zod ZodSmartCoercionPlugin and experimental_ZodSmartCoercionPlugin collect object and record properties in plain objects and resolve shape keys through the prototype chain. A remote client that can reach a procedure with an object or record input can supply proto to replace the prototype of the returned request object, allowing attacker-controlled inherited values to reach application lookups. For object schemas, keys such as constructor, toString, and proto can instead resolve inherited members as Zod schemas and cause an unhandled TypeError before validation. The global Object.prototype, unrelated objects, other requests, and other users are not modified, and the availability effect is limited to crafted requests rather than persistent process-wide state. This issue is fixed in version 1.14.10.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
6.5
@orpc/zod: Prototype injection in smart coercion
oRPC is a tool that helps build APIs that are end-to-end type-safe and adhere to OpenAPI standards. Prior to 1.14.10, the @orpc/zod ZodSmartCoercionPlugin and experimental_ZodSmartCoercionPlugin collect object and record properties in plain objects and resolve shape keys through the prototype chain. A remote client that can reach a procedure with an object or record input can supply proto to replace the prototype of the returned request object, allowing attacker-controlled inherited values to reach application lookups. For object schemas, keys such as constructor, toString, and proto can instead resolve inherited members as Zod schemas and cause an unhandled TypeError before validation. The global Object.prototype, unrelated objects, other requests, and other users are not modified, and the availability effect is limited to crafted requests rather than persistent process-wide state. This issue is fixed in version 1.14.10.
- Record
CVE-2026-103918- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Weakness
- CWE-915, CWE-1321
- Updated
- 2026-11-02
EUVDEUVD-2026-91793
6.5
oRPC is a tool that helps build APIs that are end-to-end type-safe and adhere to OpenAPI standards. Prior to 1.14.10, the @orpc/zod ZodSmartCoercionPlugin and experimental_ZodSmartCoercionPlugin collect object and record properties in plain objects and resolve shape keys through the prototype chain. A remote client that can reach a procedure with an object or record input can supply proto to replace the prototype of the returned request object, allowing attacker-controlled inherited values to reach application lookups. For object schemas, keys such as constructor, toString, and proto can instead resolve inherited members as Zod schemas and cause an unhandled TypeError before validation. The global Object.prototype, unrelated objects, other requests, and other users are not modified, and the availability effect is limited to crafted requests rather than persistent process-wide state. This issue is fixed in version 1.14.10.
- Record
EUVD-2026-91793- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-gcgf-fh7c-8gf2
6.5
@orpc/zod: Prototype injection in smart coercion
Summary
ZodSmartCoercionPlugin and experimental_ZodSmartCoercionPlugin mishandle object keys that name Object.prototype members. Both coerce request input before validation, so any client that can reach a procedure whose input schema contains an object or a record can:
- replace the prototype of the coerced input object, and
- make a request fail with an unhandled
TypeErrorby sending a key such asconstructor.
This is the same class of bug as GHSA-4h5r-cv8j-4456 in @orpc/json-schema, in a different package.
This is not global prototype pollution
The global Object.prototype is never modified. No shared or global state is written, so other objects in the process, other requests, and other users are not affected.
What changes is the prototype of one object: the value the coercer returns for the request that carried the payload. That object is passed on to validation and to the procedure handler, then discarded when the request ends. An ordinary {} created anywhere else in the application is unaffected.
Details
1. __proto__ replaces the prototype of the coerced value
Coerced properties were collected into a plain {}, so newObj['__proto__'] = value triggers the inherited __proto__ setter instead of creating an own property. Verified on 1.14.8 against a record schema, in both plugins:
schema: z.record(z.string())
input: {"a":"1","__proto__":{"polluted":true}}
Object.keys(result) => ["a"] // the __proto__ entry is dropped from the output
result.polluted => true // the attacker object is now this object's prototype
({}).polluted => undefined // Object.prototype is untouched
The returned value inherits attacker controlled properties, and any consumer reading them through the prototype chain, such as a handler checking input.isAdmin, an Object.assign copy, or a config lookup, sees data the client never legitimately supplied. How far that goes depends on what the application does with the coerced input. There is no generic escalation path.
This affects the record branch of both plugins, and the object branch of both plugins for any key that does not first trigger the error below.
2. Sub-schemas resolved through the prototype chain
The object branch looked up sub-schemas with shape[key], which returns inherited members for keys such as constructor, toString and __proto__. Those values, for example the Object constructor, were then dereferenced as Zod schemas:
schema: z.object({ a: z.number() })
input: { a: '123', constructor: '456' }
zod 3 => TypeError: Cannot read properties of undefined (reading 'Symbol(ORPC_CUSTOM_ZOD_DEF)')
zod 4 => TypeError: Cannot read properties of undefined (reading 'def')
Coercion throws before the assignment, so for object schemas these keys break the request rather than injecting a prototype. Any client can trigger this on its own requests. It does not affect other clients or the process as a whole.
Impact
Any oRPC server that installs ZodSmartCoercionPlugin or experimental_ZodSmartCoercionPlugin from @orpc/zod and has at least one procedure whose input schema contains an object or a record. No authentication or user interaction is required beyond what the procedure itself demands.
The effect is scoped to the request that sent the payload. Because no global state is written, one request cannot influence another, and restarting the process is not needed to recover.
Patch
Fixed in 1.14.10.
In packages/zod/src/coercer.ts and packages/zod/src/zod4/coercer.ts:
- collect coerced object and record properties into
NullProtoObj, the null prototype helper already used for untrusted keys inbracket-notation.tsandrpc-matcher.ts, so__proto__stays an ordinary own property and is preserved in the output - guard the shape lookup with
Object.hasOwn, so unknown keys fall through tocatchallas they already do for every other name
PR: middleapi/orpc#1727
##…
- Record
GHSA-gcgf-fh7c-8gf2- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Weakness
- CWE-915, CWE-1321
- Updated
- 2026-11-02
NVD
6.5
oRPC is a tool that helps build APIs that are end-to-end type-safe and adhere to OpenAPI standards. Prior to 1.14.10, the @orpc/zod ZodSmartCoercionPlugin and experimental_ZodSmartCoercionPlugin collect object and record properties in plain objects and resolve shape keys through the prototype chain. A remote client that can reach a procedure with an object or record input can supply proto to replace the prototype of the returned request object, allowing attacker-controlled inherited values to reach application lookups. For object schemas, keys such as constructor, toString, and proto can instead resolve inherited members as Zod schemas and cause an unhandled TypeError before validation. The global Object.prototype, unrelated objects, other requests, and other users are not modified, and the availability effect is limited to crafted requests rather than persistent process-wide state. This issue is fixed in version 1.14.10.
- Record
CVE-2026-103918- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Weakness
- CWE-915, CWE-1321
- Updated
- 2026-11-02
OSV
6.5
@orpc/zod: Prototype injection in smart coercion
oRPC is a tool that helps build APIs that are end-to-end type-safe and adhere to OpenAPI standards. Prior to 1.14.10, the @orpc/zod ZodSmartCoercionPlugin and experimental_ZodSmartCoercionPlugin collect object and record properties in plain objects and resolve shape keys through the prototype chain. A remote client that can reach a procedure with an object or record input can supply proto to replace the prototype of the returned request object, allowing attacker-controlled inherited values to reach application lookups. For object schemas, keys such as constructor, toString, and proto can instead resolve inherited members as Zod schemas and cause an unhandled TypeError before validation. The global Object.prototype, unrelated objects, other requests, and other users are not modified, and the availability effect is limited to crafted requests rather than persistent process-wide state. This issue is fixed in version 1.14.10.
- Record
CVE-2026-103918- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Weakness
- CWE-1321, CWE-915
- Updated
- 2026-11-02
OSVGHSA-gcgf-fh7c-8gf2
6.5
@orpc/zod: Prototype injection in smart coercion
Summary
ZodSmartCoercionPlugin and experimental_ZodSmartCoercionPlugin mishandle object keys that name Object.prototype members. Both coerce request input before validation, so any client that can reach a procedure whose input schema contains an object or a record can:
- replace the prototype of the coerced input object, and
- make a request fail with an unhandled
TypeErrorby sending a key such asconstructor.
This is the same class of bug as GHSA-4h5r-cv8j-4456 in @orpc/json-schema, in a different package.
This is not global prototype pollution
The global Object.prototype is never modified. No shared or global state is written, so other objects in the process, other requests, and other users are not affected.
What changes is the prototype of one object: the value the coercer returns for the request that carried the payload. That object is passed on to validation and to the procedure handler, then discarded when the request ends. An ordinary {} created anywhere else in the application is unaffected.
Details
1. __proto__ replaces the prototype of the coerced value
Coerced properties were collected into a plain {}, so newObj['__proto__'] = value triggers the inherited __proto__ setter instead of creating an own property. Verified on 1.14.8 against a record schema, in both plugins:
schema: z.record(z.string())
input: {"a":"1","__proto__":{"polluted":true}}
Object.keys(result) => ["a"] // the __proto__ entry is dropped from the output
result.polluted => true // the attacker object is now this object's prototype
({}).polluted => undefined // Object.prototype is untouched
The returned value inherits attacker controlled properties, and any consumer reading them through the prototype chain, such as a handler checking input.isAdmin, an Object.assign copy, or a config lookup, sees data the client never legitimately supplied. How far that goes depends on what the application does with the coerced input. There is no generic escalation path.
This affects the record branch of both plugins, and the object branch of both plugins for any key that does not first trigger the error below.
2. Sub-schemas resolved through the prototype chain
The object branch looked up sub-schemas with shape[key], which returns inherited members for keys such as constructor, toString and __proto__. Those values, for example the Object constructor, were then dereferenced as Zod schemas:
schema: z.object({ a: z.number() })
input: { a: '123', constructor: '456' }
zod 3 => TypeError: Cannot read properties of undefined (reading 'Symbol(ORPC_CUSTOM_ZOD_DEF)')
zod 4 => TypeError: Cannot read properties of undefined (reading 'def')
Coercion throws before the assignment, so for object schemas these keys break the request rather than injecting a prototype. Any client can trigger this on its own requests. It does not affect other clients or the process as a whole.
Impact
Any oRPC server that installs ZodSmartCoercionPlugin or experimental_ZodSmartCoercionPlugin from @orpc/zod and has at least one procedure whose input schema contains an object or a record. No authentication or user interaction is required beyond what the procedure itself demands.
The effect is scoped to the request that sent the payload. Because no global state is written, one request cannot influence another, and restarting the process is not needed to recover.
Patch
Fixed in 1.14.10.
In packages/zod/src/coercer.ts and packages/zod/src/zod4/coercer.ts:
- collect coerced object and record properties into
NullProtoObj, the null prototype helper already used for untrusted keys inbracket-notation.tsandrpc-matcher.ts, so__proto__stays an ordinary own property and is preserved in the output - guard the shape lookup with
Object.hasOwn, so unknown keys fall through tocatchallas they already do for every other name
PR: middleapi/orpc#1727
##…
- Record
GHSA-gcgf-fh7c-8gf2- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Weakness
- CWE-1321, CWE-915
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
@orpc/zodnpm |
before 1.14.10 | 1.14.10 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-103918 is a medium vulnerability (CVSS 6.5) in Middleapi Orpc, published October 2, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.25%, the 16th percentile. Fixed in @orpc/zod 1.14.10.
References
github.com/middleapi/orpc/security/advisories/GHSA-gcgf-fh7c-8gf2
github.com/middleapi/orpc/pull/1727
github.com/middleapi/orpc/commit/26314dfb443237c495116c5794d3d30a7a22c570
github.com/middleapi/orpc/releases/tag/v1.14.10
nvd.nist.gov/vuln/detail/CVE-2026-103918
github.com/advisories/GHSA-gcgf-fh7c-8gf2
github.com/CVEProject/cvelistV5/tree/main/cves/2026/103xxx/CVE-2026-103918.json
github.com/middleapi/orpc
Left out here: the rest of 2 source descriptions. The JSON record has them.